| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- ##
- ## punbb.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
- ##
- ## 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 version
- %define V_opkg 1.3s20100511
- %define V_snapshot 20100511
- %define V_release 1.3.4
- # package information
- Name: punbb
- Summary: Web Discussion Board
- URL: http://www.punbb.org/
- Vendor: Rickard Andersson et al.
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: EVAL
- Group: CMS
- License: GPL
- Version: %{V_opkg}
- Release: 20100511
- # list of sources
- Source0: http://download.openpkg.org/components/versioned/punbb/punbb-%{V_snapshot}.tar.gz
- Source1: punbb-apache.conf
- Source2: punbb-setup.sh
- Source3: rc.punbb
- Patch0: punbb.patch
- # build information
- BuildPreReq: OpenPKG, openpkg >= 20100101
- PreReq: OpenPKG, openpkg >= 20100101
- PreReq: apache
- PreReq: apache-php
- PreReq: apache-php::with_pgsql = yes
- PreReq: apache-php::with_zlib = yes
- PreReq: apache-php::with_xml = yes
- PreReq: apache-php::with_tokenizer = yes
- PreReq: apache-php::with_ctype = yes
- PreReq: apache-php::with_curl = yes
- PreReq: pcre
- PreReq: pcre::with_utf8 = yes
- PreReq: postgresql >= 8.2.4-20070906
- %description
- PunBB is a fast and lightweight PHP-powered discussion board.
- Its primary goals are to be faster, smaller and less graphically
- intensive as compared to other discussion boards. PunBB has fewer
- features than many other discussion boards, but is generally faster
- and outputs smaller, semantically correct XHTML-compliant pages.
- %track
- prog punbb:release = {
- version = %{V_release}
- url = http://punbb.informer.com/downloads.php
- regex = punbb-(__VER__)\.tar\.gz
- }
- prog punbb:snapshot = {
- version = %{V_snapshot}
- url = http://download.openpkg.org/components/versioned/punbb/
- regex = punbb-(__VER__)\.tar\.gz
- }
- %prep
- %setup -q -n punbb
- %patch -p0
- %build
- %install
- # create installation hierarchy
- rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/sbin \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
- $RPM_BUILD_ROOT%{l_prefix}/etc/punbb \
- $RPM_BUILD_ROOT%{l_prefix}/lib/punbb/runtime \
- $RPM_BUILD_ROOT%{l_prefix}/var/punbb/db \
- $RPM_BUILD_ROOT%{l_prefix}/var/punbb/log \
- $RPM_BUILD_ROOT%{l_prefix}/var/punbb/run
- # install main program files
- find . -name ".svn" -type d -print | xargs rm -rf
- find . -name "*.orig" -type f -print | xargs rm -f
- cp -rp * $RPM_BUILD_ROOT%{l_prefix}/lib/punbb/
- cp -p .htaccess.dist $RPM_BUILD_ROOT%{l_prefix}/lib/punbb/.htaccess
- # install setup script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE punbb-setup.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/punbb-setup
- # install run-command script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- -e 's;@l_path@;%{l_build_path};' \
- %{SOURCE rc.punbb} $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 punbb-apache.conf} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/punbb/
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/punbb/*' \
- '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/punbb/.htaccess' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/punbb' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/punbb/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/punbb/*/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/lib/punbb/*/*/*' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/punbb' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/punbb/*' \
- '%dir %attr(0700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/punbb/db'
- %files -f files
- %clean
- %post
- if [ $1 -eq 1 ]; then
- # display final hints on initial installation
- ( echo "To complete the PunBB installation:"
- echo "1. start the PostgreSQL RDBMS:"
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc postgresql start"
- echo "2. create the PunBB database:"
- echo " \$ $RPM_INSTALL_PREFIX/sbin/punbb-setup install"
- echo "3. start the PunBB Apache:"
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc punbb start"
- echo "4. install the PunBB database by accessing the"
- echo " following URL and proceeding through its menus:"
- echo " http://localhost:8080/punbb/admin/install.php"
- ) | %{l_rpmtool} msg -b -t notice
- elif [ $1 -eq 2 ]; then
- # after upgrade, restart service
- [ $1 -eq 2 ] || exit 0
- eval `%{l_rc} punbb status 2>/dev/null`
- [ ".$punbb_active" = .yes ] && %{l_rc} punbb restart
- fi
- exit 0
- %preun
- if [ $1 -eq 0 ]; then
- # before erase, stop service
- %{l_rc} punbb stop 2>/dev/null
- # destroy database
- $RPM_INSTALL_PREFIX/sbin/punbb-setup uninstall >/dev/null 2>&1 || true
- # remove run-time files
- rm -f $RPM_INSTALL_PREFIX/var/punbb/db/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/punbb/db/*/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/punbb/run/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/punbb/log/* >/dev/null 2>&1 || true
- # remove generated configuration file
- rm -f $RPM_INSTALL_PREFIX/lib/punbb/config.php >/dev/null 2>&1 || true
- fi
- exit 0
|