]> git.pld-linux.org Git - packages/phpBB.git/blob - phpBB.spec
- up to 2.0.21
[packages/phpBB.git] / phpBB.spec
1 Summary:        A feature-rich PHP discussion board
2 Summary(pl):    Forum dyskusyjne o du¿ych mo¿liwo¶ciach
3 Name:           phpBB
4 Version:        2.0.21
5 Release:        1
6 License:        GPL v2
7 Group:          Applications/WWW
8 Source0:        http://dl.sourceforge.net/phpbb/%{name}-%{version}.tar.bz2
9 # Source0-md5:  891dd4d30539dad4ba301db2ad038392
10 Source1:        http://dl.sourceforge.net/phpbb/lang_polish.tar.gz
11 # Source1-md5:  db020ef788d4bd50ce04014964e3e043
12 Source2:        http://dl.sourceforge.net/phpbb/subsilver_polish.tar.gz
13 # Source2-md5:  9367f7a761aef3795ffa296b413136b4
14 Source3:        http://dl.sourceforge.net/phpbb/lang_german.tar.gz
15 # Source3-md5:  5170a64aac5bf429b2c61fe36728c8cf
16 Source4:        http://dl.sourceforge.net/phpbb/subsilver_german.tar.gz
17 # Source4-md5:  8340f310ee4892f3e19da3e000fdb708
18 Source5:        http://dl.sourceforge.net/phpbb/lang_french.tar.gz
19 # Source5-md5:  a46b461d5e5406b1cf24bcf4b55ada08
20 Source6:        http://dl.sourceforge.net/phpbb/subsilver_french.tar.gz
21 # Source6-md5:  419157eb144fa81b7464a5f2edeea434
22 Source7:        %{name}.conf
23 Source8:        %{name}.ico
24 URL:            http://www.phpbb.com/
25 BuildRequires:  rpmbuild(macros) >= 1.268
26 Requires(triggerpostun):        sed >= 4.0
27 Requires:       php-pcre
28 Requires:       webapps
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %define         _avatardir      /var/lib/%{name}/avatars
33 %define         _appdir         %{_datadir}/%{name}
34 %define         _webapps        /etc/webapps
35 %define         _webapp         %{name}
36 %define         _sysconfdir     %{_webapps}/%{_webapp}
37
38 %description
39 phpBB is a UBB-style dissussion board written in PHP backended by a
40 MySQL database. It includes features such as posting/replying/editing
41 messages, private messages, private forums, user and anonymous
42 posting, robust theming, user ranking by posts or by special, admin
43 definable, ranks, and much more.
44
45 %description -l pl
46 phpBB jest forum dyskusyjnym w stylu UBB napisanym w PHP z u¿yciem
47 bazy danych MySQL. Ma mo¿liwo¶ci takie jak: wysy³anie, odpisywanie,
48 edycja wiadomo¶ci, prywatne wiadomo¶ci, prywatne fora, wysy³anie jako
49 u¿ytkownik i anonimowe, bogaty wybór motywów, ranking u¿ytkowników
50 wed³ug ich wiadomo¶ci lub specjalne, definiowane przez administratora,
51 rankingi i wiele innych.
52
53 %package install
54 Summary:        A feature-rich PHP discussion board - installer
55 Summary(pl):    Forum dyskusyjne o du¿ych mo¿liwo¶ciach - instalator
56 Group:          Applications/Databases/Interfaces
57 Requires:       phpBB
58
59 %description install
60 Package needed for %{name} forum instalation.
61
62 %description install -l pl
63 Pakiet potrzebny do instalacji forum %{name}.
64
65 %prep
66 %setup -q -n phpBB2
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70 install -d $RPM_BUILD_ROOT%{_appdir}/{admin,db,images,includes,install/schemas,language,templates} \
71         $RPM_BUILD_ROOT{%{_sysconfdir},/etc/httpd,%{_avatardir}}
72
73 install *.{php,inc}     $RPM_BUILD_ROOT%{_appdir}
74 install admin/*.php     $RPM_BUILD_ROOT%{_appdir}/admin
75 install db/*.php        $RPM_BUILD_ROOT%{_appdir}/db
76 install includes/*.php  $RPM_BUILD_ROOT%{_appdir}/includes
77 install install/*.php   $RPM_BUILD_ROOT%{_appdir}/install
78 install install/schemas/*.sql $RPM_BUILD_ROOT%{_appdir}/install/schemas
79
80 cp -R images/*          $RPM_BUILD_ROOT%{_appdir}/images
81 cp -R images/avatars/*  $RPM_BUILD_ROOT%{_avatardir}
82 cp -R language/*        $RPM_BUILD_ROOT%{_appdir}/language
83 cp -R templates/*       $RPM_BUILD_ROOT%{_appdir}/templates
84 rm -rf $RPM_BUILD_ROOT%{_appdir}/images/avatars
85 ln -sf %{_avatardir} $RPM_BUILD_ROOT%{_appdir}/images/avatars
86
87 install config.php $RPM_BUILD_ROOT%{_sysconfdir}/config.php
88 install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/favicon.ico
89 touch $RPM_BUILD_ROOT%{_sysconfdir}/robots.txt
90 ln -sf %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config.php
91 ln -sf %{_sysconfdir}/favicon.ico $RPM_BUILD_ROOT%{_appdir}/favicon.ico
92 ln -sf %{_sysconfdir}/robots.txt $RPM_BUILD_ROOT%{_appdir}/robots.txt
93
94 tar zxf %{SOURCE1} -C $RPM_BUILD_ROOT%{_appdir}/language/
95 tar zxf %{SOURCE2} -C $RPM_BUILD_ROOT%{_appdir}/templates/
96 tar zxf %{SOURCE3} -C $RPM_BUILD_ROOT%{_appdir}/language/
97 tar zxf %{SOURCE4} -C $RPM_BUILD_ROOT%{_appdir}/templates/
98 tar zxf %{SOURCE5} -C $RPM_BUILD_ROOT%{_appdir}/language/
99 tar zxf %{SOURCE6} -C $RPM_BUILD_ROOT%{_appdir}/templates/
100 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
101 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
102
103 find $RPM_BUILD_ROOT%{_appdir} -name Thumbs.db | xargs rm -f
104
105 %clean
106 rm -rf $RPM_BUILD_ROOT
107
108 %post
109 echo "You have to install %{name}-install package to prepare upgrade!!!"
110 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
111
112 %post install
113 echo "For installation: http://<your.site.address>/<path>/install/install.php"
114 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
115 echo
116 echo "Remember to uninstall %{name}-install after initiation/upgrade of %{name}!!"
117
118 %triggerin -- apache1
119 %webapp_register apache %{_webapp}
120
121 %triggerun -- apache1
122 %webapp_unregister apache %{_webapp}
123
124 %triggerin -- apache < 2.2.0, apache-base
125 %webapp_register httpd %{_webapp}
126
127 %triggerun -- apache < 2.2.0, apache-base
128 %webapp_unregister httpd %{_webapp}
129
130 %triggerpostun -- %{name} <= 2.0.10-1
131 for i in `grep -lr "/home/\(services/\)*httpd/html/phpBB" /etc/httpd/*`; do
132         cp $i $i.backup
133         sed -i -e "s#/home/httpd/html/phpBB#%{_appdir}#g" $i
134         sed -i -e "s#/home/services/httpd/html/phpBB#%{_appdir}#g" $i
135         echo "File changed by trigger: $i (backup: $i.backup)"
136 done
137
138 %triggerpostun -- %{name} < 2.0.19-0.5
139 # rescue app config from various old locations
140 for i in config.php favicon.ico robots.txt; do
141     if [ -f /home/services/httpd/html/phpBB/$i.rpmsave ]; then
142             mv -f %{_sysconfdir}/$i{,.rpmnew}
143             mv -f /home/services/httpd/html/phpBB/$i.rpmsave %{_sysconfdir}/$i
144     fi
145 done
146
147 for i in config.php favicon.ico robots.txt; do
148     if [ -f /home/httpd/html/phpBB/$i.rpmsave ]; then
149             mv -f %{_sysconfdir}/$i{,.rpmnew}
150             mv -f /home/httpd/html/phpBB/$i.rpmsave %{_sysconfdir}/$i
151     fi
152 done
153
154 for i in config.php favicon.ico robots.txt; do
155     if [ -f /etc/%{name}/$i.rpmsave ]; then
156             mv -f %{_sysconfdir}/$i{,.rpmnew}
157             mv -f /etc/%{name}/$i.rpmsave %{_sysconfdir}/$i
158     fi
159 done
160
161 # nuke very-old config location (this mostly for Ra)
162 if [ -f /etc/httpd/httpd.conf ]; then
163         sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
164 fi
165
166 # migrate from httpd (apache2) config dir
167 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
168         cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
169         mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
170 fi
171
172 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
173 /usr/sbin/webapp register httpd %{_webapp}
174 %service httpd reload
175
176 %files
177 %defattr(644,root,root,755)
178 %dir %attr(750,root,http) %{_sysconfdir}
179 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
180 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
181 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
182 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/favicon.ico
183 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/robots.txt
184 %doc docs/*
185 %dir %{_appdir}
186 %{_appdir}/[!c]*.php
187 %{_appdir}/common.php
188 %{_appdir}/*.inc
189 %{_appdir}/admin
190 %{_appdir}/db
191 %{_appdir}/images
192 %{_appdir}/includes
193 %dir %{_appdir}/templates
194 %{_appdir}/templates/index.htm
195 %{_appdir}/templates/subSilver/*.*
196 %{_appdir}/templates/subSilver/admin/*.*
197 %{_appdir}/templates/subSilver/images/*.*
198 %dir %{_appdir}/language
199 %{_appdir}/language/index.htm
200 %lang(en) %{_appdir}/language/lang_english
201 %lang(en) %{_appdir}/templates/subSilver/images/lang_english
202 %lang(pl) %{_appdir}/language/lang_polish
203 %lang(pl) %{_appdir}/templates/subSilver/images/lang_polish
204 %lang(de) %{_appdir}/language/lang_german
205 %lang(de) %{_appdir}/templates/subSilver/images/lang_german
206 %lang(fr) %{_appdir}/language/lang_french
207 %lang(fr) %{_appdir}/templates/subSilver/images/lang_french
208 %attr(710,root,http) %dir /var/lib/%{name}
209 %attr(1770,root,http) %dir %{_avatardir}
210 %{_avatardir}/index.htm
211 %{_avatardir}/gallery
212 %attr(640,root,http) %config(noreplace) %{_appdir}/config.php
213 %attr(640,root,http) %config(noreplace) %{_appdir}/favicon.ico
214 %attr(640,root,http) %config(noreplace) %{_appdir}/robots.txt
215
216 %files install
217 %defattr(644,root,root,755)
218 %doc install/schemas/*.zip
219 %dir %{_appdir}/install
220 %{_appdir}/install/*.php
221 %dir %{_appdir}/install/schemas
222 %{_appdir}/install/schemas/*.sql
This page took 0.067674 seconds and 3 git commands to generate.