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