]> git.pld-linux.org Git - packages/phpBB.git/blob - phpBB.spec
d0ffd25c89e9804885ec6798677f5771895cd489
[packages/phpBB.git] / phpBB.spec
1 # Conditional build:
2 %bcond_without  php5            # build without php5 support
3 #
4 Summary:        A feature-rich PHP discussion board
5 Summary(pl):    Forum dyskusyjne o du¿ych mo¿liwo¶ciach
6 Name:           phpBB
7 Version:        2.0.19
8 %define fver    20195
9 Release:        1
10 License:        GPL v2
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
26 Source7:        %{name}.conf
27 Source8:        %{name}.ico
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
33 Requires:       php-pcre
34 Requires:       webapps
35 BuildArch:      noarch
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
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}
43
44 %description
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.
50
51 %description -l pl
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.
58
59 %package install
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
63 Requires:       phpBB
64
65 %description install
66 Package needed for %{name} forum instalation.
67
68 %description install -l pl
69 Pakiet potrzebny do instalacji forum %{name}.
70
71 %prep
72 %if %{without php5}
73 %setup -q -T -b 9 -n phpBB2
74 %else
75 %setup -q -c
76 %endif
77
78 %install
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}}
82
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
89
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
96
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
103
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
112
113 find $RPM_BUILD_ROOT%{_appdir} -name Thumbs.db | xargs rm -f
114
115 %clean
116 rm -rf $RPM_BUILD_ROOT
117
118 %post
119 echo "You have to install %{name}-install package to prepare upgrade!!!"
120 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
121
122 %post install
123 echo "For installation: http://<your.site.address>/<path>/install/install.php"
124 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
125 echo
126 echo "Remember to uninstall %{name}-install after initiation/upgrade of %{name}!!"
127
128 %triggerin -- apache1
129 %webapp_register apache %{_webapp}
130
131 %triggerun -- apache1
132 %webapp_unregister apache %{_webapp}
133
134 %triggerin -- apache < 2.2.0, apache-base
135 %webapp_register httpd %{_webapp}
136
137 %triggerun -- apache < 2.2.0, apache-base
138 %webapp_unregister httpd %{_webapp}
139
140 %triggerpostun -- %{name} <= 2.0.10-1
141 for i in `grep -lr "/home/\(services/\)*httpd/html/phpBB" /etc/httpd/*`; do
142         cp $i $i.backup
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)"
146 done
147
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
154     fi
155 done
156
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
161     fi
162 done
163
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
168     fi
169 done
170
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
174 fi
175
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
180 fi
181
182 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
183 /usr/sbin/webapp register httpd %{_webapp}
184 %service httpd reload
185
186 %files
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
194 %doc docs/*
195 %dir %{_appdir}
196 %{_appdir}/[!c]*.php
197 %{_appdir}/common.php
198 %{_appdir}/*.inc
199 %{_appdir}/admin
200 %{_appdir}/db
201 %{_appdir}/images
202 %{_appdir}/includes
203 %dir %{_appdir}/templates
204 %{_appdir}/templates/index.htm
205 %{_appdir}/templates/subSilver/*.*
206 %{_appdir}/templates/subSilver/admin/*.*
207 %{_appdir}/templates/subSilver/images/*.*
208 %dir %{_appdir}/language
209 %{_appdir}/language/index.htm
210 %lang(en) %{_appdir}/language/lang_english
211 %lang(en) %{_appdir}/templates/subSilver/images/lang_english
212 %lang(pl) %{_appdir}/language/lang_polish
213 %lang(pl) %{_appdir}/templates/subSilver/images/lang_polish
214 %lang(de) %{_appdir}/language/lang_german
215 %lang(de) %{_appdir}/templates/subSilver/images/lang_german
216 %lang(fr) %{_appdir}/language/lang_french
217 %lang(fr) %{_appdir}/templates/subSilver/images/lang_french
218 %attr(710,root,http) %dir /var/lib/%{name}
219 %attr(1770,root,http) %dir %{_avatardir}
220 %{_avatardir}/index.htm
221 %{_avatardir}/gallery
222 %attr(640,root,http) %config(noreplace) %{_appdir}/config.php
223 %attr(640,root,http) %config(noreplace) %{_appdir}/favicon.ico
224 %attr(640,root,http) %config(noreplace) %{_appdir}/robots.txt
225
226 %files install
227 %defattr(644,root,root,755)
228 %doc install/schemas/*.zip
229 %dir %{_appdir}/install
230 %{_appdir}/install/*.php
231 %dir %{_appdir}/install/schemas
232 %{_appdir}/install/schemas/*.sql
This page took 0.0416570000000001 seconds and 3 git commands to generate.