| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- ##
- ## modsurvey.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: modsurvey
- Summary: Website Survey Framework
- URL: http://www.modsurvey.org/
- Vendor: Joel Palmius
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: EVAL
- Group: Web
- License: GPL
- Version: 3.2.4
- Release: 20070622
- # list of sources
- Source0: http://www.modsurvey.org/download/tarballs/modsurvey-%{version}.tgz
- Source1: http://www.modsurvey.org/download/tarballs/modsurvey-docs-%{version}.tgz
- Patch0: modsurvey.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20040130
- PreReq: OpenPKG, openpkg >= 20040130
- BuildPreReq: perl, perl-www
- PreReq: perl, perl-www
- PreReq: apache, apache-perl
- AutoReq: no
- AutoReqProv: no
- %description
- mod_survey is a website survey framework for Apache. It is used
- as a mod_perl content-handler for "survey" files which contain
- questionnaires describe the survey in an XML-based tag notation.
- %track
- prog modsurvey = {
- version = %{version}
- url = http://www.modsurvey.org/download.php
- regex = modsurvey-(__VER__)\.tgz
- }
- %prep
- %setup -q -c
- %setup -q -D -T -a 1
- %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/modsurvey \
- $RPM_BUILD_ROOT%{l_prefix}/lib/modsurvey \
- $RPM_BUILD_ROOT%{l_prefix}/share/modsurvey \
- $RPM_BUILD_ROOT%{l_prefix}/var/modsurvey
- # perform standard installation procedure
- %{l_shtool} install -c %{l_value -s -a} \
- mod_survey/installer.pl mod_survey/installer
- ( cd mod_survey
- %{l_prefix}/bin/perl installer </dev/null
- ) || exit $?
- # post-adust installation paths
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/modsurvey/survey.conf \
- $RPM_BUILD_ROOT%{l_prefix}/etc/modsurvey/survey.conf
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/modsurvey/data \
- $RPM_BUILD_ROOT%{l_prefix}/var/modsurvey/data
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/modsurvey/webroot \
- $RPM_BUILD_ROOT%{l_prefix}/share/modsurvey/webroot
- # remove some installation files
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/modsurvey/README.txt
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/modsurvey/survey.conf.sample
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/modsurvey/docs
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/modsurvey/survey.conf' \
- '%doc %{l_prefix}/share/modsurvey/webroot/docs/*.pdf' \
- '%attr(700,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/modsurvey/data'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- if [ $1 -eq 1 ]; then
- # add hook to Apache configuration
- apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf"
- if [ -f $apacheconf ]; then
- ( echo "<IfModule mod_perl.c>"
- echo " Include $RPM_INSTALL_PREFIX/etc/modsurvey/survey.conf"
- echo "</IfModule>"
- ) | $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
- -a -i "$RPM_INSTALL_PREFIX:modsurvey" $apacheconf
- fi
- # display final hints
- ( echo "Your next step should be to run Apache with..."
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc apache start"
- echo "...and then access the mod_survey examples under"
- echo " http://127.0.0.1/mod_survey/"
- ) | %{l_rpmtool} msg -b -t notice
- fi
- exit 0
- %preun
- if [ $1 -eq 0 ]; then
- # remove hook from Apache configuration
- apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf"
- if [ -f $apacheconf ]; then
- $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
- -r -i "$RPM_INSTALL_PREFIX:modsurvey" $apacheconf
- fi
- # before erase, stop service and remove log files
- rm -rf $RPM_INSTALL_PREFIX/var/sympa/data/* >/dev/null 2>&1 || true
- fi
- exit 0
|