Work on packaging RPM & DEB
This commit is contained in:
parent
f4407ae437
commit
8c278bc0e6
@ -19,32 +19,20 @@ Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
|||||||
Vendor: Dolibarr dev team
|
Vendor: Dolibarr dev team
|
||||||
|
|
||||||
URL: http://www.%{name}.org
|
URL: http://www.%{name}.org
|
||||||
|
#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download
|
||||||
Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz
|
Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz
|
||||||
#BuildArch: noarch
|
#BuildArch: noarch
|
||||||
#BuildArchitectures: noarch
|
#BuildArchitectures: noarch
|
||||||
BuildRoot: /tmp/%{name}-buildroot
|
BuildRoot: /tmp/%{name}-buildroot
|
||||||
#Icon: dolibarr_logo1.gif
|
#Icon: dolibarr_logo1.gif
|
||||||
|
|
||||||
# For Mandriva-Mageia
|
# For Mandrake
|
||||||
Group: Networking/WWW
|
Group: Networking/WWW
|
||||||
# For all other distrib
|
# For all other distrib
|
||||||
Group: Applications/Internet
|
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: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql
|
||||||
# Requires for OpenSuse
|
AutoReqProv: yes
|
||||||
#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl
|
|
||||||
# Requires for Mandriva-Mageia
|
|
||||||
#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl
|
|
||||||
|
|
||||||
#Requires(pre):
|
|
||||||
#Requires(postun):
|
|
||||||
|
|
||||||
# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse)
|
|
||||||
AutoReqProv: no
|
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -56,13 +44,16 @@ Dolibarr was designed to provide only features you need and be easy to
|
|||||||
use.
|
use.
|
||||||
|
|
||||||
%description -l es
|
%description -l es
|
||||||
Dolibarr ERP y CRM es un software open source/gratis para pequeñas y
|
Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones
|
||||||
medianas empresas, asociaciones o autónomos. Incluye diferentes
|
que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores
|
||||||
funcionalidades para la Planificación de Recursos Empresariales (ERP) y
|
ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource
|
||||||
Gestión de la Relación con los Clientes (CRM) así como para para otras
|
que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier
|
||||||
diferentes actividades. Dolibarr ha sido diseñado para suministrarle
|
lugar disponiendo de una conexión a Internet.
|
||||||
solamente las funcionalidades que necesita y haciendo hincapié en su
|
Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría,
|
||||||
facilidad de uso.
|
pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad:
|
||||||
|
Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web).
|
||||||
|
Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas).
|
||||||
|
Simple de desarrollar (sin frameworks pesados).
|
||||||
|
|
||||||
%description -l fr
|
%description -l fr
|
||||||
Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs,
|
Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs,
|
||||||
@ -100,19 +91,32 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build
|
|||||||
mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc
|
mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs
|
mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts
|
mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts
|
||||||
|
#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr
|
||||||
|
#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily
|
||||||
|
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
|
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
|
||||||
cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png
|
cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
|
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
|
||||||
cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop
|
cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop
|
||||||
|
|
||||||
install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README
|
install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README
|
||||||
install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT
|
install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT
|
||||||
cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr
|
cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr
|
||||||
cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr
|
cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr
|
||||||
cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr
|
cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr
|
||||||
cp -pr scripts $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
|
||||||
%clean
|
%clean
|
||||||
@ -178,59 +182,30 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then
|
|||||||
chmod go-w %{_sysconfdir}/dolibarr/apache.conf
|
chmod go-w %{_sysconfdir}/dolibarr/apache.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf
|
||||||
# Detect OS
|
if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then
|
||||||
os='unknown';
|
echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf
|
||||||
if [ -d %{_sysconfdir}/httpd/conf.d ]; then
|
ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf
|
||||||
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='www';
|
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set permissions
|
# Set permissions
|
||||||
echo Set permission to $apacheuser:$apachegroup on $targetdir
|
echo Set permission on $targetdir
|
||||||
chown -R $apacheuser:$apachegroup $targetdir
|
chown -R apache.apache $targetdir
|
||||||
chmod -R a-w $targetdir
|
chmod -R a-w $targetdir
|
||||||
|
|
||||||
echo Set permission to $apacheuser:$apachegroup on $docdir
|
echo Set permission on $docdir
|
||||||
chown -R $apacheuser:$apachegroup $docdir
|
chown -R apache.apache $docdir
|
||||||
chmod -R o-w $docdir
|
chmod -R o-w $docdir
|
||||||
|
|
||||||
# Create empty conf.php file for web installer
|
# Create empty conf.php file for web installer
|
||||||
if [ ! -s $targetdir/htdocs/conf/conf.php ]; then
|
if [ ! -s $targetdir/htdocs/conf/conf.php ]; then
|
||||||
echo Create empty Dolibarr conf.php file
|
echo Create empty Dolibarr conf.php file
|
||||||
touch $targetdir/htdocs/conf/conf.php
|
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
|
chmod ug+rw $targetdir/htdocs/conf/conf.php
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then
|
if [ -s /usr/bin/chcon ]; then
|
||||||
echo Set SELinux permissions
|
echo Set SELinux permissions
|
||||||
# Warning: chcon seems not cumulative
|
# Warning: chcon seems not cumulative
|
||||||
#chcon -R -h -t httpd_sys_content_t $targetdir
|
#chcon -R -h -t httpd_sys_content_t $targetdir
|
||||||
@ -245,9 +220,6 @@ echo Restart web server
|
|||||||
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
||||||
%{_sysconfdir}/init.d/httpd restart
|
%{_sysconfdir}/init.d/httpd restart
|
||||||
fi
|
fi
|
||||||
if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
|
||||||
%{_sysconfdir}/init.d/apache2 restart
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Show result
|
# Show result
|
||||||
echo
|
echo
|
||||||
@ -264,39 +236,12 @@ echo
|
|||||||
%postun
|
%postun
|
||||||
%clean_menus
|
%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='www';
|
|
||||||
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
|
# Dolibarr files are stored into /var/www
|
||||||
export targetdir='/var/www/dolibarr'
|
export targetdir='/var/www/dolibarr'
|
||||||
# Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents
|
# Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents
|
||||||
export docdir='/usr/share/dolibarr/documents'
|
export docdir='/usr/share/dolibarr/documents'
|
||||||
|
|
||||||
|
export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||||
if [ -f $conffile ] ;
|
if [ -f $conffile ] ;
|
||||||
then
|
then
|
||||||
echo Delete apache config file for Dolibarr
|
echo Delete apache config file for Dolibarr
|
||||||
@ -311,17 +256,11 @@ then
|
|||||||
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
||||||
%{_sysconfdir}/init.d/httpd restart
|
%{_sysconfdir}/init.d/httpd restart
|
||||||
fi
|
fi
|
||||||
if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
|
||||||
%{_sysconfdir}/init.d/apache2 restart
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Removed dirs after apache restart
|
|
||||||
echo Removed remaining dirs
|
|
||||||
rm -rf /etc/dolibarr
|
rm -rf /etc/dolibarr
|
||||||
rm -rf $targetdir/htdocs/conf
|
rm -rf $targetdir/htdocs/conf
|
||||||
rm -rf $targetdir/htdocs/install
|
rm -rf $targetdir/htdocs/install
|
||||||
rmdir $targetdir/doc >/dev/null 2>&1
|
|
||||||
rmdir $targetdir/htdocs >/dev/null 2>&1
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user