From 934e356e22826c66369f78ee25bf88cb52ecec98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jun 2011 20:04:04 +0000 Subject: [PATCH] rpm package is ready --- build/rpm/dolibarr.spec | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 3ea9dee9c29..d8bad08806c 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -150,15 +150,6 @@ echo Set permission on $docdir chown -R apache.apache $docdir chmod -R o-w $docdir -if [ -s /usr/bin/chcon ]; then - echo Set SELinux permissions - chcon -R -h -t httpd_sys_content_t $targetdir - chcon -R -h -t httpd_sys_content_t $docdir - chcon -R -h -t httpd_sys_script_rw_t $targetdir - chcon -R -h -t httpd_sys_script_rw_t $docdir - chcon -R -h -t httpd_sys_script_exec_t $targetdir -fi - # Create empty conf.php file for web installer if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file @@ -167,6 +158,16 @@ if [ ! -s $targetdir/htdocs/conf/conf.php ]; then chmod ug+rw $targetdir/htdocs/conf/conf.php fi +if [ -s /usr/bin/chcon ]; then + echo Set SELinux permissions + # Warning: chcon seems not cumulative + #chcon -R -h -t httpd_sys_content_t $targetdir + #chcon -R -h -t httpd_sys_content_t $docdir + chcon -R -h -t httpd_sys_script_rw_t $targetdir + chcon -R -h -t httpd_sys_script_rw_t $docdir + #chcon -R -h -t httpd_sys_script_exec_t $targetdir +fi + # Restart web server echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then @@ -187,6 +188,11 @@ echo #---- postun (after uninstall) %postun +# Dolibarr files are stored into /var/www +export targetdir='/var/www/dolibarr' +# Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents +export docdir='/usr/share/dolibarr/documents' + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then @@ -205,6 +211,8 @@ then fi rm -rf /etc/dolibarr +rm -rf $targetdir/htdocs/conf +rm -rf $targetdir/htdocs/install %changelog