rpms/viewmtn/EL-5 viewmtn.conf.httpd, NONE, 1.1 viewmtn.conf.py, NONE, 1.1 viewmtn.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Roland McGrath (roland) fedora-extras-commits at redhat.com
Sun Mar 23 20:40:19 UTC 2008


Author: roland

Update of /cvs/pkgs/rpms/viewmtn/EL-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13889

Modified Files:
	.cvsignore sources 
Added Files:
	viewmtn.conf.httpd viewmtn.conf.py viewmtn.spec 
Log Message:
New package viewmtn


--- NEW FILE viewmtn.conf.httpd ---
Alias /viewmtn		__python_sitelib__/viewmtn/__init__.py
Alias /viewmtn-static/	__datadir__/viewmtn/

<Directory __python_sitelib__/viewmtn>
  <Files __init__.py>
    SetHandler wsgi-script
    Options +ExecCGI
  </Files>
</Directory>


--- NEW FILE viewmtn.conf.py ---
#
# See __python_sitelib__/viewmtn/config.py,
# which imports this file.
# You can override any of the settings in that file here to customize.
#
# For viewmtn to work at all, it must have a definition for dbfile or dbfiles.
# These can be a simple constants configured here, or Python code here
# can set them dynamically.
#

import os.path
import glob

def _flatten_tuples(l):
    return reduce(tuple.__add__, l, ())

def _dbfile_tuple(file):
    dir = os.path.dirname(file)
    name = os.path.basename(dir)
    description = None
    try:
        description = open(os.path.join(dir, 'description')).read()
    except IOError:
        pass
    return (name, file, description)

def dbfiles():
    return _flatten_tuples(map(_dbfile_tuple, glob.glob('/srv/mtn/*/db.mtn')))


--- NEW FILE viewmtn.spec ---
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:           viewmtn
Version:        0.10
Release:        1%{?dist}

Summary:        Web interface for Monotone version control system
Group:          Development/Tools
License:        GPLv2+

URL:            http://grahame.angrygoats.net/moinmoin/ViewMTN
Source0:        http://grahame.angrygoats.net/source/%{name}/%{name}-%{version}.tgz

Source1:        viewmtn.conf.httpd
Source2:        viewmtn.conf.py

BuildArch:      noarch
BuildRequires:  python-devel
Requires:       python-cheetah
Requires(pre):  httpd
Requires:       monotone >= 0.35
Requires:       mod_wsgi
Requires:       gnome-icon-theme
Requires:       shared-mime-info
Requires:       highlight
Requires:       graphviz

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%define mydata  %{_datadir}/viewmtn
%define mypy    %{python_sitelib}/viewmtn
%define mygraph %{_localstatedir}/cache/viewmtn-graph

%description
ViewMTN is a web interface to the Monotone distributed version
control system.  It aims to provide a convenient and useful web
interface to Monotone.  If you've used interfaces to other version
control systems, ViewMTN will be immediately familiar.

%prep
%setup -q

cat > __init__.py <<\EOF
from viewmtn import assemble_urls, web
urls, fvars = assemble_urls()
application = web.wsgifunc(web.webpyfunc(urls, fvars))
EOF

%build
%{__sed} -e s,__datadir__,%{_datadir}, \
         -e s,__python_sitelib__,%{python_sitelib}, %{SOURCE1} > viewmtn.conf
%{__sed} -e s,__datadir__,%{_datadir}, \
         -e s,__python_sitelib__,%{python_sitelib}, %{SOURCE2} > viewmtn.conf.py
%{__sed} -e s,/usr/bin,%{_bindir},g \
         -e '/^dbfile/s,= .*$,'"= '%{mydb}',"\
         -e '/^dynamic_uri_path/s,= .*$,'"= '/viewmtn/'," \
         -e '/^static_uri_path/s,= .*$,'"= '/viewmtn-static/'," \
         -e '/^templates_directory/s,= .*$,'"= '%{mydata}/templates/'," \
         -e '/viewmtn-graph/s|: .*$|'": '%{mygraph}/',|" \
         -e '/^running_under_apache2/s/$/ # not relevant to mod_wsgi setup/' \
        config.py.example > config.py

cat >> config.py <<\EOF

# Get the local configuration linked from %{_sysconfdir}/.
from user_config import *
EOF


%install
rm -rf $RPM_BUILD_ROOT
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mypy}/fdo
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mypy}/web
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mydata}/templates
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mydata}/MochiKit
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mygraph}
%{__install} -Dp -m 0644 viewmtn.conf \
             $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/viewmtn.conf
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mypy} *.py
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mypy}/fdo fdo/*.py
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mypy}/web web/*.py
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mydata}/templates templates/*.html
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mydata} \
             static/*.gif static/*.css static/*.js
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mydata}/MochiKit \
             static/MochiKit/*.js

%{__install} -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
%{__install} -Dp -m 0644 viewmtn.conf.py \
	     $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.py

mypy_rel=`echo %{mypy} | sed 's,/[^/]*,../,g;s,/$,,'`
%{__ln_s} -nf $mypy_rel%{_sysconfdir}/%{name}/conf.py \
	  $RPM_BUILD_ROOT%{mypy}/user_config.py

# Pacify overeager rpmlint #! checks.
find $RPM_BUILD_ROOT%{mypy} -type f -name '*.py' -print0 |
xargs -0 sed -i '1{/^#!/d;}'


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc README AUTHORS LICENSE ChangeLog TODO INSTALL
%{mypy}
%{mydata}
%dir %attr(0755,apache,apache) %{mygraph}
%config(noreplace) %{_sysconfdir}/httpd/conf.d/viewmtn.conf
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/conf.py*


%changelog
* Sun Mar 23 2008 Roland McGrath <roland at redhat.com> - 0.10-1
- New package.  Thanks to Thomas Moschny for packaging assistance.


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/viewmtn/EL-5/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	23 Mar 2008 01:12:54 -0000	1.1
+++ .cvsignore	23 Mar 2008 20:39:41 -0000	1.2
@@ -0,0 +1 @@
+viewmtn-0.10.tgz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/viewmtn/EL-5/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	23 Mar 2008 01:12:54 -0000	1.1
+++ sources	23 Mar 2008 20:39:41 -0000	1.2
@@ -0,0 +1 @@
+1758f8b6340cca7d191b21fc25daf283  viewmtn-0.10.tgz




More information about the fedora-extras-commits mailing list