]> git.pld-linux.org Git - packages/PHP-nuke.git/blob - PHP-nuke.spec
- use webapps framework
[packages/PHP-nuke.git] / PHP-nuke.spec
1 Summary:        Slashdot-like webnews site written in php, easy to install and use
2 Summary(pl):    Serwis nowinek WWW w stylu Slashdota napisany w PHP, ³atwy w instalacji i u¿ywaniu
3 Name:           PHP-nuke
4 Version:        7.8
5 Release:        2
6 License:        GPL
7 Group:          Applications/WWW
8 Source0:        http://phpnuke.org/files/PHP-Nuke-%{version}.zip
9 # Source0-md5:  0f60b9e5c67827192d4b36fc7b06b267
10 Source1:        PHP-Nuke.README.first
11 Source2:        %{name}.conf
12 URL:            http://phpnuke.org/
13 BuildRequires:  rpmbuild(macros) >= 1.268
14 BuildRequires:  unzip
15 Requires:       php-mysql
16 Requires:       php-pcre
17 Requires:       webapps
18 BuildArch:      noarch
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %define         _webapps        /etc/webapps
22 %define         _webapp         phpnuke
23 %define         _sysconfdir     %{_webapps}/%{_webapp}
24 %define         _appdir         %{_datadir}/%{_webapp}
25
26 %description
27 Content Management and Portal solution featuring web-based
28 administration, surveys, customizable blocks, modules and themes with
29 multilanguage support.
30
31 %description -l pl
32 Portal WWW napisany w PHP. Ma du¿e mo¿liwo¶ci, jest ³atwy w instalacji
33 u u¿ywaniu.
34
35 %prep
36 %setup -q -c
37 # undos the source
38 find . -type f -print0 | xargs -0 sed -i -e 's,\r$,,'
39 cp -p %{SOURCE1} README.first
40
41 %install
42 rm -rf $RPM_BUILD_ROOT
43 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
44
45 cp -a html/* $RPM_BUILD_ROOT%{_appdir}
46 mv $RPM_BUILD_ROOT%{_appdir}/config.php $RPM_BUILD_ROOT%{_sysconfdir}
47 ln -s %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config.php
48 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
49 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
50
51 %clean
52 rm -rf $RPM_BUILD_ROOT
53
54 %post
55 if [ "$1" = 1 ]; then
56 %banner -e %{name} <<EOF
57 If this is your first PHP Nuke install, then You should create the
58 MySQL database:
59 mysqladmin create nuke
60 zcat %{_docdir}/%{name}-%{version}/nuke.sql | mysql nuke
61
62 Read %{_docdir}/%{name}-%{version}/README.first.gz for further
63 information.
64 EOF
65 fi
66
67 %triggerin -- apache1
68 %webapp_register apache %{_webapp}
69
70 %triggerun -- apache1
71 %webapp_unregister apache %{_webapp}
72
73 %triggerin -- apache >= 2.0.0
74 %webapp_register httpd %{_webapp}
75
76 %triggerun -- apache >= 2.0.0
77 %webapp_unregister httpd %{_webapp}
78
79 %triggerpostun -- %{name} < 7.8-1.4
80 # old 7.4-2 trigger
81 if [ -s /home/services/httpd/html/nuke/config.php ]; then
82         mv -f /home/services/httpd/html/nuke/config.php %{_appdir}
83 fi
84
85 # nuke very-old config location (this mostly for Ra)
86 if [ -f /etc/httpd/httpd.conf ]; then
87         sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
88 fi
89
90 # migrate from httpd (apache2) config dir
91 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
92         cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
93         mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
94 fi
95
96 rm -f /etc/httpd/httpd.conf/phpnuke.conf
97 /usr/sbin/webapp register httpd %{_webapp}
98 %service -q httpd reload
99
100 %files
101 %defattr(644,root,root,755)
102 %doc Addons* Blocks* Changes* Credits* Install* README* Readme*
103 %doc Support* Upgrade* sql/nuke.sql upgrades
104 %dir %attr(750,root,http) %{_sysconfdir}
105 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
106 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
107 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
108 %{_appdir}
This page took 0.072804 seconds and 3 git commands to generate.