Work on packaging RPM & DEB

This commit is contained in:
Laurent Destailleur 2011-07-09 17:42:07 +00:00
parent 42ce249a69
commit 9818d8639a
4 changed files with 26 additions and 110 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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} <<EOF >$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