From b3e567c31055c0e913faecade2f6d48d2b59b549 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Feb 2018 20:47:28 +0100 Subject: [PATCH] Fix rpm package for apache 2.4, selinux and php packages --- build/makepack-dolibarr.pl | 4 +-- build/rpm/dolibarr-forrpm.patch | 2 +- build/rpm/dolibarr_fedora.spec | 3 +-- build/rpm/dolibarr_generic.spec | 11 ++++---- build/rpm/dolibarr_mandriva.spec | 1 - build/rpm/dolibarr_opensuse.spec | 1 - build/rpm/httpd-dolibarr.conf | 44 +++++++++++++++++++++++++++----- 7 files changed, 46 insertions(+), 20 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index aa73d4abf65..839a8092a7c 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -767,8 +767,8 @@ if ($nboftargetok) { $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; $ret=`$cmd`; - # Removed files we don't need - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`; + # Removed files we don't need (already removed before) + #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`; print "Set permissions on files/dir\n"; $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`; diff --git a/build/rpm/dolibarr-forrpm.patch b/build/rpm/dolibarr-forrpm.patch index ae9cf5cb2de..5ea52664b98 100644 --- a/build/rpm/dolibarr-forrpm.patch +++ b/build/rpm/dolibarr-forrpm.patch @@ -1,7 +1,7 @@ diff -up htdocs/install/inc.php.patch htdocs/install/inc.php --- htdocs/install/inc.php.patch 2011-09-03 02:33:26.450952000 +0200 +++ htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200 -@@ -71,8 +71,8 @@ +@@ -74,8 +74,8 @@ $conffile = "../conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 077aaeb9483..db3ca84ec03 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -25,7 +25,7 @@ BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysql, php-adodb, php-nusoap, dejavu-sans-fonts +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts Requires: mysql-server, mysql #BuildRequires: desktop-file-utils @@ -215,7 +215,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico -%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 5b39bac7761..efffb54d092 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -46,7 +46,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysql, php-adodb, php-nusoap, dejavu-sans-fonts +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts, php-mbstring, php-xml Requires: mysql-server, mysql BuildRequires: desktop-file-utils %else @@ -63,9 +63,9 @@ Requires: mysql-community-server, mysql-community-server-client BuildRequires: update-desktop-files fdupes %else Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mbstring, php-xml Requires: mysql-server, mysql -Requires: php-mysql >= 4.1.0 +Requires: php-mysqli >= 4.1.0 %endif %endif %endif @@ -295,7 +295,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico -%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt @@ -441,8 +440,8 @@ if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon ]; then %else echo Add SE Linux permissions for dolibarr # semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local - semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)" - semanage fcontext -a -t httpd_sys_script_rw_t "/var/lib/dolibarr(/.*?)" + semanage fcontext -a -t httpd_sys_rw_content_t "/etc/dolibarr(/.*)?" + semanage fcontext -a -t httpd_sys_rw_content_t "/var/lib/dolibarr(/.*)?" restorecon -R -v /etc/dolibarr restorecon -R -v /var/lib/dolibarr %endif diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 1034615c80a..438f2bd096d 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -212,7 +212,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico -%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index eb1887f229f..aa3844073a7 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -223,7 +223,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico -%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index 5e778e15b38..1126d4fe442 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -15,8 +15,14 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # Directory for web pages - Order deny,allow - Allow from all + = 2.3> + Require all granted + + + Order deny,allow + Allow from all + + DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -60,27 +66,51 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # Directory for public pages - AllowOverride All + = 2.3> + Require all granted + + Order deny,allow Allow from all + + + AllowOverride All # Config files - AllowOverride All + = 2.3> + Require all granted + + Order deny,allow Allow from all + + + AllowOverride All # Directory for data files - AllowOverride All + = 2.3> + Require all granted + + Order deny,allow Allow from all + + + AllowOverride All - AllowOverride All - Order deny,allow + = 2.3> + Require all granted + + + Order allow,deny Allow from all + + + AllowOverride All