SPECS: horde-passwd.spec - convert to horde 3.x style

glen glen at pld-linux.org
Mon Aug 22 21:03:45 CEST 2005


Author: glen                         Date: Mon Aug 22 19:03:45 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- convert to horde 3.x style

---- Files affected:
SPECS:
   horde-passwd.spec (1.13 -> 1.14) 

---- Diffs:

================================================================
Index: SPECS/horde-passwd.spec
diff -u SPECS/horde-passwd.spec:1.13 SPECS/horde-passwd.spec:1.14
--- SPECS/horde-passwd.spec:1.13	Mon Aug 22 20:37:53 2005
+++ SPECS/horde-passwd.spec	Mon Aug 22 21:03:39 2005
@@ -1,11 +1,12 @@
 # $Revision$, $Date$
 #
+%define		_hordeapp	passwd
 %include	/usr/lib/rpm/macros.php
 Summary:	passwd - password change module for Horde
 Summary(pl):	passwd - moduł do zmieniania haseł w Horde
 Name:		horde-passwd
 Version:	3.0
-Release:	0.1
+Release:	0.4
 License:	LGPL
 Vendor:		The Horde Project
 Group:		Applications/WWW
@@ -13,20 +14,23 @@
 # Source0-md5:	9ea299d2822c9d3ca5efca03ce6a23a4
 Source1:	%{name}.conf
 URL:		http://www.horde.org/passwd/
+BuildRequires:	rpmbuild(macros) >= 1.226
 BuildRequires:	rpm-php-pearprov >= 4.0.2-98
-PreReq:		apache
-Requires(post):	grep
+Requires:	apache >= 1.3.33-2
+Requires:	apache(mod_access)
 Requires:	horde >= 3.0
 Requires:	php-xml >= 4.1.0
 Obsoletes:	horde-addons-passwd
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define         _noautoreq      'pear(../lib/.*)' 'pear(Horde/.*)' 'pear(Crypt/CHAP.php)'
+# horde accesses it directly in help->about
+%define		_noautocompressdoc  CREDITS
+%define		_noautoreq	'pear(Horde/.*)'
 
-%define		apachedir	/etc/httpd
 %define		hordedir	/usr/share/horde
-%define		confdir		/etc/horde.org
+%define		_sysconfdir		/etc/horde.org
+%define		_appdir		%{hordedir}/%{_hordeapp}
 
 %description
 Passwd is the Horde password changing application. While it has been
@@ -42,58 +46,52 @@
 %prep
 %setup -q -n passwd-h3-%{version}-beta
 
+# considered harmful (horde/docs/SECURITY)
+rm -f test.php
+
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{apachedir} $RPM_BUILD_ROOT%{hordedir}/passwd/{themes/graphics,lib,locale,templates,scripts} 
-install -d $RPM_BUILD_ROOT%{confdir}/passwd
+install -d $RPM_BUILD_ROOT{/etc/cron.daily,%{_sysconfdir}/%{_hordeapp}} \
+	$RPM_BUILD_ROOT%{_appdir}/{docs,lib,locale,scripts,templates,themes}
+
+cp -pR	*.php			$RPM_BUILD_ROOT%{_appdir}
+for i in config/*.dist; do
+	cp -p $i $RPM_BUILD_ROOT%{_sysconfdir}/%{_hordeapp}/$(basename $i .dist)
+done
+
+echo "<?php ?>" > 		$RPM_BUILD_ROOT%{_sysconfdir}/%{_hordeapp}/conf.php
+install config/conf.xml $RPM_BUILD_ROOT%{_sysconfdir}/%{_hordeapp}/conf.xml
+> $RPM_BUILD_ROOT%{_sysconfdir}/%{_hordeapp}/conf.php.bak
+
+cp -pR	lib/*			$RPM_BUILD_ROOT%{_appdir}/lib
+cp -pR	locale/*		$RPM_BUILD_ROOT%{_appdir}/locale
+cp -pR	templates/*		$RPM_BUILD_ROOT%{_appdir}/templates
+cp -pR	themes/*		$RPM_BUILD_ROOT%{_appdir}/themes
 
-cp -pR *.php			$RPM_BUILD_ROOT%{hordedir}/passwd
-cp -pR config/*.dist		$RPM_BUILD_ROOT%{confdir}/passwd
-cp -pR themes/graphics/*	$RPM_BUILD_ROOT%{hordedir}/passwd/themes/graphics
-cp -pR lib/*			$RPM_BUILD_ROOT%{hordedir}/passwd/lib
-cp -pR locale/*			$RPM_BUILD_ROOT%{hordedir}/passwd/locale
-cp -pR templates/*		$RPM_BUILD_ROOT%{hordedir}/passwd/templates
-cp -p  config/.htaccess		$RPM_BUILD_ROOT%{confdir}/passwd
-cp -p  templates/.htaccess	$RPM_BUILD_ROOT%{hordedir}/passwd/templates
-
-ln -fs %{confdir}/passwd $RPM_BUILD_ROOT%{hordedir}/passwd/config
-
-install %{SOURCE1} $RPM_BUILD_ROOT%{apachedir}
-
-# bit unclean..
-cd $RPM_BUILD_ROOT%{confdir}/passwd
-for i in *.dist; do cp $i `basename $i .dist`; done
+ln -s %{_sysconfdir}/%{_hordeapp} 	$RPM_BUILD_ROOT%{_appdir}/config
+ln -s %{_defaultdocdir}/%{name}-%{version}/CREDITS $RPM_BUILD_ROOT%{_appdir}/docs
+
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache-%{_hordeapp}.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
-	echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
-	if [ -f /var/lock/subsys/httpd ]; then
-		/usr/sbin/apachectl restart 1>&2
-	fi
-elif [ -d /etc/httpd/httpd.conf ]; then
-	ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
-	if [ -f /var/lock/subsys/httpd ]; then
-		/usr/sbin/apachectl restart 1>&2
-	fi
+if [ ! -f %{_sysconfdir}/%{_hordeapp}/conf.php.bak ]; then
+	install /dev/null -o root -g http -m660 %{_sysconfdir}/%{_hordeapp}/conf.php.bak
 fi
 
-%preun
-if [ "$1" = "0" ]; then
-	umask 027
-	if [ -d /etc/httpd/httpd.conf ]; then
-		rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-	else
-		grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
-			/etc/httpd/httpd.conf.tmp
-		mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
-	fi
-	if [ -f /var/lock/subsys/httpd ]; then
-		/usr/sbin/apachectl restart 1>&2
-	fi
-fi
+%triggerin -- apache1 >= 1.3.33-2
+%apache_config_install -v 1 -c %{_sysconfdir}/apache-%{_hordeapp}.conf
+
+%triggerun -- apache1 >= 1.3.33-2
+%apache_config_uninstall -v 1
+
+%triggerin -- apache >= 2.0.0
+%apache_config_install -v 2 -c %{_sysconfdir}/apache-%{_hordeapp}.conf
+
+%triggerun -- apache >= 2.0.0
+%apache_config_uninstall -v 2
 
 %triggerpostun -- horde-passwd <= 2.2-0.1
 for i in backends.php conf.php; do
@@ -105,20 +103,22 @@
 
 %files
 %defattr(644,root,root,755)
-%doc README docs/*
-%dir %{hordedir}/passwd
-%attr(640,root,http) %{hordedir}/passwd/*.php
-%attr(750,root,http) %{hordedir}/passwd/themes/graphics
-%attr(750,root,http) %{hordedir}/passwd/lib
-%attr(750,root,http) %{hordedir}/passwd/locale
-%attr(750,root,http) %{hordedir}/passwd/templates
-
-%attr(750,root,http) %dir %{confdir}/passwd
-%{hordedir}/passwd/config
-%attr(640,root,http) %{confdir}/passwd/*.dist
-%attr(640,root,http) %{confdir}/passwd/.htaccess
-%attr(640,root,http) %config(noreplace) %{confdir}/passwd/*.php
-%attr(640,root,http) %{apachedir}/%{name}.conf
+%doc README docs/* scripts
+%attr(750,root,http) %dir %{_sysconfdir}/%{_hordeapp}
+%attr(640,root,root) %config(noreplace) %{_sysconfdir}/apache-%{_hordeapp}.conf
+%attr(660,root,http) %config(noreplace) %{_sysconfdir}/%{_hordeapp}/conf.php
+%attr(660,root,http) %config(noreplace) %ghost %{_sysconfdir}/%{_hordeapp}/conf.php.bak
+%attr(640,root,http) %config(noreplace) %{_sysconfdir}/%{_hordeapp}/[!c]*.php
+%attr(640,root,http) %{_sysconfdir}/%{_hordeapp}/*.xml
+
+%dir %{_appdir}
+%{_appdir}/*.php
+%{_appdir}/config
+%{_appdir}/docs
+%{_appdir}/lib
+%{_appdir}/locale
+%{_appdir}/templates
+%{_appdir}/themes
 
 %define	date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -126,6 +126,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.14  2005/08/22 19:03:39  glen
+- convert to horde 3.x style
+
 Revision 1.13  2005/08/22 18:37:53  paszczus
 - added _noautoreq
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/horde-passwd.spec?r1=1.13&r2=1.14&f=u




More information about the pld-cvs-commit mailing list