SPECS: newsportal.spec - use webapps framework - add apache config...
glen
glen at pld-linux.org
Wed Jan 4 14:50:53 CET 2006
Author: glen Date: Wed Jan 4 13:50:53 2006 GMT
Module: SPECS Tag: HEAD
---- Log message:
- use webapps framework
- add apache config
- add missing css files to package
- add missing php-iconv dep
- rel 2
---- Files affected:
SPECS:
newsportal.spec (1.23 -> 1.24)
---- Diffs:
================================================================
Index: SPECS/newsportal.spec
diff -u SPECS/newsportal.spec:1.23 SPECS/newsportal.spec:1.24
--- SPECS/newsportal.spec:1.23 Tue Dec 13 14:58:51 2005
+++ SPECS/newsportal.spec Wed Jan 4 14:50:46 2006
@@ -4,19 +4,27 @@
Summary(pl): Skrypt w PHP umożliwiający czytanie newsów przez przeglądarkę
Name: newsportal
Version: 0.36
-Release: 1
+Release: 2
License: GPL
Group: Networking/News
Source0: http://florian-amrhein.de/nw/newsportal/download/%{name}-%{version}.tar.gz
# Source0-md5: 9f93d2b7e4f9dcf1eeca90d9477b4a68
+Source1: %{name}-apache.conf
Patch0: %{name}-path.patch
URL: http://florian-amrhein.de/newsportal/
+BuildRequires: rpmbuild(macros) >= 1.264
Requires: php
Requires: php-pcre
+Requires: php-iconv
Requires: webserver = apache
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define _webapps /etc/webapps
+%define _webapp %{name}
+%define _sysconfdir %{_webapps}/%{_webapp}
+%define _appdir %{_datadir}/%{_webapp}
+
%description
This PHP script enables the access to a newsserver (by NNTP) from a
webpage. It allows you to combine web-forums and newsgroups. The
@@ -45,30 +53,75 @@
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_datadir}/%{name}/{img,doc,lang,extras/frames,lib},{/var/spool,%{_sysconfdir}}/%{name}}
+install -d $RPM_BUILD_ROOT{%{_appdir}/{img,doc,lang,extras/frames,lib},{/var/spool/%{name},%{_sysconfdir}}}
-install *.{php,inc,txt} $RPM_BUILD_ROOT%{_datadir}/%{name}
-install img/* $RPM_BUILD_ROOT%{_datadir}/%{name}/img
-install lang/* $RPM_BUILD_ROOT%{_datadir}/%{name}/lang
-install lib/* $RPM_BUILD_ROOT%{_datadir}/%{name}/lib
-install extras/frames/* $RPM_BUILD_ROOT%{_datadir}/%{name}/extras/frames
-mv $RPM_BUILD_ROOT%{_datadir}/%{name}/config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.inc
-mv $RPM_BUILD_ROOT%{_datadir}/%{name}/groups.txt $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
+install *.{php,inc,txt,css} $RPM_BUILD_ROOT%{_appdir}
+install img/* $RPM_BUILD_ROOT%{_appdir}/img
+install lang/* $RPM_BUILD_ROOT%{_appdir}/lang
+install lib/* $RPM_BUILD_ROOT%{_appdir}/lib
+install extras/frames/* $RPM_BUILD_ROOT%{_appdir}/extras/frames
+mv $RPM_BUILD_ROOT%{_appdir}/config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/config.php
+mv $RPM_BUILD_ROOT%{_appdir}/groups.txt $RPM_BUILD_ROOT%{_sysconfdir}/groups.txt
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
%clean
rm -rf $RPM_BUILD_ROOT
-%triggerpostun -- newsportal < 0.27
-echo Please move config files from /home/services/httpd/html/newsportal to
-echo %{_sysconfdir}/%{name} and update Your configuration to use new directory.
+%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 -- newsportal < 0.36-1.1
+# location before r1.16
+for i in groups.txt config.inc.php; do
+ if [ -f /home/services/httpd/html/newsportal/$i.rpmsave ]; then
+ mv -f %{_sysconfdir}/$i{,.rpmnew}
+ mv -f /home/services/httpd/html/newsportal/$i.rpmsave %{_sysconfdir}/$i
+ fi
+done
+# location before r1.23
+if [ -f /etc/%{name}/config.inc.rpmsave ]; then
+ mv -f %{_sysconfdir}/config.php{,.rpmnew}
+ mv -f /etc/%{name}/config.inc.rpmsave %{_sysconfdir}/config.php
+fi
+if [ -f /etc/%{name}/groups.txt.rpmsave ]; then
+ mv -f %{_sysconfdir}/groups.txt{,.rpmnew}
+ mv -f /etc/%{name}/groups.txt.rpmsave %{_sysconfdir}/groups.txt
+fi
+
+# no earlier registration. autodetect based on installed webservers
+if [ -d /etc/apache/webapps.d ]; then
+ /usr/sbin/webapp register apache %{_webapp}
+ if [ -f /var/lock/subsys/apache ]; then
+ /etc/rc.d/init.d/apache reload 1>&2
+ fi
+fi
+
+if [ -d /etc/httpd/webapps.d ]; then
+ /usr/sbin/webapp register httpd %{_webapp}
+ if [ -f /var/lock/subsys/httpd ]; then
+ /etc/rc.d/init.d/httpd reload 1>&2
+ fi
+fi
%files
%defattr(644,root,root,755)
%doc doc/*
-%dir %{_sysconfdir}/%{name}
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/config.inc
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/groups.txt
-%{_datadir}/%{name}
+%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
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/groups.txt
+%{_appdir}
%attr(700,http,http) %dir /var/spool/%{name}
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
@@ -77,6 +130,13 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.24 2006/01/04 13:50:46 glen
+- use webapps framework
+- add apache config
+- add missing css files to package
+- add missing php-iconv dep
+- rel 2
+
Revision 1.23 2005/12/13 13:58:51 glen
- adapterized (sorted %verify attrs)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SPECS/newsportal.spec?r1=1.23&r2=1.24&f=u
More information about the pld-cvs-commit
mailing list