diff --git a/gnuhealth-3.6.3.tar.gz b/gnuhealth-3.6.3.tar.gz index bb5d48a..129c094 100644 --- a/gnuhealth-3.6.3.tar.gz +++ b/gnuhealth-3.6.3.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bf5b08bbfa78fec560ac157d4d2a5b1d33f5d7985d22bf07514540c912b6fa3c -size 10492401 +oid sha256:ac96d19802dbe16f854a6a55a52afda18e42e4dd6da86da9e724a0b0a8f9330f +size 10492316 diff --git a/gnuhealth-control b/gnuhealth-control index 9a85aeb..c9f4217 100644 --- a/gnuhealth-control +++ b/gnuhealth-control @@ -1,13 +1,13 @@ #!/bin/bash # gnuhealth-control -# The GNU Health control center +# The GNU Health control center for openSUSE Installations ############################################################################## # # GNU Health: The Free Health and Hospital Information System # Copyright (C) 2008-2015 Luis Falcon -# Adaption to openSUSE Axel Braun +# Adaption to openSUSE Axel Braun # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,14 +24,12 @@ # ############################################################################## -VERSION="3.6.2-openSUSE" +VERSION="3.6.3.1-openSUSE" -TRYTON_URL="http://downloads.tryton.org" -GNUHEALTH_URL="http://ftp.gnu.org/gnu/health" -TRANSLATE_URL="http://translate.gnusolidario.org" -GNUHEALTH_DIR=$(ls -d /usr/lib/python3.* )/site-packages/trytond/modules +TRANSLATE_URL="https://translate.gnusolidario.org" +GNUHEALTH_DIR=$(rpm -ql gnuhealth | egrep '^/usr/lib/python.\..{1,2}/site-packages$') -UPDATE_DOWNLOAD_DIR="/tmp/gnuhealth_update" +UPDATE_DOWNLOAD_DIR=$(mktemp -d) usage() { @@ -93,31 +91,8 @@ cli_msg() get_current_values() { - # Bail out if no GNU Health profile exists - #if [ ! -e $HOME/.gnuhealthrc ] - #then - # cli_msg "ERROR" "No GNU Health profile found !" - # exit 1 - #fi - - # Stop if it can't find the GNU Health version - #if [ -z "$GNUHEALTH_VERSION" ] - #then - # cli_msg "ERROR" "Could not find the GNU Health version env. variable" - # exit 1 - #fi - - # Stop if current GNU Health version < 2.8.0 - #local raw_ver=`echo $GNUHEALTH_VERSION | tr -d '.'` - #if [ $raw_ver -lt 280 ] - #then - # cli_msg "ERROR" "GNU Health version must be at least 2.8" - # exit 1 - #fi cli_msg "INFO" "Environment variables" - #cli_msg "INFO" "GNUHEALTH_VERSION = ${GNUHEALTH_VERSION}" - #cli_msg "INFO" "TRYTON VERSION = ${TRYTON_VERSION}" cli_msg "INFO" "PYTHONPATH = $PYTHONPATH" } @@ -129,8 +104,10 @@ do_backup() local COMMAND=$1 local BACKDATE=`date -u +%Y-%m-%d_%H%M%S` - local LOCKFILE="/tmp/.gnuhealth_backup.lock" - local INFOFILE="/tmp/gnuhealth_backup.log" +# lockfile is moved to a location not writeable/predictable by user + local LOCKFILE="/var/run/gnuhealth_backup.lock" +# Infofile is moved to a location not writeable by user + local INFOFILE="/var/log/gnuhealth_backup.log" local BACKDIR="" local DB="" @@ -164,7 +141,7 @@ do_backup() exit 1 fi - touch $LOCKFILE + echo $$ > $LOCKFILE # Backup start @@ -190,21 +167,14 @@ do_backup() cli_msg "INFO" "Backup successfully written to ${BACKDIR}/${BACKUP_NAME}" | tee -a $INFOFILE #AB - END - #Remove lock file +#Remove lock file rm $LOCKFILE } check_status() { -# TRYTOND_PIDS=`pgrep -f "^.*python.*trytond.*$"` -# if [ $? = 0 ] -# then -# cli_msg "INFO" "GNU Health / Tryton instance(s) with PID(s) :" -# echo $TRYTOND_PIDS -# else -# cli_msg "INFO" "No GNU Health instance seems to be running" -# fi + systemctl status gnuhealth } @@ -219,163 +189,27 @@ check_download_dir() check_updates() { -# source $HOME/.gnuhealthrc - zypper lu | grep "trytond , gnuhealth" + cli_msg "INFO" "Running zypper to check for updates" + zypper lu | grep "trytond , gnuhealth" -# local TRYTOND_PATCHLEVEL=`echo ${TRYTON_VERSION} | cut -d'.' -f3` - -# local TRYTON_MODULES=`cd ${GNUHEALTH_DIR}; ls -1d trytond*` -# TRYTON_MAJOR_MINOR=`echo $TRYTON_VERSION | cut -d'.' -f1-2` - -# NEED_UPDATE_TRYTOND=0 -# NEED_UPDATE_MODULES=0 -# NEED_UPDATE_PATCHSETS=0 -# MOD_UPDATES="" -# NEED_DELETE=0 -# TO_DELETE="" - -# cli_msg "INFO" "TRYTON SERVER : Checking latest patchlevel" - -# LATEST_TRYTOND=`wget --quiet -O - ${TRYTON_URL}/${TRYTON_MAJOR_MINOR} | egrep -o trytond-${TRYTON_MAJOR_MINOR}.[0-9\.]+.tar.gz | sort -V | tail -1` -# local LATEST_TRYTOND_PATCHLEVEL=`echo ${LATEST_TRYTOND} | cut -d'.' -f3` - - # Check latest tryton server against local version -# if (( ${TRYTOND_PATCHLEVEL} < ${LATEST_TRYTOND_PATCHLEVEL} )); then -# cli_msg "WARNING" "TRYTON SERVER patchlevel ${TRYTOND_PATCHLEVEL} is outdated ! A newer version is available (${LATEST_TRYTOND})" -# NEED_DELETE=1 -# TO_DELETE="${TO_DELETE} ${GNUHEALTH_DIR}/tryton/server/trytond-${TRYTON_MAJOR_MINOR}.${TRYTOND_PATCHLEVEL}" -# NEED_UPDATE_TRYTOND=1 -# else -# cli_msg "INFO" "TRYTON SERVER patchlevel ${TRYTOND_PATCHLEVEL} is at the latest version" -# fi - - # Check latest tryton modules against local version -# for MODULE in ${TRYTON_MODULES}; do -# MODNAME=`echo $MODULE | cut -d'-' -f1` -# MODULE_PATCHLEVEL=`echo $MODULE | sed 's/^.*\.\([[:digit:]]*\)$/\1/'` -# LATEST_MODULE=`wget --quiet -O - ${TRYTON_URL}/${TRYTON_MAJOR_MINOR} | egrep -o ${MODNAME}-${TRYTON_MAJOR_MINOR}.[0-9\.]+.tar.gz | sort -V | tail -1` -# LATEST_MODULE_PATCHLEVEL=`echo ${LATEST_MODULE} | cut -d'.' -f3` -# if (( ${MODULE_PATCHLEVEL} < ${LATEST_MODULE_PATCHLEVEL} )); then -# cli_msg "WARNING" "${MODNAME} patchlevel ${MODULE_PATCHLEVEL} is outdated ! A newer version is available (${LATEST_MODULE})" -# NEED_UPDATE_MODULES=1 -# MOD_UPDATES="${MOD_UPDATES} ${LATEST_MODULE}" -# NEED_DELETE=1 -# TO_DELETE="${TO_DELETE} ${GNUHEALTH_DIR}/tryton/server/modules/${MODNAME}-${TRYTON_MAJOR_MINOR}.${MODULE_PATCHLEVEL}" -# else -# cli_msg "INFO" "${MODNAME} patchlevel ${MODULE_PATCHLEVEL} is at the latest version" -# fi -# done - - # Check latest GNU HEALTH PATCHSETS against local version -# cli_msg "INFO" "GNU HEALTH KERNEL : Checking latest PATCHSETS" - -# GNUHEALTH_MAJOR_MINOR=`echo $GNUHEALTH_VERSION | cut -d'.' -f1-2` -# GNUHEALTH_PATCHSET=`echo $GNUHEALTH_VERSION | cut -d'.' -f3` - -# PATCHSETS_NUM=`wget --quiet -O - ${GNUHEALTH_URL}/ | egrep -o gnuhealth_patchset-${GNUHEALTH_MAJOR_MINOR}\.[0-9\.]+.tar.gz | uniq | wc -l | tr -d ' '` - -# if (( ${PATCHSETS_NUM} > 0 )); then -# cli_msg "INFO" "Number of Patchsets for this version : ${PATCHSETS_NUM}" - -# LATEST_GNUHEALTH=`wget --quiet -O - ${GNUHEALTH_URL}/ | egrep -o gnuhealth_patchset-${GNUHEALTH_MAJOR_MINOR}\.[0-9\.]+.tar.gz | sort -V | tail -1` -# LATEST_GNUHEALTH_PATCHSET=`echo ${LATEST_GNUHEALTH} | cut -d'.' -f3` - -# if (( ${GNUHEALTH_PATCHSET} < ${LATEST_GNUHEALTH_PATCHSET} )); then -# cli_msg "WARNING" "GNU HEALTH patchset ${GNUHEALTH_PATCHSET} is outdated ! A newer version is available (${LATEST_GNUHEALTH})" -# NEED_UPDATE_PATCHSETS=1 -# let PSET=GNUHEALTH_PATCHSET+1 -# for n in `seq $PSET $LATEST_GNUHEALTH_PATCHSET` -# do -# PATCHSETS="$PATCHSETS gnuhealth_patchset-${GNUHEALTH_MAJOR_MINOR}.$n.tar.gz" -# done - -# else -# cli_msg "INFO" "GNU HEALTH patchset ${GNUHEALTH_PATCHSET} is at the latest version" -# fi - -# else -# cli_msg "INFO" "** NO GNU HEALTH PATCHSETS FOUND FOR THIS VERSION **" -# fi - } install_updates() { -#if [ $NEED_UPDATE_TRYTOND -eq 1 ]; then -# cli_msg "INFO" "Downloading TRYTON SERVER $LATEST_TRYTOND" -# wget --quiet --directory-prefix=${UPDATE_DOWNLOAD_DIR}/trytond ${TRYTON_URL}/${TRYTON_MAJOR_MINOR}/${LATEST_TRYTOND} || exit 1 -# cli_msg "INFO" "--> Uncompressing TRYTON SERVER $LATEST_TRYTOND" -# tar -xzf ${UPDATE_DOWNLOAD_DIR}/trytond/${LATEST_TRYTOND} --directory ${GNUHEALTH_DIR}/tryton/server || exit 1 -# fi - -# if [ $NEED_UPDATE_MODULES -eq 1 ]; then -# for mod in ${MOD_UPDATES} -# do -# cli_msg "INFO" "Downloading $mod" -# wget --quiet --directory-prefix=${UPDATE_DOWNLOAD_DIR}/modules ${TRYTON_URL}/${TRYTON_MAJOR_MINOR}/${mod} || exit 1 -# cli_msg "INFO" "--> Uncompressing ${mod}" -# tar -xzf ${UPDATE_DOWNLOAD_DIR}/modules/${mod} --directory ${GNUHEALTH_DIR}/tryton/server/modules || exit 1 -# done -# fi - -# if [ $NEED_UPDATE_PATCHSETS -eq 1 ]; then -# for patchset in ${PATCHSETS} -# do -# cli_msg "INFO" "Downloading $patchset" -# wget --quiet --directory-prefix=${UPDATE_DOWNLOAD_DIR}/patchsets ${GNUHEALTH_URL}/${patchset} || exit 1 -# cli_msg "INFO" "--> Applying PATCHSET $patchset" -# tar -xzf ${UPDATE_DOWNLOAD_DIR}/patchsets/${patchset} --directory ${HOME} || exit 1 -# done -# fi - if [ $2 == "--dry-run" ];then - sudo zypper up -D trytond* gnuhealth + zypper up -D -- "trytond*" "gnuhealth*" exit 0 fi - sudo zypper up trytond* gnuhealth + sudo zypper up -- "trytond*" "gnuhealth*" } -#remove_old() -#{ -# if [ ${NEED_DELETE} -eq 1 ]; then -# cli_msg "WARNING" "Removing obsolete kernel and/or modules : ${TO_DELETE}" -# rm -rf ${TO_DELETE} -# fi -#} - relink_mods() { -# source $HOME/.gnuhealthrc - -# if [ ${NEED_DELETE} -eq 1 ]; then -# local TRYTON_MODS=`cd ${GNUHEALTH_DIR}/tryton/server/modules; ls -1d trytond_*` -# for mod in ${TRYTON_MODS}; do -# local modname=`echo ${mod} | cut -d'-' -f1 | cut -d'_' -f2-` -# cli_msg "INFO" "Relinking : ${mod}" -# ln -sf ${GNUHEALTH_DIR}/tryton/server/modules/${mod} ${GNUHEALTH_DIR}/tryton/server/${TRYTOND}/trytond/modules/${modname} || exit 1 -# done -# cli_msg "INFO" "Relinking GNU Health modules ..." -# local HEALTH_MODS=`cd ${GNUHEALTH_DIR}/tryton/server/modules; ls -1d health*` -# for mod in ${HEALTH_MODS}; do -# cli_msg "INFO" "--> Relinking : ${mod}" -# ln -sf ${GNUHEALTH_DIR}/tryton/server/modules/${mod} ${GNUHEALTH_DIR}/tryton/server/${TRYTOND}/trytond/modules/ || exit 1 -# done - -# cli_msg "INFO" "Relinking local modules and customizations ..." - -# local LOCAL_MODS=`cd ${GNUHEALTH_DIR}/tryton/server/modules/local; ls -A` -# for mod in ${LOCAL_MODS}; do -# cli_msg "INFO" "--> Relinking : ${mod}" -# ln -sf ${GNUHEALTH_DIR}/tryton/server/modules/local/${mod} ${GNUHEALTH_DIR}/tryton/server/${TRYTOND}/trytond/modules/ || exit 1 -# done - -# fi - sudo systemctl restart gnuhealth } @@ -409,24 +243,26 @@ getlang() { local lang_to_install=$2 local lang_file=${lang_to_install}.zip -# source $HOME/.gnuhealthrc || exit 1 cli_msg "INFO" "Going to modules directory ${GNUHEALTH_DIR} " cd ${GNUHEALTH_DIR} || exit 1 cli_msg "INFO" "Retrieving language pack file for ${lang_to_install}" - wget ${TRANSLATE_URL}/export/?path=/${lang_to_install}/GNUHEALTH/ -O /tmp/${lang_file} || exit 1 + wget ${TRANSLATE_URL}/export/?path=/${lang_to_install}/GNUHEALTH/ -O $UPDATE_DOWNLOAD_DIR/${lang_file} || exit 1 cli_msg "INFO" "Installing / Updating language files for ${lang_to_install} ..." - bsdtar --strip-components 3 -xzf /tmp/${lang_file} || exit 1 + bsdtar --strip-components 3 --exclude *webdav3* --exclude *caldav* -xzf $UPDATE_DOWNLOAD_DIR/${lang_file} || exit 1 cli_msg "INFO" "Language pack ${lang_to_install} sucessfully installed / updated" + chmod -R a+r ${GNUHEALTH_DIR} + cli_msg "INFO" "Read permissions set" cli_msg "INFO" "You now need to update the database modules" -# cd + } bailout() { cli_msg "ERROR" "Bailing out !" cli_msg "ERROR" "Removing backup lock file" rm -f $LOCKFILE + rm -rf $UPDATE_DOWNLOAD_DIR exit 1 } diff --git a/gnuhealth-rpmlintrc b/gnuhealth-rpmlintrc new file mode 100644 index 0000000..f77bda0 --- /dev/null +++ b/gnuhealth-rpmlintrc @@ -0,0 +1,5 @@ +# false positive: the lib dependency check is wrong here +# ignore the warning for now +addFilter("explicit-lib-dependency python3-passlib"); +# ignore suse-missing-rclink +addFilter("suse-missing-rclink gnuhealth"); diff --git a/gnuhealth.changes b/gnuhealth.changes index 0f99830..d0452ce 100644 --- a/gnuhealth.changes +++ b/gnuhealth.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Tue Mar 31 16:09:25 UTC 2020 - Axel Braun + +- update for boo#1167126, 1167128 + +------------------------------------------------------------------- +Tue Mar 17 13:32:03 UTC 2020 - Axel Braun + +- clean up of spec file to get rid of warnings + added gnuhealth-rpmlintrc + +------------------------------------------------------------------- +Sat Mar 14 15:24:49 UTC 2020 - Axel Braun + +- gnuhealth-control 3.6.3 - added chmod after getlang command + +------------------------------------------------------------------- +Mon Mar 2 19:25:36 UTC 2020 - Axel Braun + +- modified getlang to exclude 2 directories (otherwise initialization fails after language installation) + ------------------------------------------------------------------- Fri Feb 28 11:24:46 UTC 2020 - Axel Braun diff --git a/gnuhealth.service b/gnuhealth.service index d41b4bb..8fb477b 100644 --- a/gnuhealth.service +++ b/gnuhealth.service @@ -3,6 +3,16 @@ Description=GNU Health server After=syslog.target Requires=postgresql.service Conflicts=trytond.service +PrivateTmp=true +ProtectSystem=true +ProtectHome=true +ProtectKernelModules=true +ProtectKernelTunables=true +ProtectControlGroups=true +MountFlags=private +NoNewPrivileges=true +PrivateDevices=true +MemoryDenyWriteExecute=true [Service] Type=simple diff --git a/gnuhealth.spec b/gnuhealth.spec index 6d6fc6a..2dfd9b8 100644 --- a/gnuhealth.spec +++ b/gnuhealth.spec @@ -33,14 +33,15 @@ BuildRequires: python3-setuptools BuildRequires: trytond URL: http://health.gnu.org -##ource0: http://ftp.gnu.org/gnu/health/%{name}-%{version}.tar.gz -Source: %{name}-%{version}.tar.gz +Source0: %{name}-%{version}.tar.gz +###http://ftp.gnu.org/gnu/health/%{name}-%{version}.tar.gz Source1: GNUHealth.README.SUSE Source2: gnuhealth-control Source3: gnuhealth.service Source4: gnuhealth-webdav@.service Source5: openSUSE-gnuhealth-setup Source6: gnuhealth +Source7: gnuhealth-rpmlintrc Patch0: shebang.diff ##atch1: xmlfix.diff ##atch2: demo.diff @@ -135,11 +136,19 @@ install -p -m 755 scripts/demo/install_demo_database.sh %{buildroot}%{_bindir}/i #delete empty demo directory rm -rf scripts/demo -mkdir -p $RPM_BUILD_ROOT%{_unitdir} -install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service -install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_unitdir}/%{name}-webdav@.service +mkdir -p %{buildroot}%{_unitdir} +install -p -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service +install -p -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/%{name}-webdav@.service -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/tryton +mkdir -p %{buildroot}%{_sysconfdir}/tryton + +#remove double license file: +rm backend/fhir/client/COPYING + +#Move FHIR serer to examples directory +mkdir -p -m 755 %{buildroot}%{_docdir}/%{name}/examples/ +mv backend/fhir* %{buildroot}%{_docdir}/%{name}/examples/. +rmdir backend %python_expand %fdupes %{buildroot}%{$python_sitelib} @@ -169,23 +178,25 @@ EOF %preun %service_del_preun gnuhealth.service +%service_del_preun gnuhealth-webdav@.service %postun %service_del_postun gnuhealth.service +%service_del_postun gnuhealth-webdav@.service %files -n %{name}-orthanc %{python3_sitelib}/%{name}_orthanc* %{python3_sitelib}/trytond/modules/health_orthanc* %files -%defattr(744,root,root) %{_bindir}/gnuhealth-control %{_bindir}/openSUSE-gnuhealth-setup %{_bindir}/install_demo_database.sh %{_unitdir}/%{name}.service %{_unitdir}/%{name}-webdav@.service -%defattr(-,root,root) -%doc README Changelog gnuhealth-setup version gnuhealthrc GNUHealth.README.SUSE scripts/* backend/* config/* doc/* +%doc README Changelog gnuhealth-setup version gnuhealthrc GNUHealth.README.SUSE scripts/* config/* doc/* +%{_docdir}/%{name}/examples* +%dir %{_sysconfdir}/tryton %license COPYING %exclude %{python3_sitelib}/%{name}_orthanc* %exclude %{python3_sitelib}/trytond/modules/health_orthanc* diff --git a/shebang.diff b/shebang.diff index 0ae642a..24586f6 100644 --- a/shebang.diff +++ b/shebang.diff @@ -43,6 +43,15 @@ diff -U 3 -dHrN -- a/health_calendar/setup.py b/health_calendar/setup.py # -*- coding: utf-8 -*- # Copyright (C) 2011-2020 Luis Falcon # Copyright (C) 2011 Cédric Krier +diff -U 3 -dHrN -- a/health_caldav/tests/scenario_calendar.py b/health_caldav/tests/scenario_calendar.py +--- a/health_caldav/tests/scenario_calendar.py 2019-10-04 22:33:03.000000000 +0200 ++++ b/health_caldav/tests/scenario_calendar.py 2020-03-17 14:04:47.692913921 +0100 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # This file is part of Tryton. The COPYRIGHT file at the top level of + # this repository contains the full copyright notices and license terms. + from argparse import ArgumentParser diff -U 3 -dHrN -- a/health_crypto/setup.py b/health_crypto/setup.py --- a/health_crypto/setup.py 2019-11-20 09:16:02.000000000 +0100 +++ b/health_crypto/setup.py 2020-01-15 16:58:43.120008340 +0100