diff --git a/GNUHealth.README.SUSE b/GNUHealth.README.SUSE index e7f37d0..beeb126 100644 --- a/GNUHealth.README.SUSE +++ b/GNUHealth.README.SUSE @@ -14,11 +14,13 @@ You have already installed the package gnuhealth and found this documentation. G #su postgres #nano /var/lib/pgsql/data/pg_hba.conf -Change the line + +FOR LOCAL CONNECTIONS (Database on the same machine) change the line local all all md5 to local all all trust -Save your input. + +Save your input. This will make sure that Tryton/GNUHealth server can connect to the database 3) Create a role for 'tryton' in the database (sill as user postgres) #psql -c "CREATE USER tryton WITH CREATEDB;" @@ -32,7 +34,7 @@ Save your input. uncomment super_pwd 6) start gnuhealth/trytond: -#systemctl start trytond +#systemctl start gnuhealth 7) Install the tryton client: #zypper in tryton @@ -40,10 +42,40 @@ uncomment super_pwd 8) Open the tryton client: #tryton go to 'manage profiles' -> add -> name it 'localhost' -> Host: localhost --> you should now see a button to create a database +-> you should now see a selection of available databases + +Note: Fron Tryton Release 4.2 onwards it is not possible anymore to create databases +from the Frontend. You need to do this manually (see /usr/share/doc/packages/trytond/tryton-server.README.SUSE) DONE. -Check /usr/share/doc/packages/trytond/tryton-server.README.SUSE for more Information + +Upgrade +------- + + * In case you upgrade from a previous GNU Health make sure you apply the + upgrade procedures described in /usr/share/doc/packages/gnuhealth/upgrade. + + Run tryton-admin: + + # /usr/bin/trytond-admin -c /etc/tryton/trytond.conf --all -d mydb + + GNU_Health 3.0 on openSUSE delivered 2 modules, which are not (yet) in 3.2 anymore: pdq and hl7. You need to delete them first + + Log in as database owner (usually tryton): + + # sudo su tryton -s /bin/bash + + Delete the 2 modules: + # psql mydb + delete from ir_module where name='pdq'; + delete from ir_module where name='hl7'; + + Quit with CRTL-D + Apply the database patch: + + # psql mydb < /usr/share/doc/packages/gnuhealth/upgrade/3.2/upgrade_32.sql + + Remember to replace mydb with the name of your database. GNUHealth for openSUSE (a bit more in detail) @@ -81,7 +113,7 @@ Unlike the standard GNUHealth setup, openSUSE treats GNUHealth as add-on (additi Nevertheless, you can use gnuhealth-control to create database backups, install languages and updates. Make sure the version of gnuhealth-control ends on -openSUSE. gnuhealth-control should run as root, if in doubt. In case you want to install additional Tryton modules, you need to include the Tryton repository: -zypper ar -f http://download.opensuse.org/repositories/Application:/ERP:/Tryton:/3.8/openSUSE_Leap_42.2 tryton +zypper ar -f http://download.opensuse.org/repositories/Application:/ERP:/Tryton:/4.2/openSUSE_Leap_42.3 tryton You may use the GNUHealth mailing list (health@gnu.org) for remarks or questions. @@ -105,4 +137,4 @@ Have fun and keep the neighborhood well and fit! [4] https://github.com/mbehrle/tryton/blob/wiki/InstallationonopenSUSE.md - -- Axel Braun Wed Sep 28 18:35:02 UTC 2016 + -- Axel Braun TUE Jun 20 15:40:04 UTC 2017 diff --git a/_service b/_service index aa59ca1..dbfc161 100644 --- a/_service +++ b/_service @@ -1,4 +1,4 @@ - + diff --git a/gnuhealth-3.0.8.tar.gz b/gnuhealth-3.0.8.tar.gz deleted file mode 100644 index 56ab490..0000000 --- a/gnuhealth-3.0.8.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aa9dff0407aa610554b203f93853491af2f10e43d72b5a8d06b0191c5834834d -size 10203592 diff --git a/gnuhealth-3.2.0.tar.gz b/gnuhealth-3.2.0.tar.gz new file mode 100644 index 0000000..b70f431 --- /dev/null +++ b/gnuhealth-3.2.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f281ce173a18a77062a7deed9d25996d23933045d976f490604a48567a44347 +size 10217658 diff --git a/gnuhealth-control b/gnuhealth-control index 16bcdf5..f4c7a4c 100644 --- a/gnuhealth-control +++ b/gnuhealth-control @@ -24,12 +24,12 @@ # ############################################################################## -VERSION="3.0.2.1-openSUSE" +VERSION="3.2.0-openSUSE" TRYTON_URL="http://downloads.tryton.org" GNUHEALTH_URL="http://ftp.gnu.org/gnu/health" TRANSLATE_URL="http://translate.gnusolidario.org" -GNUHEALTH_DIR="/usr/lib/python/site-packages/trytond/modules" +GNUHEALTH_DIR=$(ls -d /usr/lib/python3.* )/site-packages/trytond/modules UPDATE_DOWNLOAD_DIR="/tmp/gnuhealth_update" @@ -178,9 +178,14 @@ do_backup() cli_msg "INFO" "Creating compressed tarball with DB and GNU Health Attachment directory" | tee -a $INFOFILE -# tar -cvf "${BACKDIR}/gnuhealth_${DB}_with_fs_backup_${BACKDATE}.tar.gz" $HOME || bailout tar -cvf "${BACKDIR}/gnuhealth_${DB}_with_fs_backup_${BACKDATE}.tar.gz" /var/lib/tryton || bailout - + + message "INFO" "Creating tarball with compressed DB and GNU Health home directory" | tee -a $INFOFILE + + tar -cvf "${BACKDIR}/gnuhealth_${DB}_with_fs_backup_${BACKDATE}.tar" \ + ${BACKDIR}/backup_${DB}_${BACKDATE}.gz ${BACKDIR}/gnuhealth_${DB}_fs_backup_${BACKDATE}.tar.gz \ + || bailout + cli_msg "INFO" "Backup Successful" | tee -a $INFOFILE #Remove lock file @@ -198,7 +203,7 @@ check_status() # else # cli_msg "INFO" "No GNU Health instance seems to be running" # fi - systemctl status trytond + systemctl status gnuhealth } @@ -324,6 +329,7 @@ install_updates() # fi if [ $2 == "--dry-run" ];then + sudo zypper up -D trytond* gnuhealth exit 0 fi diff --git a/gnuhealth.changes b/gnuhealth.changes index 039013a..82d7972 100644 --- a/gnuhealth.changes +++ b/gnuhealth.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Sun Jul 2 16:19:59 UTC 2017 - axel.braun@gmx.de + +- Version 3.2.0 + +------------------------------------------------------------------- +Sat Jun 24 10:56:45 UTC 2017 - axel.braun@gmx.de + +- Requirement on python3-PyWebDAV3-GNUHealth added + +------------------------------------------------------------------- +Tue Jun 20 15:26:18 UTC 2017 - axel.braun@gmx.de + +- GNU Health version 3.1.0b3 + ------------------------------------------------------------------- Sun Mar 26 16:29:15 UTC 2017 - axel.braun@gmx.de diff --git a/gnuhealth.service b/gnuhealth.service new file mode 100644 index 0000000..94ded57 --- /dev/null +++ b/gnuhealth.service @@ -0,0 +1,21 @@ +[Unit] +Description=GNU Health server +After=syslog.target +Requires=postgresql.service + +[Service] +Type=simple +User=tryton +Group=tryton +PIDFile=/var/lib/trytond/trytond.pid + +ExecStart=/usr/bin/trytond --config /etc/tryton/trytond.conf --pidfile=/var/lib/tryton/trytond.pid --logconf=/etc/tryton/trytond_log.conf + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# We rely on systemd to restart trytond if it dies +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/gnuhealth.spec b/gnuhealth.spec index dc7ff88..08ec5db 100644 --- a/gnuhealth.spec +++ b/gnuhealth.spec @@ -2,7 +2,7 @@ # spec file for package gnuhealth # # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. -# Copyright (c) 2014-2016 Dr. Axel Braun +# Copyright (c) 2014-2017 Dr. Axel Braun # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,20 +17,22 @@ # -%define majorver 3.0 - +%define majorver 3.2 Name: gnuhealth # List of additional build dependencies -BuildRequires: python-setuptools +BuildRequires: fdupes +BuildRequires: python3-setuptools -Version: %{majorver}.8 +Version: %{majorver}.0 Release: 0 Url: http://health.gnu.org Source: http://ftp.gnu.org/gnu/health/%{name}-%{version}.tar.gz +#Source: %{name}-%{version}.tar.gz Source1: GNUHealth.README.SUSE Source2: gnuhealth-control +Source3: gnuhealth.service BuildArch: noarch @@ -39,17 +41,18 @@ License: GPL-3.0+ Group: Productivity/Office/Management Requires: proteus -Requires: python-PyWebDAV -Requires: python-caldav -Requires: python-cracklib -Requires: python-hl7apy -Requires: python-imaging -Requires: python-ldap -Requires: python-polib -Requires: python-qrcode -Requires: python-simpleeval -Requires: python-six -Requires: python-vobject +Requires: python3-PyWebDAV3-GNUHealth +Requires: python3-caldav +Requires: python3-cracklib +Requires: python3-hl7apy +Requires: python3-ldap3 +Requires: python3-polib +Requires: python3-pyBarcode +Requires: python3-pymongo +Requires: python3-qrcode +Requires: python3-simpleeval +Requires: python3-six +Requires: python3-vobject Requires: trytond Requires: trytond_account Requires: trytond_account_invoice @@ -62,6 +65,7 @@ Requires: trytond_currency Requires: trytond_party Requires: trytond_product Requires: trytond_purchase +Requires: trytond_purchase_request Requires: trytond_stock Requires: trytond_stock_lot Requires: trytond_stock_supply @@ -89,41 +93,49 @@ cp %{S:1} . cp %{S:2} . %build +#export LANG=en_US.UTF-8 +#export LC_CTYPE=en_US.UTF-8 +#export RC_LANG=en_US.UTF-8 for i in h*; do cd $i - python setup.py build + python3 setup.py build cd .. done - #pdq # cd pdq -# python setup.py build +# python3 setup.py build # cd .. +for i in try*; do + cd $i + python3 setup.py build + cd .. +done %install for i in h*; do cd $i - python setup.py install --prefix=%_prefix --root=%buildroot + python3 setup.py install --prefix=%_prefix --root=%buildroot cd .. done #pdq # cd pdq -# python setup.py install --prefix=%_prefix --root=%buildroot +# python3 setup.py install --prefix=%_prefix --root=%buildroot # cd .. +for i in try*; do + cd $i + python3 setup.py install --prefix=%_prefix --root=%buildroot + cd .. +done mkdir -p -m 755 %{buildroot}%{_bindir} install -p -m 755 gnuhealth-control %{buildroot}%{_bindir}/gnuhealth-control -# create user -%pre -#getent group tryton > /dev/null || /usr/sbin/groupadd -r tryton -#getent passwd gnuhealth > /dev/null || /usr/sbin/useradd -r -g tryton \ -# -d %{_localstatedir}/lib/%{name} -c 'GNU Health' gnuhealth -# Dont create as system user -#getent passwd gnuhealth > /dev/null || /usr/sbin/useradd -g tryton \ -# -c 'GNU Health' gnuhealth -#: +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service +%fdupes -s %{buildroot} + +%pre #Write environment changes to /etc/bash.bashrc.local cat > /etc/bash.bashrc.local << "EOF" alias cdlogs='cd /var/log/trytond' @@ -133,9 +145,21 @@ alias cdmods='cd /usr/lib/python/site-packages/trytond/modules' alias editconf='${EDITOR} /etc/tryton/trytond.conf' EOF +%service_add_pre gnuhealth.service + +%post +%service_add_post gnuhealth.service + +%preun +%service_del_preun gnuhealth.service + +%postun +%service_del_postun gnuhealth.service + %files %defattr(744,root,root) %{_bindir}/gnuhealth-control +%{_unitdir}/%{name}.service %defattr(-,root,root) %doc README Changelog COPYING gnuhealth-setup version gnuhealthrc GNUHealth.README.SUSE scripts/* backend/* config/* doc/* %{python_sitelib}/*