summaryrefslogtreecommitdiffstats
path: root/healthcare/gnuhealth.spec
blob: 111d70701017ab88727a201638a13d48e28164a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# tests cannot be executed by the build user
# since they require access to /etc/trytond.conf
# which is limited to users in the tryton group
# for security reasons
#
# packagers should run the tests by hand to make sure
# they still pass, ideally *inside* the mock used for
# building gnuhealth:
# 1. mock -r ... --with check /path/to/gnuhealth-*.src.rpm
#    this will fail as /etc/trytond.conf is not readable
# 2. mock -r ... shell
# 3. as the mock root user, rpmbuild -bb /builddir/build/SPECS/gnuhealth.spec
#    (mock already cached the --with setting in ~/.rpmmacros)
%bcond_with check

Name:           gnuhealth
# latest version for Tryton 2.2.x
# update to 1.6.1 when Tryton 2.4.x lands
Version:        1.4.5
Release:        1%{?dist}
Summary:        The free Health and Hospital Information System

License:        GPLv3+
URL:            http://health.gnu.org/ 
Source0:        http://ftp.gnu.org/gnu/health/gnuhealth-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python-qrcode
BuildRequires:  python-setuptools
BuildRequires:  trytond
BuildRequires:  trytond-account-invoice
BuildRequires:  trytond-calendar
BuildRequires:  trytond-company
BuildRequires:  trytond-country
BuildRequires:  trytond-currency
BuildRequires:  trytond-party
BuildRequires:  trytond-product

Requires:	python-qrcode
Requires:       trytond
Requires:       trytond-account-invoice
Requires:       trytond-calendar
Requires:       trytond-company
Requires:       trytond-country
Requires:       trytond-currency
Requires:       trytond-party
Requires:       trytond-product


%description
GNU HEALTH is a free, centralized Health and Hospital Information
System that provides the following functionality :

    * Electronic Medical Record (EMR)
    * Hospital Information System (HIS)
    * Health Information System

The goal is to collaborate with health professionals around the world
to improve the quality of life of the underprivileged, providing a
free system that optimizes health promotion and disease prevention.


%prep
%setup -q
# 1.6.1: does not come with setup.py yet
# mv {,off-}health_services


%build
for mod in health health_*;
do
    pushd $mod
    %{__python} setup.py build
    popd
done


%install
for mod in health health_*;
do
    pushd $mod
    %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
    popd
done

mkdir -p %{buildroot}%{_mandir}/man1/
cp -p health/man/gnuhealth.1 %{buildroot}%{_mandir}/man1/

# make test cases executable
find %{buildroot}%{python_sitelib}/trytond/modules/health*/tests/test*.py \
     ! -perm -a+x -exec chmod +x "{}" \;

# 1.6.1
#mv {off-,}health_services
#cp -pr health_services %{buildroot}%{python_sitelib}/trytond/modules/


%if %{with check}
%check
export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python_sitelib}
# some modules don't actually have tests
for mod in $(find health*/tests/__init__.py -type f \
    | sort \
    | sed -e 's|/tests/__init__.py$||');
do
    pushd $mod
    %{__python} setup.py test
    popd
done
%endif


%files
%doc COPYING README
%{_mandir}/man1/gnuhealth.1*
%{python_sitelib}/trytond/modules/health*
%{python_sitelib}/trytond_health*-%{version}-py*.egg*


%changelog
* Sat Jun  2 2012 Michel Salim <salimma@fedoraproject.org> - 1.4.5-1
- Initial package