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 for i in config.php favicon.ico robots.txt; do
151 if [ -f /home/services/httpd/html/phpBB/$i.rpmsave ]; then
152 mv -f %{_sysconfdir}/$i{,.rpmnew}
153 mv -f /home/services/httpd/html/phpBB/$i.rpmsave %{_sysconfdir}/$i
157 for i in config.php favicon.ico robots.txt; do
158 if [ -f /home/httpd/html/phpBB/$i.rpmsave ]; then
159 mv -f %{_sysconfdir}/$i{,.rpmnew}
160 mv -f /home/httpd/html/phpBB/$i.rpmsave %{_sysconfdir}/$i
164 for i in config.php favicon.ico robots.txt; do
165 if [ -f /etc/%{name}/$i.rpmsave ]; then
166 mv -f %{_sysconfdir}/$i{,.rpmnew}
167 mv -f /etc/%{name}/$i.rpmsave %{_sysconfdir}/$i
171 # nuke very-old config location (this mostly for Ra)
172 if [ -f /etc/httpd/httpd.conf ]; then
173 sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
176 # migrate from httpd (apache2) config dir
177 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
178 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
179 mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
182 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
183 /usr/sbin/webapp register httpd %{_webapp}
184 %service httpd reload
187 %defattr(644,root,root,755)
188 %dir %attr(750,root,http) %{_sysconfdir}
189 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
190 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
191 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
192 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/favicon.ico
193 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/robots.txt
197 %{_appdir}/common.php
203 %{_appdir}/templates/index.htm
204 %{_appdir}/templates/subSilver/*.*
205 %{_appdir}/templates/subSilver/admin/*.*
206 %{_appdir}/templates/subSilver/images/*.*
207 %{_appdir}/language/index.htm
208 %lang(en) %{_appdir}/language/lang_english
209 %lang(en) %{_appdir}/templates/subSilver/images/lang_english
210 %lang(pl) %{_appdir}/language/lang_polish
211 %lang(pl) %{_appdir}/templates/subSilver/images/lang_polish
212 %lang(de) %{_appdir}/language/lang_german
213 %lang(de) %{_appdir}/templates/subSilver/images/lang_german
214 %lang(fr) %{_appdir}/language/lang_french
215 %lang(fr) %{_appdir}/templates/subSilver/images/lang_french
216 %attr(710,root,http) %dir /var/lib/%{name}
217 %attr(1770,root,http) %dir %{_avatardir}
218 %{_avatardir}/index.htm
219 %{_avatardir}/gallery
220 %attr(640,root,http) %config(noreplace) %{_appdir}/config.php
221 %attr(640,root,http) %config(noreplace) %{_appdir}/favicon.ico
222 %attr(640,root,http) %config(noreplace) %{_appdir}/robots.txt
225 %defattr(644,root,root,755)
226 %doc install/schemas/*.zip
227 %dir %{_appdir}/install
228 %{_appdir}/install/*.php
229 %{_appdir}/install/schemas/*.sql