SPECS: postnuke.spec - webapps framework - renamed -install to -se...

glen glen at pld-linux.org
Thu Mar 9 23:33:04 CET 2006


Author: glen                         Date: Thu Mar  9 22:33:04 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- webapps framework
- renamed -install to -setup like other webapps do
- changed group to Applications/WWW
- NFY

---- Files affected:
SPECS:
   postnuke.spec (1.43 -> 1.44) 

---- Diffs:

================================================================
Index: SPECS/postnuke.spec
diff -u SPECS/postnuke.spec:1.43 SPECS/postnuke.spec:1.44
--- SPECS/postnuke.spec:1.43	Thu Mar  9 22:29:38 2006
+++ SPECS/postnuke.spec	Thu Mar  9 23:32:58 2006
@@ -1,11 +1,16 @@
 # $Revision$, $Date$
+# TODO
+# - put pl language pack into separate package, such overwriting of
+#   the original files is discriminating:)
+# - contentexpress module is not installed
+# - use system Smarty and adodb
 Summary:	weblog/Content Management System (CMS)
 Summary(pl):	System zarządzania treścią
 Name:		postnuke
 Version:	0.762
-Release:	1
+Release:	1.11
 License:	GPL v2
-Group:		Applications/Databases/Interfaces
+Group:		Applications/WWW
 Source0:	http://downloads.postnuke.com/sf/postnuke/PostNuke-%{version}.tar.gz
 # Source0-md5:	ea25bb933c4a99b30854815215dcdbb6
 # ContentExpress
@@ -15,14 +20,22 @@
 # Polish lang pack
 Source2:	pn-0.760-pl.tar.gz
 # Source2-md5:	635f46d8a622a6cbff23da18ef19c95d
+Source3:	%{name}-apache.conf
+Patch0:		%{name}-pnTemp.patch
 URL:		http://www.postnuke.com/
+BuildRequires:	rpmbuild(macros) >= 1.268
 Requires:	php-exif
 Requires:	php-mysql >= 3:4.0.2
-Requires:	webserver
+Requires:	php-tokenizer
+Requires:	webapps
+Obsoletes:	postnuke-install
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		nukeroot	/home/services/httpd/html/postnuke
+%define		_webapps	/etc/webapps
+%define		_webapp		%{name}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
+%define		_appdir		%{_datadir}/%{_webapp}
 
 %description
 PostNuke is a weblog/Content Management System (CMS). It is far more
@@ -60,51 +73,107 @@
 Ten pakiet zawiera dodatkowe moduły:
 - ContentExpress-%{_ceversion}
 
-%package install
-Summary:	weblog/Content Management System (CMS) - installer
-Summary(pl):	System zarządzania treścią - instalator
-Group:		Applications/Databases/Interfaces
-Requires:	%{name} = %{version}
-
-%description install
-Package needed to install postnuke.
-
-%description install -l pl
-Pakiet potrzebny do zainstalowania postnuke.
+%package setup
+Summary:	Postnuke setup package
+Summary(pl):	Pakiet do wstępnej konfiguracji Postnuke
+Group:		Applications/WWW
+Requires:	%{name} = %{version}-%{release}
+
+%description setup
+Install this package to configure initial Postnuke installation. You
+should uninstall this package when you're done, as it considered
+insecure to keep the setup files in place.
+
+%description setup -l pl
+Ten pakiet należy zainstalować w celu wstępnej konfiguracji Postnuke po
+pierwszej instalacji. Potem należy go odinstalować, jako że
+pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
 
 %prep
 %setup -q -n PostNuke-%{version} -a1 -a2
+# undos the source
+find . -type f -print0 | xargs -0 sed -i -e 's,\r$,,'
+%patch0 -p1
+
+> html/config-old.php
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{nukeroot}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},/var/lib/postnuke}
+cp -a html/* $RPM_BUILD_ROOT%{_appdir}
+mv $RPM_BUILD_ROOT%{_appdir}/config.php $RPM_BUILD_ROOT%{_sysconfdir}
+mv $RPM_BUILD_ROOT%{_appdir}/config-old.php $RPM_BUILD_ROOT%{_sysconfdir}
+mv $RPM_BUILD_ROOT%{_appdir}/pnTemp $RPM_BUILD_ROOT/var/lib/postnuke
+ln -s %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}
+ln -s %{_sysconfdir}/config-old.php $RPM_BUILD_ROOT%{_appdir}
 
-cp -ar html/*		$RPM_BUILD_ROOT%{nukeroot}
+install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post install
-echo "Remember to uninstall %{name}-install after initiation of %{name}!!"
+%post setup
+chmod 660 %{_sysconfdir}/config.php
+chown root:http %{_sysconfdir}/config.php
+
+%postun setup
+if [ "$1" = "0" ]; then
+	chmod 640 %{_sysconfdir}/config.php
+	chown root:http %{_sysconfdir}/config.php
+fi
+
+%triggerin -- apache1
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
+%triggerpostun -- %{name} < 0.762-1.7
+if [ -f /home/services/httpd/html/postnuke/config.php.rpmsave ]; then
+	mv -f %{_sysconfdir}/config.php{,.rpmnew}
+	mv -f /home/services/httpd/html/postnuke/config.php.rpmsave %{_sysconfdir}/config.php
+fi
+
+# no earlier registration, just register with apache2
+if [ -d /etc/httpd/webapps.d ]; then
+	/usr/sbin/webapp register httpd %{_webapp}
+	%service -q httpd reload
+fi
 
 %files
 %defattr(644,root,root,755)
 %doc phoenix-sql/*
-%dir %{nukeroot}
-%attr(640,http,http) %config(noreplace) %{nukeroot}/config*.php
-%dir %{nukeroot}/pnTemp
-%attr(755,http,http) %{nukeroot}/pnTemp/*
-%{nukeroot}/[!ip]*
-%{nukeroot}/images
-%{nukeroot}/includes
-%{nukeroot}/index.php
-%{nukeroot}/p*.php
+%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}/*.php
+%dir %{_appdir}
+%{_appdir}/docs
+%{_appdir}/images
+%{_appdir}/includes
+%{_appdir}/javascript
+%{_appdir}/language
+%{_appdir}/modules
+%{_appdir}/themes
+%{_appdir}/*.php
+%{_appdir}/*.txt
+%exclude %{_appdir}/install.php
 
-%files install
+%defattr(644,http,http,755)
+/var/lib/postnuke
+
+%files setup
 %defattr(644,root,root,755)
-%dir %{nukeroot}/install
-%attr(750,http,http) %{nukeroot}/install/*
-%attr(750,http,http) %{nukeroot}/install.php
+%defattr(644,http,http,755)
+%{_appdir}/install
+%{_appdir}/install.php
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -112,6 +181,12 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.44  2006/03/09 22:32:58  glen
+- webapps framework
+- renamed -install to -setup like other webapps do
+- changed group to Applications/WWW
+- NFY
+
 Revision 1.43  2006/03/09 21:29:38  qboosh
 - missing dir, glob syntax fix
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/postnuke.spec?r1=1.43&r2=1.44&f=u



More information about the pld-cvs-commit mailing list