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 "For instalation: http://<your.site.address>/<path>/install/install.php"
120 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
122 echo "Remember to uninstall %{name}-install after initiation/upgrade of %{name}!!"
124 %triggerin -- apache1
125 %webapp_register apache %{_webapp}
127 %triggerun -- apache1
128 %webapp_unregister apache %{_webapp}
130 %triggerin -- apache >= 2.0.0
131 %webapp_register httpd %{_webapp}
133 %triggerun -- apache >= 2.0.0
134 %webapp_unregister httpd %{_webapp}
137 %triggerpostun -- %{name} <= 2.0.10-1
138 for i in `grep -lr "/home/\(services/\)*httpd/html/phpBB" /etc/httpd/*`; do
140 sed -i -e "s#/home/httpd/html/phpBB#%{_appdir}#g" $i
141 sed -i -e "s#/home/services/httpd/html/phpBB#%{_appdir}#g" $i
142 echo "File changed by trigger: $i (backup: $i.backup)"
145 %triggerpostun -- %{name} < 2.0.19-0.5
146 # rescue app config from various old locations
147 if [ -f /home/services/httpd/html/phpBB/config.php.rpmsave ]; then
148 mv -f %{_sysconfdir}/config.php{,.rpmnew}
149 mv -f /home/services/httpd/html/phpBB/config.php.rpmsave %{_sysconfdir}/config.php
152 if [ -f /home/httpd/html/phpBB/config.php.rpmsave ]; then
153 mv -f %{_sysconfdir}/config.php{,.rpmnew}
154 mv -f /home/httpd/html/phpBB/config.php.rpmsave %{_sysconfdir}/config.php
157 if [ -f /etc/%{name}/config.php.rpmsave ]; then
158 mv -f %{_sysconfdir}/config.php{,.rpmnew}
159 mv -f /etc/%{name}/config.php.rpmsave %{_sysconfdir}/config.php
162 # nuke very-old config location (this mostly for Ra)
163 if [ -f /etc/httpd/httpd.conf ]; then
164 sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
167 # migrate from httpd (apache2) config dir
168 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
169 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
170 mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
173 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
174 /usr/sbin/webapp register httpd %{_webapp}
175 %service httpd reload
177 %triggerpostun -- %{name} < %{version}
178 echo "You have to install %{name}-install package to prepare upgrade!!!"
179 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
182 %defattr(644,root,root,755)
183 %dir %attr(750,root,http) %{_sysconfdir}
184 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
185 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
186 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
187 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/favicon.ico
188 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/robots.txt
192 %{_appdir}/common.php
198 %{_appdir}/templates/index.htm
199 %{_appdir}/templates/subSilver/*.*
200 %{_appdir}/templates/subSilver/admin/*.*
201 %{_appdir}/templates/subSilver/images/*.*
202 %{_appdir}/language/index.htm
203 %lang(en) %{_appdir}/language/lang_english
204 %lang(en) %{_appdir}/templates/subSilver/images/lang_english
205 %lang(pl) %{_appdir}/language/lang_polish
206 %lang(pl) %{_appdir}/templates/subSilver/images/lang_polish
207 %lang(de) %{_appdir}/language/lang_german
208 %lang(de) %{_appdir}/templates/subSilver/images/lang_german
209 %lang(fr) %{_appdir}/language/lang_french
210 %lang(fr) %{_appdir}/templates/subSilver/images/lang_french
211 %attr(710,root,http) %dir /var/lib/%{name}
212 %attr(1770,root,http) %dir %{_avatardir}
213 %{_avatardir}/index.htm
214 %{_avatardir}/gallery
215 %attr(640,root,http) %config(noreplace) %{_appdir}/config.php
216 %attr(640,root,http) %config(noreplace) %{_appdir}/favicon.ico
217 %attr(640,root,http) %config(noreplace) %{_appdir}/robots.txt
220 %defattr(644,root,root,755)
221 %doc install/schemas/*.zip
222 %{_appdir}/install/*.php
223 %{_appdir}/install/schemas/*.sql