2 %bcond_without php5 # build without php5 support
4 Summary: A feature-rich PHP discussion board
5 Summary(pl): Forum dyskusyjne o du¿ych mo¿liwo¶ciach
11 Group: Applications/WWW
12 Source0: http://dl.sourceforge.net/phpbb-php5mod/%{fver}.tar.bz2
13 # Source0-md5: 49b3858da2f8e48e2fc5f0b144a05b6d
14 Source1: http://dl.sourceforge.net/phpbb/lang_polish.tar.gz
15 # Source1-md5: db020ef788d4bd50ce04014964e3e043
16 Source2: http://dl.sourceforge.net/phpbb/subSilver_polish.tar.gz
17 # Source2-md5: 9367f7a761aef3795ffa296b413136b4
18 Source3: http://dl.sourceforge.net/phpbb/lang_german.tar.gz
19 # Source3-md5: afc686072978b896e18fa211210c3b13
20 Source4: http://dl.sourceforge.net/phpbb/subSilver_german.tar.gz
21 # Source4-md5: 8340f310ee4892f3e19da3e000fdb708
22 Source5: http://dl.sourceforge.net/phpbb/lang_french.tar.gz
23 # Source5-md5: c81f843d4adf0a086efef590074478e6
24 Source6: http://dl.sourceforge.net/phpbb/subSilver_french.tar.gz
25 # Source6-md5: 419157eb144fa81b7464a5f2edeea434
28 Source9: http://dl.sourceforge.net/phpbb/%{name}-%{version}.tar.bz2
29 # Source9-md5: 7b8c6d6f7f92571afb34f192f3c242dd
30 URL: http://www.phpbb.com/
31 BuildRequires: rpmbuild(macros) >= 1.268
32 Requires(triggerpostun): sed >= 4.0
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 %define _avatardir /var/lib/%{name}/avatars
39 %define _appdir %{_datadir}/%{name}
40 %define _webapps /etc/webapps
41 %define _webapp %{name}
42 %define _sysconfdir %{_webapps}/%{_webapp}
45 phpBB is a UBB-style dissussion board written in PHP backended by a
46 MySQL database. It includes features such as posting/replying/editing
47 messages, private messages, private forums, user and anonymous
48 posting, robust theming, user ranking by posts or by special, admin
49 definable, ranks, and much more.
52 phpBB jest forum dyskusyjnym w stylu UBB napisanym w PHP z u¿yciem
53 bazy danych MySQL. Ma mo¿liwo¶ci takie jak: wysy³anie, odpisywanie,
54 edycja wiadomo¶ci, prywatne wiadomo¶ci, prywatne fora, wysy³anie jako
55 u¿ytkownik i anonimowe, bogaty wybór motywów, ranking u¿ytkowników
56 wed³ug ich wiadomo¶ci lub specjalne, definiowane przez administratora,
57 rankingi i wiele innych.
60 Summary: A feature-rich PHP discussion board - installer
61 Summary(pl): Forum dyskusyjne o du¿ych mo¿liwo¶ciach - instalator
62 Group: Applications/Databases/Interfaces
66 Package needed for %{name} forum instalation.
68 %description install -l pl
69 Pakiet potrzebny do instalacji forum %{name}.
73 %setup -q -T -b 9 -n phpBB2
79 rm -rf $RPM_BUILD_ROOT
80 install -d $RPM_BUILD_ROOT%{_appdir}/{admin,db,images,includes,install/schemas,language,templates} \
81 $RPM_BUILD_ROOT{%{_sysconfdir},/etc/httpd,%{_avatardir}}
83 install *.{php,inc} $RPM_BUILD_ROOT%{_appdir}
84 install admin/*.php $RPM_BUILD_ROOT%{_appdir}/admin
85 install db/*.php $RPM_BUILD_ROOT%{_appdir}/db
86 install includes/*.php $RPM_BUILD_ROOT%{_appdir}/includes
87 install install/*.php $RPM_BUILD_ROOT%{_appdir}/install
88 install install/schemas/*.sql $RPM_BUILD_ROOT%{_appdir}/install/schemas
90 cp -R images/* $RPM_BUILD_ROOT%{_appdir}/images
91 cp -R images/avatars/* $RPM_BUILD_ROOT%{_avatardir}
92 cp -R language/* $RPM_BUILD_ROOT%{_appdir}/language
93 cp -R templates/* $RPM_BUILD_ROOT%{_appdir}/templates
94 rm -rf $RPM_BUILD_ROOT%{_appdir}/images/avatars
95 ln -sf %{_avatardir} $RPM_BUILD_ROOT%{_appdir}/images/avatars
97 install config.php $RPM_BUILD_ROOT%{_sysconfdir}/config.php
98 install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/favicon.ico
99 touch $RPM_BUILD_ROOT%{_sysconfdir}/robots.txt
100 ln -sf %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config.php
101 ln -sf %{_sysconfdir}/favicon.ico $RPM_BUILD_ROOT%{_appdir}/favicon.ico
102 ln -sf %{_sysconfdir}/robots.txt $RPM_BUILD_ROOT%{_appdir}/robots.txt
104 tar zxf %{SOURCE1} -C $RPM_BUILD_ROOT%{_appdir}/language/
105 tar zxf %{SOURCE2} -C $RPM_BUILD_ROOT%{_appdir}/templates/
106 tar zxf %{SOURCE3} -C $RPM_BUILD_ROOT%{_appdir}/language/
107 tar zxf %{SOURCE4} -C $RPM_BUILD_ROOT%{_appdir}/templates/
108 tar zxf %{SOURCE5} -C $RPM_BUILD_ROOT%{_appdir}/language/
109 tar zxf %{SOURCE6} -C $RPM_BUILD_ROOT%{_appdir}/templates/
110 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
111 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
113 find $RPM_BUILD_ROOT%{_appdir} -name Thumbs.db | xargs rm -f
116 rm -rf $RPM_BUILD_ROOT
119 echo "You have to install %{name}-install package to prepare upgrade!!!"
120 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
123 echo "For installation: http://<your.site.address>/<path>/install/install.php"
124 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
126 echo "Remember to uninstall %{name}-install after initiation/upgrade of %{name}!!"
128 %triggerin -- apache1
129 %webapp_register apache %{_webapp}
131 %triggerun -- apache1
132 %webapp_unregister apache %{_webapp}
134 %triggerin -- apache >= 2.0.0
135 %webapp_register httpd %{_webapp}
137 %triggerun -- apache >= 2.0.0
138 %webapp_unregister httpd %{_webapp}
140 %triggerpostun -- %{name} <= 2.0.10-1
141 for i in `grep -lr "/home/\(services/\)*httpd/html/phpBB" /etc/httpd/*`; do
143 sed -i -e "s#/home/httpd/html/phpBB#%{_appdir}#g" $i
144 sed -i -e "s#/home/services/httpd/html/phpBB#%{_appdir}#g" $i
145 echo "File changed by trigger: $i (backup: $i.backup)"
148 %triggerpostun -- %{name} < 2.0.19-0.5
149 # rescue app config from various old locations
150 if [ -f /home/services/httpd/html/phpBB/config.php.rpmsave ]; then
151 mv -f %{_sysconfdir}/config.php{,.rpmnew}
152 mv -f /home/services/httpd/html/phpBB/config.php.rpmsave %{_sysconfdir}/config.php
155 if [ -f /home/httpd/html/phpBB/config.php.rpmsave ]; then
156 mv -f %{_sysconfdir}/config.php{,.rpmnew}
157 mv -f /home/httpd/html/phpBB/config.php.rpmsave %{_sysconfdir}/config.php
160 if [ -f /etc/%{name}/config.php.rpmsave ]; then
161 mv -f %{_sysconfdir}/config.php{,.rpmnew}
162 mv -f /etc/%{name}/config.php.rpmsave %{_sysconfdir}/config.php
165 # nuke very-old config location (this mostly for Ra)
166 if [ -f /etc/httpd/httpd.conf ]; then
167 sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
170 # migrate from httpd (apache2) config dir
171 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
172 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
173 mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
176 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
177 /usr/sbin/webapp register httpd %{_webapp}
178 %service httpd reload
181 %defattr(644,root,root,755)
182 %dir %attr(750,root,http) %{_sysconfdir}
183 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
184 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
185 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
186 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/favicon.ico
187 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/robots.txt
191 %{_appdir}/common.php
197 %{_appdir}/templates/index.htm
198 %{_appdir}/templates/subSilver/*.*
199 %{_appdir}/templates/subSilver/admin/*.*
200 %{_appdir}/templates/subSilver/images/*.*
201 %{_appdir}/language/index.htm
202 %lang(en) %{_appdir}/language/lang_english
203 %lang(en) %{_appdir}/templates/subSilver/images/lang_english
204 %lang(pl) %{_appdir}/language/lang_polish
205 %lang(pl) %{_appdir}/templates/subSilver/images/lang_polish
206 %lang(de) %{_appdir}/language/lang_german
207 %lang(de) %{_appdir}/templates/subSilver/images/lang_german
208 %lang(fr) %{_appdir}/language/lang_french
209 %lang(fr) %{_appdir}/templates/subSilver/images/lang_french
210 %attr(710,root,http) %dir /var/lib/%{name}
211 %attr(1770,root,http) %dir %{_avatardir}
212 %{_avatardir}/index.htm
213 %{_avatardir}/gallery
214 %attr(640,root,http) %config(noreplace) %{_appdir}/config.php
215 %attr(640,root,http) %config(noreplace) %{_appdir}/favicon.ico
216 %attr(640,root,http) %config(noreplace) %{_appdir}/robots.txt
219 %defattr(644,root,root,755)
220 %doc install/schemas/*.zip
221 %{_appdir}/install/*.php
222 %{_appdir}/install/schemas/*.sql