]> git.pld-linux.org Git - packages/phpBB.git/blob - phpBB.spec
ef0fd2c5a2b24f638b260113ca782c8ee0edaf27
[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.18
8 %define fver    20185
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:  dac447c941798993feff9f01ffbc8af5
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:  2d3c71574ea8d3ef0afbcf4aec63947a
30 URL:            http://www.phpbb.com/
31 Requires:       php-pcre
32 Requires:       webserver
33 BuildArch:      noarch
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %define         _phpdir         %{_datadir}/%{name}
37 %define         _confdir        %{_sysconfdir}/%{name}
38 %define         _avatardir      /var/lib/%{name}/avatars
39
40 %description
41 phpBB is a UBB-style dissussion board written in PHP backended by a
42 MySQL database. It includes features such as posting/replying/editing
43 messages, private messages, private forums, user and anonymous
44 posting, robust theming, user ranking by posts or by special, admin
45 definable, ranks, and much more.
46
47 %description -l pl
48 phpBB jest forum dyskusyjnym w stylu UBB napisanym w PHP z u¿yciem
49 bazy danych MySQL. Ma mo¿liwo¶ci takie jak: wysy³anie, odpisywanie,
50 edycja wiadomo¶ci, prywatne wiadomo¶ci, prywatne fora, wysy³anie jako
51 u¿ytkownik i anonimowe, bogaty wybór motywów, ranking u¿ytkowników
52 wed³ug ich wiadomo¶ci lub specjalne, definiowane przez administratora,
53 rankingi i wiele innych.
54
55 %package install
56 Summary:        A feature-rich PHP discussion board - installer
57 Summary(pl):    Forum dyskusyjne o du¿ych mo¿liwo¶ciach - instalator
58 Group:          Applications/Databases/Interfaces
59 Requires:       phpBB
60
61 %description install
62 Package needed for %{name} forum instalation.
63
64 %description install -l pl
65 Pakiet potrzebny do instalacji forum %{name}.
66
67 %prep
68 %if %{without php5}
69 %setup -q -T -b 9 -n phpBB2
70 %else
71 %setup -q -c
72 %endif
73
74 %install
75 rm -rf $RPM_BUILD_ROOT
76 install -d $RPM_BUILD_ROOT%{_phpdir}/{admin,db,images,includes,install/schemas,language,templates} \
77         $RPM_BUILD_ROOT{%{_confdir},/etc/httpd} \
78         $RPM_BUILD_ROOT%{_avatardir}
79
80 install *.{php,inc}     $RPM_BUILD_ROOT%{_phpdir}
81 install admin/*.php     $RPM_BUILD_ROOT%{_phpdir}/admin
82 install db/*.php        $RPM_BUILD_ROOT%{_phpdir}/db
83 install includes/*.php  $RPM_BUILD_ROOT%{_phpdir}/includes
84 install install/*.php   $RPM_BUILD_ROOT%{_phpdir}/install
85 install install/schemas/*.sql $RPM_BUILD_ROOT%{_phpdir}/install/schemas
86
87 cp -R images/*          $RPM_BUILD_ROOT%{_phpdir}/images
88 cp -R images/avatars/*  $RPM_BUILD_ROOT%{_avatardir}
89 cp -R language/*        $RPM_BUILD_ROOT%{_phpdir}/language
90 cp -R templates/*       $RPM_BUILD_ROOT%{_phpdir}/templates
91 rm -rf $RPM_BUILD_ROOT%{_phpdir}/images/avatars
92 ln -sf %{_avatardir} $RPM_BUILD_ROOT%{_phpdir}/images/avatars
93
94 install config.php $RPM_BUILD_ROOT%{_confdir}
95 install %{SOURCE8} $RPM_BUILD_ROOT%{_confdir}/favicon.ico
96 touch $RPM_BUILD_ROOT%{_confdir}/robots.txt
97 ln -sf %{_confdir}/config.php $RPM_BUILD_ROOT%{_phpdir}/config.php
98 ln -sf %{_confdir}/favicon.ico $RPM_BUILD_ROOT%{_phpdir}/favicon.ico
99 ln -sf %{_confdir}/robots.txt $RPM_BUILD_ROOT%{_phpdir}/robots.txt
100
101 tar zxf %{SOURCE1} -C $RPM_BUILD_ROOT%{_phpdir}/language/
102 tar zxf %{SOURCE2} -C $RPM_BUILD_ROOT%{_phpdir}/templates/
103
104 tar zxf %{SOURCE3} -C $RPM_BUILD_ROOT%{_phpdir}/language/
105 tar zxf %{SOURCE4} -C $RPM_BUILD_ROOT%{_phpdir}/templates/
106
107 tar zxf %{SOURCE5} -C $RPM_BUILD_ROOT%{_phpdir}/language/
108 tar zxf %{SOURCE6} -C $RPM_BUILD_ROOT%{_phpdir}/templates/
109
110 install %{SOURCE7} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
111
112 %clean
113 rm -rf $RPM_BUILD_ROOT
114
115 %post
116 if [ "$1" = "1" ]; then
117         if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
118                 echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
119         elif [ -d /etc/httpd/httpd.conf ]; then
120                 ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
121         fi
122         if [ -f /var/lock/subsys/httpd ]; then
123                 /usr/sbin/apachectl graceful 1>&2
124         fi
125 fi
126
127 %post install
128 echo "For instalation: http://<your.site.address>/<path>/install/install.php"
129 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
130 echo
131 echo "Remember to uninstall %{name}-install after initiation/upgrade of %{name}!!"
132
133 %preun
134 if [ "$1" = "0" ]; then
135         umask 027
136         if [ -d /etc/httpd/httpd.conf ]; then
137                 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
138         else
139                 grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
140                         /etc/httpd/httpd.conf.tmp
141                 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
142                 if [ -f /var/lock/subsys/httpd ]; then
143                         /usr/sbin/apachectl graceful 1>&2
144                 fi
145         fi
146 fi
147
148 %triggerpostun -- %{name} < %{version}
149 echo "You have to install %{name}-install package to prepare upgrade!!!"
150 echo "For upgrade: http://<your.site.address>/<path>/install/upgrade.php"
151
152 %triggerpostun -- %{name} <= 2.0.10-1
153 if [ -f /home/services/httpd/html/phpBB/config.php.rpmsave ]; then
154         mv -f /home/services/httpd/html/phpBB/config.php.rpmsave /etc/phpBB/config.php
155 else
156         if [ -f /home/httpd/html/phpBB/config.php.rpmsave ]; then
157                 mv -f /home/httpd/html/phpBB/config.php.rpmsave /etc/phpBB/config.php
158         fi
159 fi
160 for i in `grep -lr "/home/\(services/\)*httpd/html/phpBB" /etc/httpd/*`; do
161         cp $i $i.backup
162         %{__perl} -pi -e "s#/home/httpd/html/phpBB#%{_phpdir}#g" $i
163         %{__perl} -pi -e "s#/home/services/httpd/html/phpBB#%{_phpdir}#g" $i
164         echo "File changed by trigger: $i (backup: $i.backup)"
165 done
166 if [ -f /var/lock/subsys/httpd ]; then
167         /usr/sbin/apachectl graceful 1>&2
168 fi
169
170 %files
171 %defattr(644,root,root,755)
172 %dir %{_confdir}
173 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_confdir}/*
174 %config(noreplace) %verify(not md5 mtime size) /etc/httpd/%{name}.conf
175 %doc docs/*
176 %attr(755,root,http) %dir %{_phpdir}
177 %attr(640,root,http) %{_phpdir}/[!c]*.php
178 %attr(640,root,http) %{_phpdir}/common.php
179 %attr(640,root,http) %{_phpdir}/*.inc
180 %attr(750,root,http) %dir %{_phpdir}/admin
181 %attr(750,root,http) %dir %{_phpdir}/db
182 %attr(750,root,http) %dir %{_phpdir}/images
183 %attr(640,root,http) %{_phpdir}/images/*.gif
184 %attr(640,root,http) %{_phpdir}/images/index.htm
185 %attr(750,root,http) %dir %{_phpdir}/images/smiles
186 %attr(710,root,http) %dir /var/lib/%{name}
187 %attr(1770,root,http) %dir %{_avatardir}
188 %attr(750,root,http) %dir %{_phpdir}/includes
189 %attr(640,root,http) %config(noreplace) %{_phpdir}/config.php
190 %attr(640,root,http) %config(noreplace) %{_phpdir}/favicon.ico
191 %attr(640,root,http) %config(noreplace) %{_phpdir}/robots.txt
192 %{_phpdir}/admin/*
193 %{_phpdir}/db/*
194 %{_phpdir}/images/smiles/*
195 %{_phpdir}/images/avatars
196 %{_avatardir}/*
197 %{_phpdir}/includes/*
198 %{_phpdir}/templates/index.htm
199 %attr(750,root,http) %dir %{_phpdir}/templates
200 %attr(750,root,http) %dir %{_phpdir}/templates/subSilver
201 %attr(750,root,http) %dir %{_phpdir}/templates/subSilver/admin
202 %attr(640,root,http) %{_phpdir}/templates/subSilver/admin/*
203 %attr(640,root,http) %{_phpdir}/templates/subSilver/*.*
204 %attr(750,root,http) %dir %{_phpdir}/templates/subSilver/images
205 %attr(640,root,http) %{_phpdir}/templates/subSilver/images/*.*
206 %attr(750,root,http) %dir %{_phpdir}/language
207 %attr(640,root,http) %{_phpdir}/language/*.htm
208
209 %lang(en) %{_phpdir}/language/lang_english
210 %lang(en) %{_phpdir}/templates/subSilver/images/lang_english
211
212 %lang(pl) %{_phpdir}/language/lang_polish
213 %lang(pl) %{_phpdir}/templates/subSilver/images/lang_polish
214
215 %lang(de) %{_phpdir}/language/lang_german
216 %lang(de) %{_phpdir}/templates/subSilver/images/lang_german
217
218 %lang(fr) %{_phpdir}/language/lang_french
219 %lang(fr) %{_phpdir}/templates/subSilver/images/lang_french
220
221 %files install
222 %defattr(644,root,root,755)
223 %doc install/schemas/*.zip
224 %attr(750,root,http) %dir %{_phpdir}/install
225 %attr(640,root,http) %{_phpdir}/install/*.php
226 %attr(750,root,http) %dir %{_phpdir}/install/schemas
227 %attr(640,root,http) %{_phpdir}/install/schemas/*.sql
This page took 0.078382 seconds and 2 git commands to generate.