From 7e5f94d9082a3f6a3a50c0196cf5c27e143332b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Oct 2012 23:33:22 +0200 Subject: [PATCH] Update packagers --- build/exe/doliwamp/doliwamp.iss | 2 +- build/rpm/dolibarr.desktop | 2 +- build/rpm/dolibarr_fedora.spec | 1 + build/rpm/dolibarr_generic.spec | 121 ++++++++++++++++++++++++++++++- build/rpm/dolibarr_mandriva.spec | 5 +- build/rpm/dolibarr_opensuse.spec | 1 + 6 files changed, 125 insertions(+), 7 deletions(-) diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 9ca929987f4..0f97e3e24e9 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -109,7 +109,7 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m ; Mysql data files (does not overwrite if exists) Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db" ; Dolibarr -Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,telephonie\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\install.forced.php" +Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\install.forced.php" Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,xdebug\*" Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png" Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".cvsignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php" diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index 6daeb4f1770..a0496ce864c 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -21,7 +21,7 @@ Exec=xdg-open http://localhost/dolibarr Icon=dolibarr Terminal=false Type=Application -Categories=Office; +Categories=Office;Finance StartupNotify=true InitialPreference=5 #NoDisplay=true diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index c2588fa8db6..f21604265a0 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -171,6 +171,7 @@ done >%{name}.lang %_datadir/dolibarr/htdocs/fichinter %_datadir/dolibarr/htdocs/fourn %_datadir/dolibarr/htdocs/ftp +%_datadir/dolibarr/htdocs/holiday %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index e6ec26bab5b..d788e88b28b 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -8,7 +8,11 @@ Name: dolibarr Version: __VERSION__ +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} +Release: __RELEASE__%{?dist} +%else Release: __RELEASE__ +%endif Summary: ERP and CRM software for small and medium companies or foundations Summary(es): Software ERP y CRM para pequeñas y medianas empresas, asociaciones o autónomos Summary(fr): Logiciel ERP & CRM de gestion de PME/PMI, auto-entrepreneurs ou associations @@ -19,15 +23,47 @@ License: GPLv2+ Vendor: Dolibarr dev team URL: http://www.dolibarr.org +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} +Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_redhat-fedora/%{name}-%{version}.tgz +%else +%if 0%{?mdkversion} +Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_mandriva/%{name}-%{version}.tgz +%else +%if 0%{?suse_version} +Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_opensuse/%{name}-%{version}.tgz +%else Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_generic/%{name}-%{version}.tgz +%endif +%endif +%endif Patch0: %{name}-forrpm.patch BuildArch: noarch 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: mysql-server, mysql +BuildRequires: desktop-file-utils +%else +%if 0%{?mdkversion} +Group: Applications/Productivity +Requires: apache-base, apache-mod_php, php-cgi, php-cli, php-bz2, php-gd, php-ldap, php-imap, php-mysqli, php-openssl, fonts-ttf-dejavu +Requires: mysql, mysql-client +%else +%if 0%{?suse_version} +Group: Productivity/Office/Management +Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, fonts-ttf-dejavu +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: mysql-server, mysql Requires: php-mysql >= 4.1.0 +%endif +%endif +%endif # Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) AutoReqProv: no @@ -86,7 +122,19 @@ cui hai bisogno ed essere facile da usare. %{__install} -m 644 build/rpm/conf.php $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.php %{__install} -m 644 build/rpm/httpd-dolibarr.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/apache.conf %{__install} -m 644 build/rpm/file_contexts.dolibarr $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/file_contexts.dolibarr +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} +%{__install} -m 644 build/rpm/install.forced.php.fedora $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php +%else +%if 0%{?mdkversion} +%{__install} -m 644 build/rpm/install.forced.php.mandriva $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php +%else +%if 0%{?suse_version} +%{__install} -m 644 build/rpm/install.forced.php.opensuse $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php +%else %{__install} -m 644 build/rpm/install.forced.php.generic $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/install.forced.php +%endif +%endif +%endif %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps %{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png @@ -102,6 +150,19 @@ cui hai bisogno ed essere facile da usare. %{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz %{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name} %{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name} +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts +%else +%if 0%{?mdkversion} +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts +%else +%if 0%{?suse_version} +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts +%endif +%endif +%endif # Lang for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_* @@ -116,6 +177,14 @@ do fi done >%{name}.lang +%if 0%{?suse_version} +# Enable this command to tag desktop file for suse +%suse_update_desktop_file dolibarr + +# Enable this command to allow suse detection of duplicate files and create hardlinks instead +%fdupes $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs +%endif + #---- clean %clean @@ -167,6 +236,7 @@ done >%{name}.lang %_datadir/dolibarr/htdocs/fichinter %_datadir/dolibarr/htdocs/fourn %_datadir/dolibarr/htdocs/ftp +%_datadir/dolibarr/htdocs/holiday %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install @@ -202,6 +272,16 @@ done >%{name}.lang # Define vars export docdir="/var/lib/dolibarr/documents" +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} +export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" +export apacheuser='apache'; +export apachegroup='apache'; +%else +%if 0%{?suse_version} +export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" +export apacheuser='wwwrun'; +export apachegroup='www'; +%else export installconfig="%{_sysconfdir}/dolibarr/install.forced.php" # Detect OS @@ -231,6 +311,8 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -g export apachegroup='www-data'; fi echo OS detected: $os +%endif +%endif # Remove dolibarr install/upgrade lock file if it exists %{__rm} -f $docdir/install.lock @@ -239,6 +321,9 @@ echo OS detected: $os echo Create document directory $docdir %{__mkdir} -p $docdir +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} + +%else # Create install.forced.php into Dolibarr install directory if [ "x$os" = "xubuntu-debian" ] then @@ -253,6 +338,7 @@ then %{__cat} /usr/share/dolibarr/build/rpm/install.forced.php.generic | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $installconfig %{__chmod} -R 660 $installconfig fi +%endif # Set correct owner on config files %{__chown} -R root:$apachegroup /etc/dolibarr/* @@ -274,18 +360,39 @@ then grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "" >> $config grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "" >> $config grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "" >> $config - grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config +%else +%if 0%{?mdkversion} + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config +%else +%if 0%{?suse_version} + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config +%else + grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config +%endif +%endif +%endif fi -# Create config for se $seconfig +# Create config for SE Linux +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} || 0%{?suse_version} +%else if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon ]; then +%endif +%if 0%{?mdkversion} || 0%{?suse_version} +%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(/.*?)" restorecon -R -v /etc/dolibarr restorecon -R -v /var/lib/dolibarr +%endif +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} || 0%{?suse_version} +%else fi +%endif # Create a config link dolibarr.conf if [ ! -L $apachelink ]; then @@ -328,8 +435,14 @@ echo #---- postun (after uninstall) %postun -# Detect OS +# Define vars os='unknown'; +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} +export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" +%else +%if 0%{?suse_version} +export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" +%else if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" @@ -346,6 +459,8 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -g export os='ubuntu-debian'; export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" fi +%endif +%endif # Remove apache link if [ -L $apachelink ] ; diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 95ca3fce00e..3e54c6641ed 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -168,6 +168,7 @@ done >%{name}.lang %_datadir/dolibarr/htdocs/fichinter %_datadir/dolibarr/htdocs/fourn %_datadir/dolibarr/htdocs/ftp +%_datadir/dolibarr/htdocs/holiday %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install @@ -218,8 +219,8 @@ echo Create document directory $docdir %{__chown} -R root:$apachegroup /etc/dolibarr/* # If a conf already exists and its content was already completed by installer -export confcomplete=`grep -c "File generated by" %{_sysconfdir}/dolibarr/conf.php 2>/dev/null` -if [ -s %{_sysconfdir}/dolibarr/conf.php -a "x$confcomplete" != "x0" ] +export config=%{_sysconfdir}/dolibarr/conf.php +if [ -s $config ] && grep -q "File generated by" $config then # File already exist. We add params not found. echo Add new params to overwrite path to use shared libraries/fonts diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 7a5db857adc..5e68e4f1c34 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -173,6 +173,7 @@ done >%{name}.lang %_datadir/dolibarr/htdocs/fichinter %_datadir/dolibarr/htdocs/fourn %_datadir/dolibarr/htdocs/ftp +%_datadir/dolibarr/htdocs/holiday %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install