From 9818d8639ab690da91fbffa95a0c2b55724297bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 17:42:07 +0000 Subject: [PATCH] Work on packaging RPM & DEB --- build/deb/control | 2 - build/rpm/README | 12 +--- build/rpm/dolibarr.desktop | 5 +- build/rpm/dolibarr.spec | 117 ++++++++----------------------------- 4 files changed, 26 insertions(+), 110 deletions(-) diff --git a/build/deb/control b/build/deb/control index 2d356fc7b2b..3d8878f4569 100644 --- a/build/deb/control +++ b/build/deb/control @@ -14,8 +14,6 @@ Description: Easy to use ERP & CRM software to manage your activity. and medium companies, foundations or freelances. It includes different features for Enterprise Resource Planning (ERP) and Customer Relationship Management (CRM) but also for different other activities. - It's a web software you can install as a standalone program or on any web - hosting provider to use it from anywhere with any web browser. Dolibarr was designed to provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. diff --git a/build/rpm/README b/build/rpm/README index c072a212632..1b2d4745dc4 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,14 +10,6 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# On Fedora -# yum install dolibarr-...rpm To install package and dependencies -# yum erase dolibarr To remove package +# yum install dolibarr To remove package +# yum erase dolibarr To remove package # -# On OpenSuse -# yast --install dolibarr-...rpm To install package and dependencies -# yast --remove dolibarr To remove package -# -# On Mageia (after su - root) -# urpmi dolibarr-...rpm To install package and dependencies -# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index ab2a758867f..e3be821080c 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,12 +5,9 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM -Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs -Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti -Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones +Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b3aaca1d494..b1def13ae37 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -32,8 +32,7 @@ Group: Networking/WWW Group: Applications/Internet Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) -AutoReqProv: no +AutoReqProv: yes %description @@ -44,31 +43,12 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. -%description -l es -Dolibarr ERP y CRM es un software open source/gratis para pequeñas y -medianas empresas, asociaciones o autónomos. Incluye diferentes -funcionalidades para la Planificación de Recursos Empresariales (ERP) y -Gestión de la Relación con los Clientes (CRM) así como para para otras -diferentes actividades. Dolibarr ha sido diseñado para suministrarle -solamente las funcionalidades que necesita y haciendo hincapié en su -facilidad de uso. - %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. -%description -l it -Dolibarr è un programma gestionale open source e gratuito per piccole e medie -imprese, fondazioni e liberi professionisti. Include varie funzionalità per -Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori -attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno -ed essere facile da usare. -Dolibar è completamente web-based, progettato per poter fornire solo ciò di -cui hai bisogno ed essere facile da usare. - - #---- prep %prep @@ -104,6 +84,17 @@ cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr +# menu +#%{__install} -d $RPM_BUILD_ROOT%{_menudir} +#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} +#?package(%{name}):\ +#command="Dolibarr" \ +#section="Office" \ +#title="Dolibarr" \ +#icon="dolibarr_48x48.png" \ +#longtitle="Dolibarr ERP & CRM" +#EOF + #---- clean %clean @@ -169,59 +160,30 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi - -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='wwwrun'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - -# Create a config link dolibarr.conf for Fedora or Redhat -if [ ! -f $conffile ]; then - echo Create dolibarr web server config link $conffile - ln -fs /etc/dolibarr/apache.conf $conffile +# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf +if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then + echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf + ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf fi # Set permissions -echo Set permission to $apacheuser:$apachegroup on $targetdir -chown -R $apacheuser:$apachegroup $targetdir +echo Set permission on $targetdir +chown -R apache.apache $targetdir chmod -R a-w $targetdir -echo Set permission to $apacheuser:$apachegroup on $docdir -chown -R $apacheuser:$apachegroup $docdir +echo Set permission on $docdir +chown -R apache.apache $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php + chown apache.apache $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then +if [ -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -236,9 +198,6 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi -if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart -fi # Show result echo @@ -255,39 +214,12 @@ echo %postun %clean_menus -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='wwwrun'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - # 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 echo Delete apache config file for Dolibarr @@ -302,9 +234,6 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi fi rm -rf /etc/dolibarr