SPECS: PHP-nuke.spec - use webapps framework - fix package group, ...
glen
glen at pld-linux.org
Sun Jan 22 22:13:13 CET 2006
Author: glen Date: Sun Jan 22 21:13:13 2006 GMT
Module: SPECS Tag: HEAD
---- Log message:
- use webapps framework
- fix package group, updated description
- prep cleanup: our rpm already fixes permissions
- rel 2, STBR
---- Files affected:
SPECS:
PHP-nuke.spec (1.40 -> 1.41)
---- Diffs:
================================================================
Index: SPECS/PHP-nuke.spec
diff -u SPECS/PHP-nuke.spec:1.40 SPECS/PHP-nuke.spec:1.41
--- SPECS/PHP-nuke.spec:1.40 Tue Dec 13 15:37:23 2005
+++ SPECS/PHP-nuke.spec Sun Jan 22 22:13:08 2006
@@ -3,109 +3,110 @@
Summary(pl): Serwis nowinek WWW w stylu Slashdota napisany w PHP, łatwy w instalacji i używaniu
Name: PHP-nuke
Version: 7.8
-Release: 1
+Release: 2
License: GPL
-Group: Applications/Databases/Interfaces
+Group: Applications/WWW
Source0: http://phpnuke.org/files/PHP-Nuke-%{version}.zip
# Source0-md5: 0f60b9e5c67827192d4b36fc7b06b267
Source1: PHP-Nuke.README.first
Source2: %{name}.conf
-#Icon: phpnuke.gif
URL: http://phpnuke.org/
+BuildRequires: rpmbuild(macros) >= 1.268
BuildRequires: unzip
Requires: php-mysql
Requires: php-pcre
-Requires: webserver
+Requires: webapps
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _nukeroot %{_datadir}/phpnuke
+%define _webapps /etc/webapps
+%define _webapp phpnuke
+%define _sysconfdir %{_webapps}/%{_webapp}
+%define _appdir %{_datadir}/%{_webapp}
%description
-Web-portal writen in php. Very powerful, yet easy to install and use:
-see documentation in %{_docdir}/%{name}-%{version} for details.
-
-You only have to run:
-mysqladmin create nuke
-mysql nuke < %{_docdir}/%{name}-%{version}/nuke.sql
-
-(read %{_docdir}/%{name}-%{version}/README.first for further
-information)
+Content Management and Portal solution featuring web-based
+administration, surveys, customizable blocks, modules and themes with
+multilanguage support.
%description -l pl
Portal WWW napisany w PHP. Ma duże możliwości, jest łatwy w instalacji
-u używaniu. Szczegóły w dokumentacji w %{_docdir}/%{name}-%{version}.
-
-Wystarczy zrobić jedno:
-mysqladmin create nuke
-mysql nuke < %{_docdir}/%{name}-%{version}/nuke.sql
-
-(więcej informacji w %{_docdir}/%{name}-%{version}/README.first)
+u używaniu.
%prep
%setup -q -c
-
-install %{SOURCE1} README.first
-
-# (TV): workaround for bad tarball
-find -type d -exec chmod 755 '{}' \;
-find -type f -exec chmod 644 '{}' \;
-find -type f -empty |xargs rm -f
-chmod 755 */*/*/
+# undos the source
+find . -type f -print0 | xargs -0 sed -i -e 's,\r$,,'
+cp -p %{SOURCE1} README.first
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_nukeroot},/etc/httpd}
-
-cp -ar html/* $RPM_BUILD_ROOT%{_nukeroot}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd/phpnuke.conf
+cp -a html/* $RPM_BUILD_ROOT%{_appdir}
+mv $RPM_BUILD_ROOT%{_appdir}/config.php $RPM_BUILD_ROOT%{_sysconfdir}
+ln -s %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config.php
+install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
%clean
rm -rf $RPM_BUILD_ROOT
-%triggerpostun -- %{name} <= 7.4-2
+%post
+if [ "$1" = 1 ]; then
+%banner -e %{name} <<EOF
+If this is your first PHP Nuke install, then You should create the
+MySQL database:
+mysqladmin create nuke
+zcat %{_docdir}/%{name}-%{version}/nuke.sql | mysql nuke
+
+Read %{_docdir}/%{name}-%{version}/README.first.gz for further
+information.
+EOF
+fi
+
+%triggerin -- apache1
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache >= 2.0.0
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache >= 2.0.0
+%webapp_unregister httpd %{_webapp}
+
+%triggerpostun -- %{name} < 7.8-1.4
+# old 7.4-2 trigger
if [ -s /home/services/httpd/html/nuke/config.php ]; then
- mv -f /home/services/httpd/html/nuke/config.php %{_nukeroot}
+ mv -f /home/services/httpd/html/nuke/config.php %{_appdir}
fi
-%post
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*phpnuke.conf" /etc/httpd/httpd.conf; then
- echo "Include /etc/httpd/phpnuke.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/phpnuke.conf /etc/httpd/httpd.conf/phpnuke.conf
- if [ -f /var/lock/subsys/httpd ]; then
- /usr/sbin/apachectl restart 1>&2
- fi
+# nuke very-old config location (this mostly for Ra)
+if [ -f /etc/httpd/httpd.conf ]; then
+ sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
fi
-%preun
-if [ "$1" = "0" ]; then
- umask 027
- if [ -d /etc/httpd/httpd.conf ]; then
- rm -f /etc/httpd/httpd.conf/99_phpnuke.conf
- else
- grep -v "^Include.*phpnuke.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
+# migrate from httpd (apache2) config dir
+if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
+ cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+ mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
fi
+rm -f /etc/httpd/httpd.conf/phpnuke.conf
+/usr/sbin/webapp register httpd %{_webapp}
+%service -q httpd reload
+
%files
%defattr(644,root,root,755)
%doc Addons* Blocks* Changes* Credits* Install* README* Readme*
%doc Support* Upgrade* sql/nuke.sql upgrades
-%config(noreplace) %verify(not md5 mtime size) /etc/httpd/phpnuke.conf
-%dir %{_nukeroot}
-%config(noreplace) %attr(640,http,http) %{_nukeroot}/config.php
-%{_nukeroot}/[!c]*
-# more needed?
+%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
+%{_appdir}
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
@@ -113,6 +114,12 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.41 2006/01/22 21:13:08 glen
+- use webapps framework
+- fix package group, updated description
+- prep cleanup: our rpm already fixes permissions
+- rel 2, STBR
+
Revision 1.40 2005/12/13 14:37:23 glen
- adapterized (sorted %verify flags)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SPECS/PHP-nuke.spec?r1=1.40&r2=1.41&f=u
More information about the pld-cvs-commit
mailing list