2
0
forked from Wavyzz/dolibarr

Fix: Avoid errors into rpm packages

This commit is contained in:
Laurent Destailleur
2011-08-03 16:46:46 +00:00
parent 3e1adf3d20
commit b85550a2a1
2 changed files with 28 additions and 16 deletions

View File

@@ -10,8 +10,8 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...).
# This is standard command to work on RPM packaging:
#
# To install all packagers tools:
# yum -y install rpmlint mock hunspell-en hunspell-es hunspell-fr hunspell-it
# yum -y install rpmlint
# yum -y install hunspell-en hunspell-es hunspell-fr hunspell-it
#
# rpmlint file.rpm Test a package
# mock -r fedora-15-i386 --rebuild ../SRPMS/hello-2.7-1.fc15.src.rpm

View File

@@ -6,6 +6,10 @@
# edit it if you need to match your rules.
# --------------------------------------------------------
#%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
#%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
#%define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0)
%define name dolibarr
%define version __VERSION__
%define release __RELEASE__
@@ -19,14 +23,14 @@ Summary(fr): Logiciel ERP & CRM de gestion de PME/PMI, autoentrepreneurs ou asso
Summary(it): Programmo gestionale per piccole imprese, fondazioni e liberi professionisti
License: GPLv2+
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
Vendor: Dolibarr dev team
URL: http://www.%{name}.org
Source0: http://www.dolibarr.org/files/fedora/%{name}-%{version}.tgz
Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz
BuildArch: noarch
#BuildArchitectures: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRoot: /tmp/%{name}-buildroot
#Icon: dolibarr_logo1.gif
# For Mandriva-Mageia
@@ -34,6 +38,9 @@ Group: Networking/WWW
# For all other distrib
Group: Applications/Internet
# Requires can use lua to be defined dynamically (but still at build time)
# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end }
# Requires for Fedora-Redhat
Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql
# Requires for OpenSuse
@@ -67,7 +74,7 @@ que necesita y haciendo hincapié en su facilidad de uso.
%description -l fr
Logiciel ERP & CRM de gestion de PME/PMI, autoentrepreneurs,
artisans ou associations. Il permet de gérer vos clients, prospect,
fournisseurs, devis, factures, comptes bancaires, agenda, campagnes mailings
fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings
et bien d'autres choses dans une interface pensée pour la simplicité.
%description -l it
@@ -100,10 +107,11 @@ echo Building %{name}-%{version}-%{release}
%{__install} -m 644 etc/dolibarr/apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/dolibarr/apache.conf
%{__install} -m 644 etc/dolibarr/file_contexts.dolibarr $RPM_BUILD_ROOT%{_sysconfdir}/dolibarr/file_contexts.dolibarr
# %{_datadir} = /usr/share
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
%{__install} -m 644 var/www/dolibarr/doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications
%{__install} -m 644 var/www/dolibarr/build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/dolibarr.desktop
%{__install} -m 644 var/www/dolibarr/build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/dolibarr.desktop
%{__mkdir} -p $RPM_BUILD_ROOT/var/www/dolibarr/build
%{__mkdir} -p $RPM_BUILD_ROOT/var/www/dolibarr/doc
@@ -113,7 +121,7 @@ echo Building %{name}-%{version}-%{release}
%{__cp} -pr var/www/dolibarr/doc $RPM_BUILD_ROOT/var/www/dolibarr
%{__cp} -pr var/www/dolibarr/htdocs $RPM_BUILD_ROOT/var/www/dolibarr
%{__cp} -pr var/www/dolibarr/scripts $RPM_BUILD_ROOT/var/www/dolibarr
%{__install} -m 644 var/www/dolibarr/COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/doc/COPYRIGHT
%{__install} -m 644 var/www/dolibarr/COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/doc/COPYRIGHT
#---- clean
@@ -142,6 +150,8 @@ echo Building %{name}-%{version}-%{release}
#---- post (after unzip during install)
%post
#%update_menus # Does not exists on fedora nor mandriva
# Define vars
# Dolibarr files are stored into /var/www
@@ -222,7 +232,7 @@ fi
# Create config file for apache $apacheconfig
#if [ ! -f $apacheconfig ]; then
# echo Create dolibarr web server config file $apacheconfig
# echo Create dolibarr web server config file $apacheconfig
# cp $apachefileorig $apacheconfig
# chmod a-x $apacheconfig
# chmod go-w $apacheconfig
@@ -230,13 +240,13 @@ fi
# Create config file for se $seconfig
if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon -a ! -f $seconfig ]; then
echo Add SE Linux permission from file $sefileorig
semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)"
semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr(/.*?)"
semanage fcontext -a -t httpd_sys_script_rw_t "/var/www/dolibarr/install.lock"
restorecon -R -v /etc/dolibarr
restorecon -R -v /usr/share/dolibarr
restorecon -v /var/www/dolibarr/install.lock
echo Add SE Linux permission from file $sefileorig
semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)"
semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr(/.*?)"
semanage fcontext -a -t httpd_sys_script_rw_t "/var/www/dolibarr/install.lock"
restorecon -R -v /etc/dolibarr
restorecon -R -v /usr/share/dolibarr
restorecon -v /var/www/dolibarr/install.lock
fi
# Create a config link dolibarr.conf
@@ -284,6 +294,8 @@ echo
#---- postun (after uninstall)
%postun
#%clean_menus # Does not exists on fedora nor mandriva
# Define vars
# Dolibarr files are stored into targetdir