Update version, introduce hgweb CGI configuration, correct document

Wed, 08 Feb 2012 20:15:40 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 08 Feb 2012 20:15:40 +0200
changeset 600
00bfe519c9d3
parent 599
9d79786fbc64
child 601
969c819f102b

Update version, introduce hgweb CGI configuration, correct document
installation paths, and properly install and mark configuration files.

mercurial/hgweb.cfg file | annotate | diff | comparison | revisions
mercurial/hgweb.cgi file | annotate | diff | comparison | revisions
mercurial/mercurial.spec file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mercurial/hgweb.cfg	Wed Feb 08 20:15:40 2012 +0200
     1.3 @@ -0,0 +1,7 @@
     1.4 +[web]
     1.5 +baseurl = /hg
     1.6 +
     1.7 +[paths]
     1.8 +repo1 = @l_prefix@/var/mercurial/repo1
     1.9 +repo2 = @l_prefix@/var/mercurial/repo2
    1.10 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/mercurial/hgweb.cgi	Wed Feb 08 20:15:40 2012 +0200
     2.3 @@ -0,0 +1,16 @@
     2.4 +#!@l_prefix@/bin/python
     2.5 +
     2.6 +import os
     2.7 +import sys
     2.8 +sys.path.insert(0, "@l_prefix@/lib/mercurial")
     2.9 +
    2.10 +from mercurial import demandimport
    2.11 +demandimport.enable()
    2.12 +
    2.13 +from mercurial.hgweb import hgweb, wsgicgi
    2.14 +if os.getenv('HGWEB_REPO_PATH', '') != '' and os.getenv('HGWEB_REPO_NAME', '') != '':
    2.15 +     application = hgweb(os.getenv('HGWEB_REPO_PATH'), os.getenv('HGWEB_REPO_NAME'))
    2.16 +else:
    2.17 +     application = hgweb('@l_prefix@/etc/mercurial/hgweb.cfg')
    2.18 +wsgicgi.launch(application)
    2.19 +
     3.1 --- a/mercurial/mercurial.spec	Tue Aug 28 18:52:25 2012 +0200
     3.2 +++ b/mercurial/mercurial.spec	Wed Feb 08 20:15:40 2012 +0200
     3.3 @@ -31,17 +31,21 @@
     3.4  Class:        EVAL
     3.5  Group:        SCM
     3.6  License:      GPL
     3.7 -Version:      1.6.2
     3.8 -Release:      20101018
     3.9 +Version:      2.1
    3.10 +Release:      20120208
    3.11  
    3.12  #   list of sources
    3.13  Source0:      http://mercurial.selenic.com/release/mercurial-%{version}.tar.gz
    3.14 +Source1:      hgweb.cgi
    3.15 +Source2:      hgweb.cfg
    3.16  
    3.17  #   build information
    3.18  Prefix:       %{l_prefix}
    3.19  BuildRoot:    %{l_buildroot}
    3.20 -BuildPreReq:  OpenPKG, openpkg >= 20100101, python, python::with_bzip2 = yes
    3.21 -PreReq:       OpenPKG, openpkg >= 20100101, python, python::with_bzip2 = yes
    3.22 +BuildPreReq:  OpenPKG, openpkg >= 20060823, python, python::with_bzip2 = yes
    3.23 +PreReq:       OpenPKG, openpkg >= 20060823, python, python::with_bzip2 = yes
    3.24 +AutoReq:      no
    3.25 +AutoReqProv:  no
    3.26  
    3.27  %description
    3.28      Mercurial is a fast, lightweight Source Control Management (SCM)
    3.29 @@ -52,7 +56,7 @@
    3.30      prog mercurial = {
    3.31          version   = %{version}
    3.32          url       = http://mercurial.selenic.com/release/
    3.33 -        regex     = mercurial-(__VER__)\.tar\.gz
    3.34 +        regex     = mercurial-(\d+\.\d+(\.\d+)?)\.tar\.gz
    3.35      }
    3.36  
    3.37  %prep
    3.38 @@ -69,7 +73,9 @@
    3.39  %install
    3.40      rm -rf $RPM_BUILD_ROOT
    3.41      %{l_shtool} mkdir -f -p -m 755 \
    3.42 +        $RPM_BUILD_ROOT%{l_prefix}/cgi \
    3.43          $RPM_BUILD_ROOT%{l_prefix}/bin \
    3.44 +        $RPM_BUILD_ROOT%{l_prefix}/etc/mercurial \
    3.45          $RPM_BUILD_ROOT%{l_prefix}/libexec/mercurial \
    3.46          $RPM_BUILD_ROOT%{l_prefix}/lib/mercurial \
    3.47          $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
    3.48 @@ -89,11 +95,17 @@
    3.49          echo "%{l_prefix}/bin/python %{l_prefix}/libexec/mercurial/hg \${1+\"\$@\"}"
    3.50      ) >$RPM_BUILD_ROOT%{l_prefix}/bin/hg
    3.51      chmod 755 $RPM_BUILD_ROOT%{l_prefix}/bin/hg
    3.52 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
    3.53 +        %{SOURCE hgweb.cgi} $RPM_BUILD_ROOT%{l_prefix}/cgi/
    3.54 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
    3.55 +        %{SOURCE hgweb.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/mercurial/
    3.56      %{l_shtool} install -c -m 644 \
    3.57 -       doc/*.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
    3.58 +        doc/*.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
    3.59      %{l_shtool} install -c -m 644 \
    3.60 -       doc/*.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
    3.61 -    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
    3.62 +        doc/*.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
    3.63 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
    3.64 +        %{l_files_std} \
    3.65 +        '%config %{l_prefix}/etc/mercurial/*'
    3.66  
    3.67  %files -f files
    3.68  

mercurial