Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37616679
en ru br
ALT Linux repos
S:4.0.3-alt0.1.1

Group :: Sciences/Medicine
RPM: gnuhealth

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 



%define skip_python2 1
%define t_version %(rpm -q --qf '%%{VERSION}' trytond)
%define majorver 4.0

Name: gnuhealth

Version: %majorver.3
Release: alt0.1.1
Url: https://health.gnu.org
Summary: A Health and Hospital Information System
License: GPLv3+
Group: Sciences/Medicine
Packager: Ilya Mashkin <oddity at altlinux.ru>
Source0: https://ftp.gnu.org/gnu/health/%name-%version.tar.gz
Source1: GNUHealth.README.openSUSE
Source2: gnuhealth-control
Source3: gnuhealth.service
Source4: gnuhealth-webdav at .service
Source5: openSUSE-gnuhealth-setup
Source6: gnuhealth
Source7: gnuhealth-rpmlintrc
Source8: https://ftp.gnu.org/gnu/health/%name-%version.tar.gz.sig
Source9: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=health&download=1#/%name.keyring


BuildRequires: fdupes
BuildRequires: python3-module-setuptools rpm-build-python3
BuildRequires: python3-module-pytest python3-module-ly python3-module-Reportlab

# For the tests:

BuildRequires: python3-module-trytond
BuildRequires: python3-module-trytond_company
BuildRequires: python3-module-trytond_currency
BuildRequires: python3-module-trytond_party

# new fonts for the forms:

Requires: fonts-ttf-gnu-freefont-common python3-module-proteus
Requires: bsdtar
Requires: python3-module-trytond
Requires: python3-module-trytond_company
Requires: python3-module-trytond_currency
Requires: python3-module-trytond_party
BuildArch: noarch

#TODO:

# gnuhealth-client
# mygnuhealth

%{?systemd_ordering}

%add_python3_self_prov_path %buildroot%python3_sitelibdir/trytond/modules/

%description
GNU Health is the Hospital Information System adopted by the United
Nations University, International Institute for Global Health, for
the implementations and trainings.

This is the server component of GNU Health.
You would need the GNU Health Client as well, on the same or a different machine.
You may use the Tryton Client either
See https://en.opensuse.org/GNUHealth_on_openSUSE for instructions

%package -n python3-module-%name-orthanc
Summary: Integration module for Orthanc
Group: Sciences/Medicine
Requires: gnuhealth

%description -n python3-module-%name-orthanc
This package provides the interface to Orthanc

%prep
%setup -n %name-%version
cp %{S:1} .
cp %{S:2} .

%build
for i in h*; do
 pushd $i
 %python3_build
 popd
done

%install
for i in h*; do
 pushd $i
 %python3_install --prefix=%prefix --root=%buildroot
 popd
done

mkdir -p -m 755 %buildroot%_bindir
install -p -m 755 gnuhealth-control %buildroot%_bindir/gnuhealth-control
install -p -m 755 %{S:5} %buildroot%_bindir/openSUSE-gnuhealth-setup
install -p -m 755 %{S:6} %buildroot%_bindir/gnuhealth
install -p -m 755 scripts/demo/install_demo_database.sh %buildroot%_bindir/install_demo_database.sh

#delete empty demo directory

rm -rf scripts/demo

mkdir -p %buildroot%_unitdir
install -p -m 644 %SOURCE3 %buildroot%_unitdir/%name.service
install -p -m 644 %SOURCE4 %buildroot%_unitdir/%name-webdav at .service

mkdir -p %buildroot%_sysconfdir/tryton

#remove double license file:

rm backend/fhir/client/COPYING

#Move FHIR server to examples directory

mkdir -p -m 755 %buildroot%_docdir/%name/examples/
mv backend/fhir* %buildroot%_docdir/%name/examples/.
rmdir backend


%if %{with tests}
%check
cd %buildroot%python3_sitelibdir/trytond/modules
for i in h*; do
 pushd $i
   %pytest -rs tests
 popd
done
%endif

%pre

#Write GH Variable /etc/tryton/gnuhealthrc

#cat > %buildroot/etc/tryton/gnuhealthrc << "EOF"
#GNUHEALTH_VERSION=%version
#TRYTON_VERSION=%t_version
#EOF

%post
%post_service gnuhealth
%post_service gnuhealth-webdav at

%preun
%preun_service gnuhealth
%preun_service gnuhealth-webdav at


%files -n python3-module-%name-orthanc
%python3_sitelibdir/%{name}_orthanc*
%python3_sitelibdir/trytond/modules/health_orthanc*

%files
%_bindir/gnuhealth
%_bindir/gnuhealth-control
%_bindir/gnuhealth-webdav-server
%_bindir/openSUSE-gnuhealth-setup
%_bindir/install_demo_database.sh
%_unitdir/%name.service
%_unitdir/%name-webdav at .service
%doc Changelog gnuhealth-setup version gnuhealthrc GNUHealth.README.openSUSE scripts/* config/* doc/*
%_docdir/%name/examples*
%dir %_sysconfdir/tryton
#/etc/tryton/gnuhealthrc
%exclude %python3_sitelibdir/%{name}_orthanc*
%exclude %python3_sitelibdir/trytond/modules/health_orthanc*
%python3_sitelibdir/*

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin