SPECS: sugarcrm.spec - webapps

glen glen at pld-linux.org
Sun Feb 5 16:32:29 CET 2006


Author: glen                         Date: Sun Feb  5 15:32:29 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- webapps

---- Files affected:
SPECS:
   sugarcrm.spec (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SPECS/sugarcrm.spec
diff -u SPECS/sugarcrm.spec:1.5 SPECS/sugarcrm.spec:1.6
--- SPECS/sugarcrm.spec:1.5	Mon Nov 21 00:09:56 2005
+++ SPECS/sugarcrm.spec	Sun Feb  5 16:32:24 2006
@@ -1,14 +1,14 @@
 # $Revision$, $Date$
 # TODO
 # - secure it
+# - subpackages?
+%define	_beta	b
+%define	_rel	17
 Summary:	Customer Relationship Management
 Summary(pl):	Narzędzie CRM
 Name:		sugarcrm
 Version:	3.0.1
-%define	_beta	b
-%define	_rel	15
 Release:	0.%{_beta}.%{_rel}
-Epoch:		0
 License:	SugarCRM Public License
 Group:		Applications/WWW
 Source0:	http://www.sugarforge.org/frs/download.php/242/SugarSuite-Full-%{version}%{_beta}.zip
@@ -24,26 +24,22 @@
 # Source13-md5:	9f0c00ef8272917b6131c355b5467352
 Patch0:		%{name}-mysqlroot.patch
 URL:		http://www.sugarforge.org/
-BuildRequires:	rpmbuild(macros) >= 1.226
-Requires:	webserver = apache
-Conflicts:	apache1 < 1.3.33-2
+BuildRequires:	rpmbuild(macros) >= 1.268
 Requires:	php >= 3:4.2.0
 Requires:	php-mysql
 Requires:	php-xml
+Requires:	webapps
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_appdir		%{_datadir}/%{name}
-%define		_sysconfdir	/etc/%{name}
+%define		_webapps	/etc/webapps
+%define		_webapp		%{name}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
+%define		_appdir		%{_datadir}/%{_webapp}
 
 # symlinked from appdir
 %define		_noautocompressdoc	LICENSE
 
-# nothing to strip/chrpath/compress
-%define		no_install_post_strip			1
-%define		no_install_post_chrpath			1
-%define		no_install_post_compress_modules	1
-
 %description
 SugarCRM is a suite of business automation tools for managing your
 marketing, sales and customer service operations. From leads to
@@ -60,7 +56,7 @@
 Summary:	SugarCRM setup package
 Summary(pl):	Pakiet instalacyjny SugarCRM
 Group:		Applications/WWW
-PreReq:		%{name} = %{epoch}:%{version}-%{release}
+Requires:	%{name} = %{version}-%{release}
 
 %description setup
 Install this package to configure initial SugarCRM installation. You
@@ -75,7 +71,7 @@
 %prep
 %setup -q -n SugarSuite-Full-%{version}%{_beta} -a 10 -a 11 -a 12 -a 13
 # undos the sources
-find -regex '.*\.\(php\|inc\|html\|txt\|js\)$' -print0 | xargs -0 sed -i -e 's,
$,,'
+find -regex '.*\.\(php\|inc\|html\|txt\|js\)$' -print0 | xargs -0 sed -i -e 's,\r$,,'
 
 %patch0 -p1
 
@@ -93,7 +89,8 @@
 ln -sf %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config.php
 install config.php $RPM_BUILD_ROOT%{_sysconfdir}/config.php
 
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -108,23 +105,43 @@
 	chown root:http %{_sysconfdir}/config.php
 fi
 
-%triggerin -- apache1 >= 1.3.33-2
-%apache_config_install -v 1 -c %{_sysconfdir}/%{name}.conf
-
-%triggerun -- apache1 >= 1.3.33-2
-%apache_config_uninstall -v 1
+%triggerpostun -- %{name} < 3.0.1-0.b.17
+# rescue app config
+if [ -f /etc/sugarcrm/config.php.rpmsave ]; then
+	mv -f %{_sysconfdir}/config.php{,.rpmnew}
+	mv -f /etc/sugarcrm/config.php.rpmsave %{_sysconfdir}/config.php
+fi
 
-%triggerin -- apache >= 2.0.0
-%apache_config_install -v 2 -c %{_sysconfdir}/%{name}.conf
+if [ -f /etc/sugarcrm/sugarcrm.conf.rpmsave ]; then
+	if [ -d /etc/apache/webapps.d ]; then
+		cp -f %{_sysconfdir}/sugarcrm.conf{,.rpmnew}
+		cp -f /etc/sugarcrm/sugarcrm.conf.rpmsave %{_sysconfdir}/apache.conf
+	fi
+
+	if [ -d /etc/httpd/webapps.d ]; then
+		cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+		cp -f /etc/sugarcrm/sugarcrm.conf.rpmsave %{_sysconfdir}/httpd.conf
+	fi
+	rm -f /etc/sugarcrm/sugarcrm.conf.rpmsave
+fi
 
-%triggerun -- apache >= 2.0.0
-%apache_config_uninstall -v 2
+if [ -L /etc/apache/conf.d/99_sugarcrm.conf ]; then
+	rm -f /etc/apache/conf.d/99_sugarcrm.conf
+	/usr/sbin/webapp register apache %{_webapp}
+	%service -q apache reload
+fi
+if [ -L /etc/httpd/httpd.conf/99_sugarcrm.conf ]; then
+	rm -f /etc/httpd/httpd.conf/99_sugarcrm.conf
+	/usr/sbin/webapp register httpd %{_webapp}
+	%service -q httpd reload
+fi
 
 %files
 %defattr(644,root,root,755)
 %doc INSTALLATION.txt LICENSE PATCH.txt README.txt UPGRADE.TXT
-%attr(710,root,http) %dir %{_sysconfdir}
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
 %dir %{_appdir}
 %{_appdir}/XTemplate
@@ -159,6 +176,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.6  2006/02/05 15:32:24  glen
+- webapps
+
 Revision 1.5  2005/11/20 23:09:56  glen
 - use virtual webserver provide
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/sugarcrm.spec?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list