OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   05-Mar-2006 16:00:47
  Branch: HEAD                             Handle: 2006030515004600

  Added files:
    openpkg-src/modsurvey   modsurvey.patch modsurvey.spec

  Log:
    new package: modsurvey 3.2.3 (Website Survey Framework)

  Summary:
    Revision    Changes     Path
    1.1         +79 -0      openpkg-src/modsurvey/modsurvey.patch
    1.1         +146 -0     openpkg-src/modsurvey/modsurvey.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/modsurvey/modsurvey.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1 modsurvey.patch
  --- /dev/null 2006-03-05 16:00:46 +0100
  +++ modsurvey.patch   2006-03-05 16:00:47 +0100
  @@ -0,0 +1,79 @@
  +Index: installer.pl
  +--- installer.pl.orig        2006-01-23 13:05:47 +0100
  ++++ installer.pl     2006-03-05 15:35:07 +0100
  +@@ -184,12 +184,13 @@
  + $windows                   = 0;
  + $distrib                   = "unix/generic";
  + $source                    = "./";
  +-$destination               = "/usr/local/mod_survey/";
  ++$destination               = "@l_prefix@/lib/modsurvey/";
  ++$destination_prefix        = $ENV{'RPM_BUILD_ROOT'};
  + $creator                   = 1;
  + $conf{"_SURVEY_ALLOWAUTO"} = 1;
  + 
  +-$webuser  = "apache";
  +-$webgroup = "apache";
  ++$webuser  = "@l_nusr@";
  ++$webgroup = "@l_ngrp@";
  + 
  + sub isWindows()
  + {
  +@@ -513,7 +514,7 @@
  + print "  windows\n";
  + 
  + print "\nWhich platform are we installing for? [" . $distrib . "] ";
  +-$distrib = &getAnswer($distrib);
  ++# $distrib = &getAnswer($distrib);
  + print "Platform is: $distrib\n\n\n";
  + $nowpart++;
  + 
  +@@ -540,8 +541,8 @@
  + $destination = &getAnswer($destination);
  + print "Installing in $destination.\n\n\n";
  + 
  +-$conf{"_SURVEY_ROOT"}           = $destination . "webroot/";
  +-$conf{"_SURVEY_SYSBASE"}        = $destination . "data/";
  ++$conf{"_SURVEY_ROOT"}           = "@l_prefix@/share/modsurvey/webroot/";
  ++$conf{"_SURVEY_SYSBASE"}        = "@l_prefix@/var/modsurvey/data/";
  + $conf{"_SURVEY_LANG_DIRECTORY"} = $destination . "Lang/";
  + 
  + $nowpart++;
  +@@ -566,7 +567,7 @@
  + }
  + else
  + {
  +-    ($webuser, $webgroup) = &getUidGid();
  ++    # ($webuser, $webgroup) = &getUidGid();
  + 
  +     print "In order to correctly set file security for the files in the\n";
  +     print "Mod_Survey installation directory, we need to know determine 
under\n";
  +@@ -681,7 +682,7 @@
  + print "option.\n\n";
  + 
  + print "Do you want to set PerlSendHeader to \"On\"? [no] ";
  +-$yesno = lc(&getAnswer("no"));
  ++$yesno = lc(&getAnswer("yes"));
  + if (($yesno ne "no") && ($yesno ne "n"))
  + {
  +     print "PerlSendHeader On\n";
  +@@ -926,16 +927,14 @@
  + 
  + system "mkdir " . &osFix($destination);
  + 
  +-&makeDir($destination);
  +-&copyCoreFiles($source, $destination);
  ++&makeDir($destination_prefix.$destination);
  ++&copyCoreFiles($source, $destination_prefix.$destination);
  + 
  + if (!$windows)
  + {
  +     print "Chmodding/chowning files and directories... ";
  +-    system "chown 0:0 -R $destination";
  +-    system "chmod 755 -R $destination";
  +-    system "chown $webuser" . ":" . "$webgroup $destination" . "data";
  +-    system "chmod 700 $destination" . "data";
  ++    system "chmod -R 755 ${destination_prefix}${destination}";
  ++    system "chmod 700 ${destination_prefix}${destination}" . "data";
  +     print "ok\n";
  + }
  + 
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/modsurvey/modsurvey.spec
  ============================================================================
  $ cvs diff -u -r0 -r1.1 modsurvey.spec
  --- /dev/null 2006-03-05 16:00:47 +0100
  +++ modsurvey.spec    2006-03-05 16:00:47 +0100
  @@ -0,0 +1,146 @@
  +##
  +##  modsurvey.spec -- OpenPKG RPM Package Specification
  +##  Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  +##  Copyright (c) 2000-2006 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
  +Distribution: OpenPKG
  +Class:        EVAL
  +Group:        Web
  +License:      GPL
  +Version:      3.2.3
  +Release:      20060305
  +
  +#   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::with_mod_perl = yes
  +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
  +    %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} \
  +        installer.pl installer
  +    %{l_prefix}/bin/perl installer </dev/null
  +
  +    #   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/etc/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
  +
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to