]> git.pld-linux.org Git - packages/phpBB.git/blob - phpBB.spec
- webapps in progress
[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:        0.7
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 install
119 echo "For instalation: http://<your.site.address>/<path>/install/install.php"
120 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
121 echo
122 echo "Remember to uninstall %{name}-install after initiation/upgrade of %{name}!!"
123
124 %triggerin -- apache1
125 %webapp_register apache %{_webapp}
126
127 %triggerun -- apache1
128 %webapp_unregister apache %{_webapp}
129
130 %triggerin -- apache >= 2.0.0
131 %webapp_register httpd %{_webapp}
132
133 %triggerun -- apache >= 2.0.0
134 %webapp_unregister httpd %{_webapp}
135
136
137 %triggerpostun -- %{name} <= 2.0.10-1
138 for i in `grep -lr "/home/\(services/\)*httpd/html/phpBB" /etc/httpd/*`; do
139         cp $i $i.backup
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)"
143 done
144
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
150 fi
151
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
155 fi
156
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
160 fi
161
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
165 fi
166
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
171 fi
172
173 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
174 /usr/sbin/webapp register httpd %{_webapp}
175 %service httpd reload
176
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"
180
181 %files
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
189 %doc docs/*
190 %dir %{_appdir}
191 %{_appdir}/[!c]*.php
192 %{_appdir}/common.php
193 %{_appdir}/*.inc
194 %{_appdir}/admin
195 %{_appdir}/db
196 %{_appdir}/images
197 %{_appdir}/includes
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
218
219 %files install
220 %defattr(644,root,root,755)
221 %doc install/schemas/*.zip
222 %{_appdir}/install/*.php
223 %{_appdir}/install/schemas/*.sql
This page took 0.102281 seconds and 3 git commands to generate.