| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- ##
- ## phpbb.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package information
- Name: phpbb
- Summary: Web Bulletin Board System (BBS)
- URL: http://www.phpbb.com/
- Vendor: phpBB Group
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: EVAL
- Group: CMS
- License: GPL
- Version: 3.0.RC1
- Release: 20070622
- # list of sources
- Source0: http://switch.dl.sourceforge.net/phpbb/phpBB-%{version}.tar.bz2
- Source2: phpbb-apache.conf
- Source3: rc.phpbb
- Patch0: phpbb.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823
- PreReq: OpenPKG, openpkg >= 20060823
- PreReq: apache
- PreReq: apache-php::with_gd = yes
- PreReq: apache-php::with_zlib = yes
- PreReq: apache-php::with_pcre = yes
- PreReq: apache-php::with_ftp = yes
- PreReq: apache-php::with_xml = yes
- PreReq: apache-php::with_sqlite = yes
- PreReq: pcre, pcre::with_utf8 = yes
- PreReq: sqlite
- PreReq: imagemagick
- AutoReq: no
- AutoReqProv: no
- %description
- phpBB is a high powered, fully scalable, and highly customizable
- Open Source Bulletin Board System (BBS). phpBB has a user-friendly
- interface, simple and straightforward administration panel, and
- helpful FAQ. Based on the powerful PHP server language and a backend
- RDBMS, phpBB is the ideal free community solution for all web sites.
- %track
- prog phpbb = {
- version = %{version}
- url = http://prdownloads.sourceforge.net/phpbb/
- regex = phpBB-(__VER__)\.tar\.(gz|bz2)
- }
- %prep
- %setup -q -n phpBB3
- %patch -p0
- %build
- %install
- # create installation hierarchy
- rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
- $RPM_BUILD_ROOT%{l_prefix}/etc/phpbb \
- $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime \
- $RPM_BUILD_ROOT%{l_prefix}/var/phpbb/db \
- $RPM_BUILD_ROOT%{l_prefix}/var/phpbb/log \
- $RPM_BUILD_ROOT%{l_prefix}/var/phpbb/run
- # install main program files
- %{l_shtool} subst %{l_value -s -a} \
- install/install_install.php
- find . -name ".#*" -print | xargs rm -f
- cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/
- # post-adjustment: move risky install area out of runtime area
- # (will be dynmically linked in again later)
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/install \
- $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/install
- # post-adjustment: move writable areas out of runtime area
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/cache \
- $RPM_BUILD_ROOT%{l_prefix}/var/phpbb/db/cache
- ln -s ../../../var/phpbb/db/cache \
- $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/cache
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/files \
- $RPM_BUILD_ROOT%{l_prefix}/var/phpbb/db/files
- ln -s ../../../var/phpbb/db/files \
- $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/files
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/store \
- $RPM_BUILD_ROOT%{l_prefix}/var/phpbb/db/store
- ln -s ../../../var/phpbb/db/store \
- $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/store
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/images/avatars/upload \
- $RPM_BUILD_ROOT%{l_prefix}/var/phpbb/db/upload
- ln -s ../../../../../var/phpbb/db/store \
- $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/images/avatars/upload
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/config.php \
- $RPM_BUILD_ROOT%{l_prefix}/etc/phpbb/config.php
- ln -s ../../../etc/phpbb/config.php \
- $RPM_BUILD_ROOT%{l_prefix}/lib/phpbb/runtime/config.php
- # install run-command script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- -e 's;@l_path@;%{l_build_path};' \
- %{SOURCE rc.phpbb} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # install Apache configuration
- l_hostname=`%{l_shtool} echo -e %h`
- l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- -e "s;@l_hostname@;$l_hostname;g" \
- -e "s;@l_domainname@;$l_domainname;g" \
- %{SOURCE phpbb-apache.conf} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/phpbb/
- # determine installation files
- mv files files.orig
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/phpbb/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/phpbb' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/phpbb/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/phpbb/*/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/phpbb/*/*/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/phpbb' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/phpbb/*'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- if [ $1 -eq 1 ]; then
- # display final hints on initial installation
- ln -s ../install $RPM_INSTALL_PREFIX/lib/phpbb/runtime/install
- ( echo "To complete the phpBB installation:"
- echo "1. start the phpBB Apache:"
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc phpbb start"
- echo "2. install the phpBB database by accessing the"
- echo " following URL and proceeding through its menus:"
- echo " http://localhost:8080/phpbb/install/"
- echo "3. cleanup after installation to enable run-time:"
- echo " \$ rm -f $RPM_INSTALL_PREFIX/lib/phpbb/runtime/install"
- ) | %{l_rpmtool} msg -b -t notice
- elif [ $1 -eq 2 ]; then
- # after upgrade, restart service
- [ $1 -eq 2 ] || exit 0
- eval `%{l_rc} phpbb status 2>/dev/null`
- [ ".$phpbb_active" = .yes ] && %{l_rc} phpbb restart
- fi
- exit 0
- %preun
- if [ $1 -eq 0 ]; then
- # before erase, stop service
- %{l_rc} phpbb stop 2>/dev/null
- # remove run-time files
- rm -f $RPM_INSTALL_PREFIX/var/phpbb/db/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/phpbb/db/*/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/phpbb/run/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/phpbb/log/* >/dev/null 2>&1 || true
- fi
- exit 0
|