Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee3af0760b | ||
|
|
5eb49fd0e8 | ||
|
|
d29070cba1 |
6 changed files with 157 additions and 1 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
viewmtn-0.10.tgz
|
||||
|
|
@ -1 +0,0 @@
|
|||
Orphaned for 6+ weeks
|
||||
1
sources
Normal file
1
sources
Normal file
|
|
@ -0,0 +1 @@
|
|||
1758f8b6340cca7d191b21fc25daf283 viewmtn-0.10.tgz
|
||||
9
viewmtn.conf.httpd
Normal file
9
viewmtn.conf.httpd
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
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>
|
||||
28
viewmtn.conf.py
Normal file
28
viewmtn.conf.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#
|
||||
# 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')))
|
||||
118
viewmtn.spec
Normal file
118
viewmtn.spec
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
%{!?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@redhat.com> - 0.10-1
|
||||
- New package. Thanks to Thomas Moschny for packaging assistance.
|
||||
Loading…
Add table
Add a link
Reference in a new issue