Browse Source

first cut for packaging SVN::Web

Ralf S. Engelschall 17 years ago
parent
commit
963c7b958a
4 changed files with 221 additions and 0 deletions
  1. 14 0
      svnweb/svnweb-apache.conf
  2. 26 0
      svnweb/svnweb.patch
  3. 112 0
      svnweb/svnweb.spec
  4. 69 0
      svnweb/svnweb.yaml

+ 14 - 0
svnweb/svnweb-apache.conf

@@ -0,0 +1,14 @@
+##
+##  svnweb-apache.conf -- Apache configuration for SVN::Web
+##
+
+<Directory @l_prefix@/etc/svnweb>
+    AllowOverride None
+    Options       None
+    SetHandler    perl-script
+    PerlHandler   SVN::Web
+</Directory>
+<Directory @l_prefix@/etc/svnweb/css>
+    SetHandler    default-handler
+</Directory>
+

+ 26 - 0
svnweb/svnweb.patch

@@ -0,0 +1,26 @@
+Index: Build.PL
+--- Build.PL.orig	2007-04-29 21:22:51 +0200
++++ Build.PL	2008-10-26 13:17:31 +0100
+@@ -147,16 +147,16 @@
+ 
+ my $skip_questions = 0;
+ 
+-GetOptions('with_mod_perl'           => sub { $requires{'Apache::Request'} = 0; },
+-	   'run_apache_tests'        => \$feature{run_apache_tests},
++GetOptions('with_mod_perl!'           => sub { $requires{'Apache::Request'} = 0; },
++	   'run_apache_tests!'        => \$feature{run_apache_tests},
+ 	   'apache_path=s'           => \$config_data{apache_path},
+ 	   'apxs_path=s'             => \$config_data{apxs_path},
+-	   'run_apache_cgi_tests'    => \$feature{run_apache_cgi_tests},
+-	   'run_mod_perl_tests'      => \$feature{run_mod_perl_tests},
++	   'run_apache_cgi_tests!'    => \$feature{run_apache_cgi_tests},
++	   'run_mod_perl_tests!'      => \$feature{run_mod_perl_tests},
+ 	   'mod_perl_path=s'         => \$config_data{mod_perl_path},
+-	   'run_svnweb-server_tests' => \$feature{'run_svnweb-server_tests'},
++	   'run_svnweb-server_tests!' => \$feature{'run_svnweb-server_tests'},
+ 	   'httpd_port=i'            => \$config_data{httpd_port},
+-	   'skip_questions'          => \$skip_questions,
++	   'skip_questions!'          => \$skip_questions,
+ 	  );
+ 
+ 

+ 112 - 0
svnweb/svnweb.spec

@@ -0,0 +1,112 @@
+##
+##  svnweb.spec -- OpenPKG RPM Package Specification
+##  Copyright (c) 2000-2008 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 information
+Name:         svnweb
+Summary:      Subversion Repository Viewer
+URL:          http://search.cpan.org/~nikc/SVN-Web/
+Vendor:       Chia-liang Kao, Nik Clayton et al.
+Packager:     OpenPKG Foundation e.V.
+Distribution: OpenPKG Community
+Class:        EVAL
+Group:        SCM
+License:      Artistic/GPL
+Version:      0.53
+Release:      20081026
+
+#   list of sources
+Source0:      http://www.cpan.org/authors/id/N/NI/NIKC/SVN-Web-%{version}.tar.gz
+Source1:      svnweb-apache.conf
+Source2:      svnweb.yaml
+Patch0:       svnweb.patch
+
+#   build information
+Prefix:       %{l_prefix}
+BuildRoot:    %{l_buildroot}
+BuildPreReq:  OpenPKG, openpkg >= 20040130, perl-openpkg
+PreReq:       OpenPKG, openpkg >= 20040130
+BuildPreReq:  perl, perl-parse, perl-text, perl-mail, perl-locale, perl-time, perl-util, perl-ds, perl-www, perl-template
+PreReq:       perl, perl-parse, perl-text, perl-mail, perl-locale, perl-time, perl-util, perl-ds, perl-www, perl-template
+BuildPreReq:  yaml, yaml::with_perl = yes
+PreReq:       yaml, yaml::with_perl = yes
+BuildPreReq:  subversion, subversion::with_perl = yes
+PreReq:       subversion, subversion::with_perl = yes
+PreReq:       apache, apache-perl
+AutoReq:      no
+AutoReqProv:  no
+
+%description
+    SVN::Web provides a full-featured and theme-able Web interface to
+    local or remote Subversion (SVN) repositories.
+
+%track
+    prog svnweb = {
+        version   = %{version}
+        url       = http://search.cpan.org/~nikc/SVN-Web/
+        regex     = SVN-Web-(__VER__)\.tar\.gz
+    }
+
+%prep
+    %setup -q -n SVN-Web-%{version}
+    chmod a+rw Build.PL
+    %patch -p0
+
+%build
+
+%install
+    rm -rf $RPM_BUILD_ROOT
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/svnweb \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d
+    %{l_shtool} install -c -m 644 %{l_value -s -a} \
+        %{SOURCE svnweb.yaml} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/svnweb/config.yaml
+    %{l_shtool} install -c -m 644 %{l_value -s -a} \
+        %{SOURCE svnweb-apache.conf} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/svnweb.conf
+    %{l_prefix}/bin/perl-openpkg prepare
+    %{l_prefix}/bin/perl-openpkg configure \
+        -A --norun_apache_tests \
+        -A --norun_apache_cgi_tests \
+        -A --norun_svnweb-server_tests \
+        -A --skip_questions
+    %{l_prefix}/bin/perl-openpkg configure build install
+    %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        `cat perl-openpkg-files` \
+        '%config %{l_prefix}/etc/svnweb/*' \
+        '%config %{l_prefix}/etc/apache/apache.d/*'
+
+%files -f files
+
+%clean
+    rm -rf $RPM_BUILD_ROOT
+
+%post
+    #   after upgrade, restart service
+    [ $1 -eq 2 ] || exit 0
+    eval `%{l_rc} apache status 2>/dev/null`
+    [ ".$apache_active" = .yes ] && %{l_rc} apache restart
+    exit 0
+

+ 69 - 0
svnweb/svnweb.yaml

@@ -0,0 +1,69 @@
+##
+##  config.yaml -- SVN::Web Configuration
+##
+
+version: 0.53
+
+actions:
+  blame:
+    class: SVN::Web::Blame
+    action_menu:
+      show:
+        - file 
+      link_text: (view blame)
+  browse:
+    class: SVN::Web::Browse
+    action_menu:
+      show:
+        - directory
+      link_text: (browse directory)
+  checkout:
+    class: SVN::Web::Checkout
+    action_menu:
+      show:
+        - file
+      link_text: (checkout)
+  diff:
+    class: SVN::Web::Diff
+  list:
+    class: SVN::Web::List
+  log:
+    class: SVN::Web::Log
+    action_menu:
+      show:
+        - file
+        - directory
+      link_text: (view revision log)
+  revision:
+    class: SVN::Web::Revision
+  rss:
+    class: SVN::Web::RSS
+    action_menu:
+      show:
+        - file
+        - directory
+      link_text: (rss)
+      head_only: 1
+      icon: /css/trac/feed-icon-16x16.png
+  view:
+    class: SVN::Web::View
+    action_menu:
+      show:
+        - file
+      link_text: (view file)
+
+languages:
+  de: Deutsch
+  en: English
+  fr: Fran&ccedil;ais
+  zh_cn: Chinese (Simplified)
+  zh_tw: Chinese (Traditional)
+
+default_language: en
+
+timedate_format: '%Y-%m-%d %H:%M:%S'
+timezone: 'UTC'
+
+repos:
+   default: '@l_prefix@/var/subversion/default'
+