initial commit

This commit is contained in:
Thomas NOËL 2014-06-17 11:27:12 +02:00
commit 12b1f99afc
84 changed files with 3189 additions and 0 deletions

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">python.ca</param>
<param name="protocol">http</param>
<param name="path">/scgi/releases/scgi-1.13.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,61 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Name: mod_scgi
Version: 1.13
Release: 6%{?dist}
Summary: Python implementation of the SCGI protocol
Group: Applications/Internet
License: CNRI
URL: http://python.ca/scgi/
Source0: http://python.ca/scgi/releases/scgi-%{version}.tar.gz
Source1: scgi.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: httpd-devel, python-devel, pcre-devel, gcc
Requires: httpd-mmn = %(cat %{_includedir}/httpd/.mmn || echo missing)
Conflicts: python-scgi
%description
The SCGI protocol is a replacement for the Common Gateway
Interface (CGI) protocol. It is a standard for applications
to interface with HTTP servers. It is similar to FastCGI
but is designed to be easier to implement.
%prep
%setup -q -n scgi-%{version}
%build
CFLAGS="%{optflags}" %{__python} setup.py build
%{_sbindir}/apxs -c apache2/mod_scgi.c
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --root $RPM_BUILD_ROOT
install -D -m 0755 apache2/.libs/mod_scgi.so $RPM_BUILD_ROOT/%{_libdir}/httpd/modules/mod_scgi.so
install -D -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/scgi.conf
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mv $RPM_BUILD_ROOT%{python_sitearch}/scgi/scgi_server.py $RPM_BUILD_ROOT%{_bindir}/scgi_server
mv $RPM_BUILD_ROOT%{python_sitearch}/scgi/quixote_handler.py $RPM_BUILD_ROOT%{_bindir}/quixote_handler
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc CHANGES.txt LICENSE.txt README.txt doc/* scgi/test_passfd.py
%config(noreplace) %{_sysconfdir}/httpd/conf.d/scgi.conf
%{python_sitearch}/*egg-info
%{python_sitearch}/scgi
%exclude %{python_sitearch}/scgi/test_passfd.py*
%{_bindir}/scgi_server
%{_bindir}/quixote_handler
%{_libdir}/httpd/modules/mod_scgi.so
%changelog
* Tue Feb 20 2013 Entr'ouvert <info@entrouvert.com> - 1.14-1
- Initial package

View File

@ -0,0 +1,8 @@
# (This actually better set up permanently with the command line
# "a2enmod scgi" but shown here for completeness)
LoadModule scgi_module modules/mod_scgi.so
# Set up a location to be served by an SCGI server process
# uncomment next line to serve SCGI process under /dynamic/
# SCGIMount /dynamic/ 127.0.0.1:4000

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">repos.entrouvert.org</param>
<param name="protocol">http</param>
<param name="path">/passerelle.git/snapshot/passerelle-9863723.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,55 @@
# CG14 /etc/passerelle/local_settings.py
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# traceback recipients if DEBUG=False
ADMINS = (
# ('root', 'root@localhost'),
('admin passerelle', 'passerelle-admin@calvados.fr'),
)
MANAGERS = ADMINS
# we're behind a pile of reverse-proxies...
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['*']
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'Europe/Paris'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'fr-fr'
#
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'passerelle',
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'passerelle.base',
'passerelle.datasources',
'passerelle.repost',
'solis',
'makorepost',
)
MEDIA_ROOT = '/var/lib/passerelle/media'
MEDIA_URL = '/passerelle/media/'
STATIC_ROOT = '/usr/share/passerelle/static'
STATIC_URL = '/passerelle/static/'

View File

@ -0,0 +1,128 @@
#!/bin/sh
#
# passerelle
#
# chkconfig: 2345 20 80
# description: passerelle provides an uniform access to multiple data sources and services.
### BEGIN INIT INFO
# Provides: passerelle
# Required-Start: $all
# Required-Stop: $all
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=passerelle
DESC="Passerelle (via gunicorn)"
DAEMON="/usr/bin/gunicorn"
SCRIPTNAME=/etc/init.d/$NAME
PIDFILE=/var/run/$NAME/$NAME.pid
LOGFILE=/var/log/$NAME/gunicorn.log
USER=passerelle
GROUP=passerelle
MANAGEPY=/usr/bin/${NAME}_manage.py
lockfile=/var/lock/subsys/$NAME
GUNICORN_OPTIONS="--bind 127.0.0.1:8484 --workers=3"
[ -e /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
start() {
[ -x $DAEMON ] || exit 5
# install new applications, if any
$SCRIPTNAME manage syncdb --noinput
echo $"Starting $NAME: "
daemon $DAEMON --daemon \
--pid $PIDFILE \
--user $USER --group $GROUP \
--error-logfile $LOGFILE \
$GUNICORN_OPTIONS \
passerelle.wsgi:application
retval=$?
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $NAME: "
killproc -p $PIDFILE $NAME
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p $PIDFILE $NAME
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
manage)
shift
if [ $(id -un) != $USER ]; then
sudo -H -u $USER $MANAGEPY "$@"
else
$MANAGEPY "$@"
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|manage}"
exit 2
esac
exit $?

View File

@ -0,0 +1,98 @@
%define tag 0.3.0
%define commit 9863723
# si possible, minor = nombre de commit depuis le tag (à la "git describe")
%define minor 0
# si minor == 0
#%define version %{tag}
# sinon :
%define version %{tag}.%{minor}.g%{commit}
%define _unpackaged_files_terminate_build 0
Name: passerelle
Version: %{tag}.%{minor}.g%{commit}
Release: 9%{?dist}
Summary: Uniform access to multiple data sources and services.
Group: Development/Languages
License: AGPL
URL: https://dev.entrouvert.org/projects/passerelle
Source0: passerelle-%{commit}.tar.gz
Source1: passerelle.init
Source2: local_settings.py
Source3: synchro-wcs-suivi.sh
Source4: synchro-wcs-suivi.conf
Source5: synchro-cron.sh
Source6: wcs-au-quotidien.cron.d
BuildArch: noarch
BuildRequires: python2-devel python-django python-setuptools-devel
Requires: python-django python-South python-django-jsonresponse python-django-model-utils python-gunicorn python-Mako python-raven
%description
Passerelle provides an uniform access to multiple data sources and services.
%prep
%setup -q -n passerelle-%{commit}
%pre
getent group passerelle >/dev/null || groupadd -r passerelle
getent passwd passerelle >/dev/null || useradd -r -g passerelle -s /sbin/nologin -c "passerelle software user" passerelle
install -d -m 0750 -o passerelle -g passerelle /var/run/passerelle
install -d -m 0750 -o passerelle -g passerelle /var/log/passerelle
install -d -m 0750 -o passerelle -g passerelle /var/lib/passerelle/media
exit 0
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
install -d -m 0755 $RPM_BUILD_ROOT/etc/passerelle
install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/passerelle/local_settings.py
install -D -p -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/passerelle/synchro-wcs-suivi.sh
install -D -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/passerelle/synchro-wcs-suivi.conf
install -D -p -m 755 %{SOURCE5} $RPM_BUILD_ROOT/etc/passerelle/synchro-cron.sh
install -D -p -m 644 %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/wcs-au-quotidien
ln -s /etc/passerelle/local_settings.py $RPM_BUILD_ROOT/%{python_sitelib}/passerelle/local_settings.py
install -D -p -m 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/passerelle
install -d -m 0755 $RPM_BUILD_ROOT/usr/share/passerelle/static
install -d -m 0755 $RPM_BUILD_ROOT/usr/share/passerelle/templates.mako
%post
/sbin/chkconfig --add passerelle
/usr/bin/passerelle_manage.py collectstatic --noinput
%preun
if [ $1 -eq 0 ]; then
/sbin/service passerelle stop &>/dev/null || :
/sbin/chkconfig --del passerelle
fi
%postun
if [ $1 -ge 1 ]; then
/sbin/service passerelle condrestart &>/dev/null || :
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%{python_sitelib}/passerelle
%{python_sitelib}/passerelle-*.egg-info
%{_sysconfdir}/rc.d/init.d/passerelle
/usr/share/passerelle/static
/usr/bin/passerelle_manage.py
/etc/passerelle/synchro-cron.sh
/etc/passerelle/synchro-wcs-suivi.sh
%config /etc/passerelle/local_settings.py
%config /etc/passerelle/synchro-wcs-suivi.conf
%config /etc/cron.d/wcs-au-quotidien
%doc LICENSE
%changelog
* Wed Apr 17 2013 Entr'ouvert <info@entrouvert.org> - 0-1
- Initial release

View File

@ -0,0 +1,5 @@
#!/bin/sh
cd /etc/passerelle/
./synchro-wcs-suivi.sh solis-suivi-visite
./synchro-wcs-suivi.sh solis-suivi-presentation-commission
./synchro-wcs-suivi.sh solis-suivi-decision-commission

View File

@ -0,0 +1,19 @@
#
# Configuration synchro wcs/passerelle
#
# production
#BASE_URL=https://teleservices.calvados.fr/passerelle/
#APIKEY=d24709cfde8b9e9b5743c43c3ab49f65
#VHOST=apl108
# recette
#BASE_URL=https://rec-teleservices.calvados.fr/passerelle/
#APIKEY=d24709cfde8b9e9b5743c43c3ab49f65
#VHOST=srl108
# developpement
#BASE_URL=http://passerelle.dev.au-quotidien.com/
#APIKEY=test
#VHOST=calvados.dev.entrouvert.org

View File

@ -0,0 +1,63 @@
#!/bin/bash
set -e
BASE_URL=https://teleservices.calvados.fr/passerelle/
APIKEY=d24709cfde8b9e9b5743c43c3ab49f65
VHOST=apl108
if [ -r /etc/passerelle/synchro-wcs-suivi.conf ]
then
. /etc/passerelle/synchro-wcs-suivi.conf
fi
CURL=/usr/bin/curl
WCSCTL_OPTS="--vhost=$VHOST --app-dir=/var/lib/wcs-au-quotidien"
mkdir -p /var/tmp/synchro-wcs-solis
cd /var/tmp/synchro-wcs-solis
###
### End of configuration
###
if [ ! -x $CURL ]
then
echo "cURL not found ($CURL)"
exit 1
fi
if [ $# -lt 1 ]
then
echo "syntax: $0 <triggername>"
exit 1
fi
TRIGGER=$1
URL="${BASE_URL}repost/${TRIGGER}/json?apikey=${APIKEY}"
output=${TRIGGER}.json
$CURL --max-time 20 --insecure -sS -o ${output}.raw "$URL" || exit
# JSON analyse
python << EOP > $output
import json
import sys
output = json.load(file('${output}.raw'))
data = output['data']
err = output['err']
if err == 0 and data is not None:
print json.dumps(data, indent=4)
else:
print >> sys.stderr, 'err:', err
print >> sys.stderr, 'err_class:', output.get('err_class')
print >> sys.stderr, 'err_desc:', output.get('err_desc')
sys.exit(1)
EOP
#echo "trigger $TRIGGER"
wcsctl trigger-jumps ${WCSCTL_OPTS} --trigger=${TRIGGER} ${output}

View File

@ -0,0 +1,22 @@
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=jean-damien.bouvier@calvados.fr
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
# production
10,30,50 * * * * wcs-au-quotidien /etc/passerelle/synchro-cron.sh
# test/recette
# 0,5,10,15,20,25,30,35,40,45,50,55 * * * * wcs-au-quotidien /etc/passerelle/synchro-cron.sh

View File

@ -0,0 +1,85 @@
#
# spec file for package python-Beaker
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-Beaker
Version: 1.6.4
Release: 0
Url: http://beaker.rtfd.org/
Summary: A Session and Caching library with WSGI Middleware
License: BSD-3-Clause
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/B/Beaker/Beaker-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-distribute
Provides: python-beaker = %{version}
Obsoletes: python-beaker < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
Beaker is a web session and general caching library that includes WSGI
middleware for use in web applications.
As a general caching library, Beaker can handle storing for various times
any Python object that can be pickled with optional back-ends on a
fine-grained basis.
Beaker was built largely on the code from MyghtyUtils, then refactored and
extended with database support.
Beaker includes Cache and Session WSGI middleware to ease integration with
WSGI capable frameworks, and is automatically used by Pylons.
Features:
* Fast, robust performance
* Multiple reader/single writer lock system to avoid duplicate simultaneous
cache creation
* Cache back-ends include dbm, file, memory, memcached, and database (Using
SQLAlchemy for multiple-db vendor support)
* Signed cookie's to prevent session hijacking/spoofing
* Cookie-only sessions to remove the need for a db or file backend (ideal
for clustered systems)
* Extensible Container object to support new back-ends
* Cache's can be divided into namespaces (to represent templates, objects,
etc.) then keyed for different copies
* Create functions for automatic call-backs to create new cache copies after
expiration
* Fine-grained toggling of back-ends, keys, and expiration per Cache object
%prep
%setup -q -n Beaker-%{version}
sed -i "1d" beaker/crypto/pbkdf2.py # Fix non-executable script
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%files
%defattr(-,root,root,-)
%doc CHANGELOG LICENSE
%{python_sitelib}/beaker/
%{python_sitelib}/Beaker-%{version}-py%{python_version}.egg-info
%changelog

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">https</param>
<param name="path">/packages/source/S/South/South-0.8.1.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,59 @@
#
# spec file for package python-South
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-South
Version: 0.8.1
Release: 0
Url: http://south.aeracode.org/
Summary: South: Migrations for Django
License: Apache-2.0
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/S/South/South-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-distribute
Requires: python-django
Provides: python-django-south = %{version}
Obsoletes: python-django-south < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
South is an intelligent database migrations library for the Django web framework. It is database-independent and DVCS-friendly, as well as a whole host of other features.
%prep
%setup -q -n South-%{version}
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%check
python setup.py test
%files
%defattr(-,root,root,-)
%doc README
%{python_sitelib}/*
%changelog

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">http</param>
<param name="path">/packages/source/d/django-jsonresponse/django-jsonresponse-0.9.0.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,36 @@
Name: python-django-jsonresponse
Version: 0.9.0
Release: 1%{?dist}
Summary: Simple wrap django views to render json
Group: Development/Languages
License: BSD
URL: http://pypi.python.org/pypi/django-jsonresponse
Source: http://pypi.python.org/packages/source/d/django-jsonresponse/django-jsonresponse-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools-devel
Requires: python-django
%description
Wrap view functions, allowng them render python native and custom objects to json
%prep
%setup -q -n django-jsonresponse-%{version}
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%files
%{python_sitelib}/jsonresponse
%{python_sitelib}/tests
%doc README.txt PKG-INFO
%{python_sitelib}/django_jsonresponse-%{version}-py?.?.egg-info
%changelog
* Wed Apr 17 2013 Entr'ouvert <info@entrouvert.org> - 0.5-2
- Initial release

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">http</param>
<param name="path">/packages/source/d/django-model-utils/django-model-utils-1.3.1.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,35 @@
Name: python-django-model-utils
Version: 1.3.1
Release: 1%{?dist}
Summary: Django model mixins and utilities
Group: Development/Languages
License: BSD
URL: http://pypi.python.org/pypi/django-model-utils
Source: http://pypi.python.org/packages/source/d/django-model-utils/django-model-utils-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools-devel
Requires: python-django
%description
Django model mixins and utilities
%prep
%setup -q -n django-model-utils-%{version}
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%files
%{python_sitelib}/model_utils
%doc AUTHORS.rst CHANGES.rst LICENSE.txt README.rst TODO.rst
%{python_sitelib}/django_model_utils-%{version}-py?.?.egg-info
%changelog
* Wed Apr 17 2013 Entr'ouvert <info@entrouvert.org> - 1.3.1-1
- Initial release

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">www.djangoproject.com</param>
<param name="protocol">https</param>
<param name="path">/m/releases/1.5/Django-1.5.5.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,61 @@
#
# spec file for package python-django
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-django
Version: 1.5.5
Release: 0
Summary: A high-level Python Web framework
License: BSD-3-Clause
Group: Development/Languages/Python
Url: http://www.djangoproject.com
Source: Django-%{version}.tar.gz
BuildRequires: python-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#Requires: gettext-tools
%if 0%{?suse_version}
%py_requires
%if 0%{?suse_version} > 1110
BuildArch: noarch
%endif
%endif
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%description
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
%prep
%setup -q -n Django-%{version}
# %patch1
# %patch2
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
install -D -m 0755 extras/django_bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/django_bash_completion.sh
ln -s %{_bindir}/django-admin.py %{buildroot}%{_bindir}/django-admin
%files
%defattr(-,root,root,-)
%doc AUTHORS LICENSE README.rst
%{_bindir}/django-admin*
%{python_sitelib}/*
%{_sysconfdir}/bash_completion.d/django_bash_completion.sh
%changelog

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">http</param>
<param name="path">/packages/source/g/gunicorn/gunicorn-0.14.6.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,37 @@
From 4b478e1a6651f33b36e30294c5a320388ed527f4 Mon Sep 17 00:00:00 2001
From: benoitc <bchesneau@gmail.com>
Date: Fri, 3 Aug 2012 06:27:26 +0200
Subject: [PATCH] fix request line check. close #390
We never had the possibility to check the limit since we were quitting
the loop before it.
---
gunicorn/http/message.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py
index e2c7500..d2361ca 100644
--- a/gunicorn/http/message.py
+++ b/gunicorn/http/message.py
@@ -165,13 +165,14 @@ def parse(self, unreader):
idx = data.find("\r\n")
if idx >= 0:
break
-
- if len(data) - 2 > self.limit_request_line > 0:
- raise LimitRequestLine(len(data), self.limit_request_line)
-
self.get_data(unreader, buf)
data = buf.getvalue()
+ # check if the request line is too large
+ if len(data) - 2 > self.limit_request_line and \
+ self.limit_request_line> 0 :
+ raise LimitRequestLine(len(data), self.limit_request_line)
+
self.parse_request_line(data[:idx])
buf = StringIO()
buf.write(data[idx+2:]) # Skip \r\n
--
1.7.10

View File

@ -0,0 +1,70 @@
%global upstream_name gunicorn
Name: python-gunicorn
Version: 0.14.6
Release: 1%{?dist}
Summary: Python WSGI application server
Group: System Environment/Daemons
License: MIT
URL: http://gunicorn.org/
Source0: http://pypi.python.org/packages/source/g/gunicorn/gunicorn-%{version}.tar.gz
# https://github.com/benoitc/gunicorn/issues/390
# https://github.com/benoitc/gunicorn/commit/4b478e1a6651f33b36e30294c5a320388ed527f4
Patch1: %{name}-0.14.6-LimitRequestLine.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-nose
%description
Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It uses the
pre-fork worker model, ported from Ruby's Unicorn project. It supports WSGI,
Django, and Paster applications.
%prep
%setup -q -n %{upstream_name}-%{version}
%patch1 -p1
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%check
%{__python} setup.py test
%files
%doc LICENSE NOTICE README.rst THANKS
%{python_sitelib}/%{upstream_name}*
%{_bindir}/%{upstream_name}
%{_bindir}/%{upstream_name}_django
%{_bindir}/%{upstream_name}_paster
%changelog
* Mon Aug 20 2012 Dan Callaghan <dcallagh@redhat.com> - 0.14-6-2
- fix for LimitRequestLine test failure (upstream issue #390)
* Wed Aug 01 2012 Dan Callaghan <dcallagh@redhat.com> - 0.14.6-1
- upstream bugfix release 0.14.6
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Mon Jun 25 2012 Dan Callaghan <dcallagh@redhat.com> - 0.14.5-1
- upstream bugfix release 0.14.5
* Thu Jun 07 2012 Dan Callaghan <dcallagh@redhat.com> - 0.14.3-1
- updated to upstream release 0.14.3
* Wed Feb 08 2012 Dan Callaghan <dcallagh@redhat.com> - 0.13.4-3
- renamed package to python-gunicorn, and other minor fixes
* Tue Jan 31 2012 Dan Callaghan <dcallagh@redhat.com> - 0.13.4-2
- patch for failing test (gunicorn issue #294)
* Mon Jan 30 2012 Dan Callaghan <dcallagh@redhat.com> - 0.13.4-1
- initial version

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">quixote.ca</param>
<param name="protocol">http</param>
<param name="path">/releases/Quixote-2.7.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,51 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%define srcname Quixote
Name: python-quixote
Version: 2.7
Release: 6%{?dist}
Summary: A highly Pythonic Web application framework
Group: Development/Libraries
License: CNRI
URL: http://quixote.ca/
Source0: http://quixote.python.ca/releases/%{srcname}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python-devel gcc
%description
Quixote is a framework for developing Web applications in Python. Quixote is
based on a simple, flexible design, making it possible to write applications
quickly and to benefit from the wide range of available third-party Python
modules. Deployed appropriately, Quixote has excellent performance that allows
you to put Quixote-based applications into large-scale production use.
%prep
%setup -q -n %{srcname}-%{version}
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc doc/ CHANGES.txt README.txt TODO LICENSE.txt
%dir %{python_sitearch}/quixote
%{python_sitearch}/quixote/*
%{python_sitearch}/Quixote-%{version}-py?.?.egg-info
%changelog
* Tue Feb 19 2013 Entr'ouvert <info@entrouvert.com> - 2.7-1
- Initial package

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">https</param>
<param name="path">/packages/source/r/raven/raven-3.4.1.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,36 @@
Name: python-raven
Version: 3.4.1
Release: 1%{?dist}
Summary: Raven is a client for Sentry (https://www.getsentry.com)
Group: Development/Languages
License: BSD
URL: http://pypi.python.org/pypi/raven
Source: https://pypi.python.org/packages/source/r/raven/raven-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools-devel
%description
Raven is a Python client for Sentry http://getsentry.com/. It provides full
out-of-the-box support for many of the popular frameworks, including Django
http://djangoproject.com, Flask http://flask.pocoo.org/ and Pylons
http://www.pylonsproject.org/. Raven also includes drop-in support for any
WSGI-compatible web application.
%prep
%setup -q -n raven-%{version}
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%files
%{python_sitelib}/raven
%{_bindir}/raven
%doc README.rst PKG-INFO
%{python_sitelib}/raven-%{version}-py?.?.egg-info

View File

@ -0,0 +1,7 @@
<services>
<service name="download_src_package">
<param name="host">download.fedoraproject.org</param>
<param name="protocol">http</param>
<param name="path">/pub/epel/6/SRPMS/python-vobject-0.8.1c-5.el6.src.rpm</param>
</service>
</services>

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">repos.entrouvert.org</param>
<param name="protocol">http</param>
<param name="path">/auquotidien.git/snapshot/auquotidien-c266de0.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,112 @@
#!/bin/sh
#
# w.c.s.
#
# chkconfig: 2345 20 80
# description: w.c.s. web form manager
### BEGIN INIT INFO
# Provides: wcs
# Required-Start: $local_fs $network $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: w.c.s. (Au quotidien)
# Description: w.c.s. Form Server (with Au Quotidien Extension)
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="w.c.s. (+Au Quotidien)"
NAME=wcs-au-quotidien
DAEMON=/usr/bin/wcsctl
PIDFILE=/var/run/wcs-au-quotidien/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
WCS_USER=wcs-au-quotidien
WCS_GROUP=wcs-au-quotidien
PYTHON_VERSION=`/usr/bin/env python -c \
"import sys; print '%d.%d' % (sys.version_info[0], sys.version_info[1])"`
OPTIONS="--extra /usr/lib/python$PYTHON_VERSION/site-packages/extra-wcs-au-quotidien/"
CONFIG_FILE=/etc/wcs/wcs-au-quotidien.cfg
lockfile=/var/lock/subsys/$NAME
[ -e /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
start() {
[ -x $DAEMON ] || exit 5
[ -f $CONFIG_FILE ] || exit 6
echo -n $"Starting $NAME: "
[ x$START_DAEMON != xyes ] && echo " disable by /etc/sysconfig/$NAME" && exit 6
daemon --user=$WCS_USER $DAEMON -f $CONFIG_FILE start --daemonize --pidfile=$PIDFILE $OPTIONS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $NAME: "
killproc -p $PIDFILE $NAME
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p $PIDFILE $NAME
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -0,0 +1,106 @@
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%define tag 1.11.1
%define commit c266de0
# si possible, minor = nombre de commit depuis le tag (à la "git describe")
%define minor 0
# si minor == 0
#%define version %{tag}
# sinon :
%define version %{tag}.%{minor}.g%{commit}
Name: wcs-au-quotidien
Version: %{version}
Release: 2
Summary: w.c.s. Form Server (Au Quotidien Extension)
Group: Development/Libraries
License: GPLv2
URL: http://www.entrouvert.com/fr/e-administration/au-quotidien/
Source0: http://repos.entrouvert.org/auquotidien.git/snapshot/auquotidien-%{commit}.tar.gz
Source1: wcs-au-quotidien.init
Source2: wcs-au-quotidien.sysconf
Source3: wcs-cg14-tool
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel python-quixote make gettext
Requires: python-vobject wcs
Requires(pre): shadow-utils
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/service, /sbin/chkconfig
Requires(postun): /sbin/service
%description
w.c.s. Form Server (Au Quotidien Extension)
%prep
%setup -q -n auquotidien-%{commit}
%pre
getent group wcs-au-quotidien >/dev/null || groupadd -r wcs-au-quotidien
getent passwd wcs-au-quotidien >/dev/null || \
useradd -r -g wcs-au-quotidien -d /var/lib/wcs-au-quotidien -s /sbin/nologin \
-c "w.c.s. au quotidien software user" wcs-au-quotidien
exit 0
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/var/lib/wcs-au-quotidien
install -d $RPM_BUILD_ROOT/etc/wcs
install -m 644 wcs-au-quotidien.cfg-sample $RPM_BUILD_ROOT/etc/wcs/wcs-au-quotidien.cfg
install -D -p -m 0755 %{SOURCE1} \
%{buildroot}%{_sysconfdir}/rc.d/init.d/wcs-au-quotidien
install -D -p -m 644 %{SOURCE2} \
$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wcs-au-quotidien
mkdir -p %{buildroot}/var/run/wcs-au-quotidien
for i in $RPM_BUILD_ROOT/usr/lib/python2.*; do \
mv $i/site-packages/extra \
$i/site-packages/extra-wcs-au-quotidien; done
cd po && make install prefix=$RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/usr/local/bin
install -D -p -m 0755 %{SOURCE3} $RPM_BUILD_ROOT/usr/local/bin/wcs-cg14-tool
%post
/sbin/chkconfig --add wcs-au-quotidien
%preun
if [ $1 -eq 0 ]; then
/sbin/service wcs-au-quotidien stop &>/dev/null || :
/sbin/chkconfig --del wcs-au-quotidien
fi
%postun
if [ $1 -ge 1 ]; then
/sbin/service wcs-au-quotidien condrestart &>/dev/null || :
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README
%{python_sitelib}/extra-wcs-au-quotidien*
%{python_sitelib}/wcs_au_quotidien-*.egg-info
%{_datadir}/wcs*
%{_datadir}/auquotidien*
/usr/share/locale*
/usr/local/bin/wcs*
%{_sysconfdir}/rc.d/init.d/wcs-au-quotidien
%config(noreplace) /etc/wcs/wcs-au-quotidien.cfg
%config(noreplace) %{_sysconfdir}/sysconfig/*
%defattr(-,wcs-au-quotidien,wcs-au-quotidien,-)
%dir /var/lib/wcs-au-quotidien
%dir /var/run/wcs-au-quotidien
%changelog
* Tue Feb 20 2013 Entr'ouvert <info@entrouvert.com> - 20130205+2e7cace-1
- Initial package

View File

@ -0,0 +1 @@
START_DAEMON=no

View File

@ -0,0 +1,64 @@
#!/bin/sh -e
APPDIR=/var/lib/wcs-au-quotidien
COMMAND=$1
VHOST=$2
FILENAME=$3
if [ -z "$VHOST" ]; then
echo "Usage: $0 export vhost"
echo " $0 import vhost filename.tgz"
exit 2
fi
APPDIR=$APPDIR/$VHOST
cd $APPDIR || exit 2
su wcs-au-quotidien -c /usr/bin/id >/dev/null || exit 2
OUTFILE=/tmp/$VHOST-datas-`date +%Y%m%d-%H%M%S`-$$.tgz
tar_c() {
cd $APPDIR
tar zcf $OUTFILE categories roles formdefs workflows models links themes
echo "$OUTFILE created"
}
tar_x() {
tar ztf "$FILENAME" > /dev/null || exit 2
cd $APPDIR
echo "extract $FILENAME in $APPDIR:"
tar zxvf "$FILENAME" || exit 2
chown -R wcs-au-quotidien categories roles formdefs workflows models links themes
echo "synchronize sql tables"
su wcs-au-quotidien -c /usr/bin/python << EOPY
import os
from wcs import publisher
from wcs.formdef import FormDef
APP_DIR = '/var/lib/wcs-au-quotidien'
VHOST = '$VHOST'
pub = publisher.WcsPublisher.create_publisher()
pub.app_dir = os.path.join(APP_DIR, VHOST)
for f in FormDef.select():
print f.name.strip(), ' ... ',
f.store()
print 'ok'
EOPY
chown -R wcs-au-quotidien formdefs # superstition ...
}
case "$1" in
export)
tar_c
;;
import)
tar_x
;;
*)
echo "Usage: $0 export vhost"
echo " $0 import vhost filename.tgz"
exit 2
esac

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">repos.entrouvert.org</param>
<param name="protocol">http</param>
<param name="path">/wcs.git/snapshot/wcs-d404c21.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,14 @@
diff --git a/wcs/forms/root.py b/wcs/forms/root.py
index e1215ea..346d33f 100644
--- a/wcs/forms/root.py
+++ b/wcs/forms/root.py
@@ -316,6 +316,9 @@ class FormPage(Directory):
session = get_session()
+ if get_request().get_method() == 'POST':
+ get_logger().debug('POST data: %r', get_request().form)
+
existing_formdata = None
if editing:
existing_formdata = editing.data

View File

@ -0,0 +1,109 @@
#!/bin/sh
#
# w.c.s.
#
# chkconfig: 2345 20 80
# description: w.c.s. web form manager
### BEGIN INIT INFO
# Provides: wcs
# Required-Start: $local_fs $network $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start w.c.s. web form manager
# Description: Start w.c.s. web form manager
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="w.c.s."
NAME=wcs
DAEMON=/usr/bin/wcsctl
PIDFILE=/var/run/wcs/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
WCS_USER=wcs
WCS_GROUP=wcs
CONFIG_FILE=/etc/wcs/wcs.cfg
lockfile=/var/lock/subsys/$NAME
[ -e /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
start() {
[ -x $DAEMON ] || exit 5
[ -f $CONFIG_FILE ] || exit 6
echo -n $"Starting $NAME: "
[ x$START_DAEMON != xyes ] && echo " disable by /etc/sysconfig/$NAME" && exit 6
daemon --user=$WCS_USER $DAEMON -f $CONFIG_FILE start --daemonize --pidfile=$PIDFILE $DAEMON_ARGS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $NAME: "
killproc -p $PIDFILE $NAME
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p $PIDFILE $NAME
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -0,0 +1,102 @@
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%define tag 1.11.0
%define commit d404c21
# si possible, minor = nombre de commit depuis le tag (à la "git describe")
%define minor 0
# si minor == 0
#%define version %{tag}
# sinon :
%define version %{tag}.%{minor}.g%{commit}
Name: wcs
Version: %{version}
Release: 9%{?dist}
Summary: web application to design and set up online forms
Group: Development/Libraries
License: GPLv2
URL: http://www.entrouvert.com/fr/e-administration/wcs/
Source0: http://repos.entrouvert.org/wcs.git/snapshot/wcs-%{commit}.tar.gz
Source1: wcs.init
Source2: wcs.sysconf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel python-quixote make gettext
Requires: mod_scgi python-quixote python-raven
Requires(pre): shadow-utils
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/service, /sbin/chkconfig
Requires(postun): /sbin/service
Patch1: %{name}-log-post-form.patch
%description
w.c.s. is a web application which allows to design and set up online forms.
It gives a user the ability to create web forms easily without requiring any
other skill than familiarity with web surfing
%prep
%setup -q -n wcs-%{commit}
%patch1 -p1
%pre
getent group wcs >/dev/null || groupadd -r wcs
getent passwd wcs >/dev/null || \
useradd -r -g wcs -d /var/lib/wcs -s /sbin/nologin \
-c "w.c.s software user" wcs
exit 0
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/var/lib/wcs
install -d $RPM_BUILD_ROOT/etc/wcs
install -m 644 wcs.cfg-sample $RPM_BUILD_ROOT/etc/wcs/wcs.cfg
install -D -p -m 0755 %{SOURCE1} \
%{buildroot}%{_sysconfdir}/rc.d/init.d/wcs
install -D -p -m 644 %{SOURCE2} \
$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wcs
mv %{buildroot}%{_bindir}/wcsctl.py %{buildroot}%{_bindir}/wcsctl
mkdir -p %{buildroot}/var/run/wcs
cd po && make install prefix=$RPM_BUILD_ROOT
%post
/sbin/chkconfig --add wcs
%preun
if [ $1 -eq 0 ]; then
/sbin/service wcs stop &>/dev/null || :
/sbin/chkconfig --del wcs
fi
%postun
if [ $1 -ge 1 ]; then
/sbin/service wcs condrestart &>/dev/null || :
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc doc/ COPYING NEWS README
%{python_sitelib}/wcs*
%{_bindir}/wcsctl
%{_datadir}/wcs*
/usr/share/locale*
%{_sysconfdir}/rc.d/init.d/wcs
%config(noreplace) /etc/wcs/wcs.cfg
%config(noreplace) %{_sysconfdir}/sysconfig/*
%defattr(-,wcs,wcs,-)
%dir /var/lib/wcs
%dir /var/run/wcs
%changelog

View File

@ -0,0 +1 @@
START_DAEMON=no

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">python.ca</param>
<param name="protocol">http</param>
<param name="path">/scgi/releases/scgi-1.13.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,61 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Name: mod_scgi
Version: 1.13
Release: 6%{?dist}
Summary: Python implementation of the SCGI protocol
Group: Applications/Internet
License: CNRI
URL: http://python.ca/scgi/
Source0: http://python.ca/scgi/releases/scgi-%{version}.tar.gz
Source1: scgi.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: httpd-devel, python-devel, pcre-devel, gcc
Requires: httpd-mmn = %(cat %{_includedir}/httpd/.mmn || echo missing)
Conflicts: python-scgi
%description
The SCGI protocol is a replacement for the Common Gateway
Interface (CGI) protocol. It is a standard for applications
to interface with HTTP servers. It is similar to FastCGI
but is designed to be easier to implement.
%prep
%setup -q -n scgi-%{version}
%build
CFLAGS="%{optflags}" %{__python} setup.py build
%{_sbindir}/apxs -c apache2/mod_scgi.c
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --root $RPM_BUILD_ROOT
install -D -m 0755 apache2/.libs/mod_scgi.so $RPM_BUILD_ROOT/%{_libdir}/httpd/modules/mod_scgi.so
install -D -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/scgi.conf
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mv $RPM_BUILD_ROOT%{python_sitearch}/scgi/scgi_server.py $RPM_BUILD_ROOT%{_bindir}/scgi_server
mv $RPM_BUILD_ROOT%{python_sitearch}/scgi/quixote_handler.py $RPM_BUILD_ROOT%{_bindir}/quixote_handler
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc CHANGES.txt LICENSE.txt README.txt doc/* scgi/test_passfd.py
%config(noreplace) %{_sysconfdir}/httpd/conf.d/scgi.conf
%{python_sitearch}/*egg-info
%{python_sitearch}/scgi
%exclude %{python_sitearch}/scgi/test_passfd.py*
%{_bindir}/scgi_server
%{_bindir}/quixote_handler
%{_libdir}/httpd/modules/mod_scgi.so
%changelog
* Tue Feb 20 2013 Entr'ouvert <info@entrouvert.com> - 1.14-1
- Initial package

View File

@ -0,0 +1,8 @@
# (This actually better set up permanently with the command line
# "a2enmod scgi" but shown here for completeness)
LoadModule scgi_module modules/mod_scgi.so
# Set up a location to be served by an SCGI server process
# uncomment next line to serve SCGI process under /dynamic/
# SCGIMount /dynamic/ 127.0.0.1:4000

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">repos.entrouvert.org</param>
<param name="protocol">http</param>
<param name="path">/passerelle.git/snapshot/passerelle-9863723.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,55 @@
# CG14 /etc/passerelle/local_settings.py
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# traceback recipients if DEBUG=False
ADMINS = (
# ('root', 'root@localhost'),
('admin passerelle', 'passerelle-admin@calvados.fr'),
)
MANAGERS = ADMINS
# we're behind a pile of reverse-proxies...
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['*']
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'Europe/Paris'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'fr-fr'
#
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'passerelle',
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'passerelle.base',
'passerelle.datasources',
'passerelle.repost',
'solis',
'makorepost',
)
MEDIA_ROOT = '/var/lib/passerelle/media'
MEDIA_URL = '/passerelle/media/'
STATIC_ROOT = '/usr/share/passerelle/static'
STATIC_URL = '/passerelle/static/'

View File

@ -0,0 +1,128 @@
#!/bin/sh
#
# passerelle
#
# chkconfig: 2345 20 80
# description: passerelle provides an uniform access to multiple data sources and services.
### BEGIN INIT INFO
# Provides: passerelle
# Required-Start: $all
# Required-Stop: $all
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=passerelle
DESC="Passerelle (via gunicorn)"
DAEMON="/usr/bin/gunicorn"
SCRIPTNAME=/etc/init.d/$NAME
PIDFILE=/var/run/$NAME/$NAME.pid
LOGFILE=/var/log/$NAME/gunicorn.log
USER=passerelle
GROUP=passerelle
MANAGEPY=/usr/bin/${NAME}_manage.py
lockfile=/var/lock/subsys/$NAME
GUNICORN_OPTIONS="--bind 127.0.0.1:8484 --workers=3"
[ -e /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
start() {
[ -x $DAEMON ] || exit 5
# install new applications, if any
$SCRIPTNAME manage syncdb --noinput
echo $"Starting $NAME: "
daemon $DAEMON --daemon \
--pid $PIDFILE \
--user $USER --group $GROUP \
--error-logfile $LOGFILE \
$GUNICORN_OPTIONS \
passerelle.wsgi:application
retval=$?
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $NAME: "
killproc -p $PIDFILE $NAME
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p $PIDFILE $NAME
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
manage)
shift
if [ $(id -un) != $USER ]; then
sudo -H -u $USER $MANAGEPY "$@"
else
$MANAGEPY "$@"
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|manage}"
exit 2
esac
exit $?

View File

@ -0,0 +1,98 @@
%define tag 0.3.0
%define commit 9863723
# si possible, minor = nombre de commit depuis le tag (à la "git describe")
%define minor 0
# si minor == 0
#%define version %{tag}
# sinon :
%define version %{tag}.%{minor}.g%{commit}
%define _unpackaged_files_terminate_build 0
Name: passerelle
Version: %{tag}.%{minor}.g%{commit}
Release: 9%{?dist}
Summary: Uniform access to multiple data sources and services.
Group: Development/Languages
License: AGPL
URL: https://dev.entrouvert.org/projects/passerelle
Source0: passerelle-%{commit}.tar.gz
Source1: passerelle.init
Source2: local_settings.py
Source3: synchro-wcs-suivi.sh
Source4: synchro-wcs-suivi.conf
Source5: synchro-cron.sh
Source6: wcs-au-quotidien.cron.d
BuildArch: noarch
BuildRequires: python2-devel python-django python-setuptools-devel
Requires: python-django python-South python-django-jsonresponse python-django-model-utils python-gunicorn python-Mako python-raven
%description
Passerelle provides an uniform access to multiple data sources and services.
%prep
%setup -q -n passerelle-%{commit}
%pre
getent group passerelle >/dev/null || groupadd -r passerelle
getent passwd passerelle >/dev/null || useradd -r -g passerelle -s /sbin/nologin -c "passerelle software user" passerelle
install -d -m 0750 -o passerelle -g passerelle /var/run/passerelle
install -d -m 0750 -o passerelle -g passerelle /var/log/passerelle
install -d -m 0750 -o passerelle -g passerelle /var/lib/passerelle/media
exit 0
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
install -d -m 0755 $RPM_BUILD_ROOT/etc/passerelle
install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/passerelle/local_settings.py
install -D -p -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/passerelle/synchro-wcs-suivi.sh
install -D -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/passerelle/synchro-wcs-suivi.conf
install -D -p -m 755 %{SOURCE5} $RPM_BUILD_ROOT/etc/passerelle/synchro-cron.sh
install -D -p -m 644 %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/wcs-au-quotidien
ln -s /etc/passerelle/local_settings.py $RPM_BUILD_ROOT/%{python_sitelib}/passerelle/local_settings.py
install -D -p -m 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/passerelle
install -d -m 0755 $RPM_BUILD_ROOT/usr/share/passerelle/static
install -d -m 0755 $RPM_BUILD_ROOT/usr/share/passerelle/templates.mako
%post
/sbin/chkconfig --add passerelle
/usr/bin/passerelle_manage.py collectstatic --noinput
%preun
if [ $1 -eq 0 ]; then
/sbin/service passerelle stop &>/dev/null || :
/sbin/chkconfig --del passerelle
fi
%postun
if [ $1 -ge 1 ]; then
/sbin/service passerelle condrestart &>/dev/null || :
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%{python_sitelib}/passerelle
%{python_sitelib}/passerelle-*.egg-info
%{_sysconfdir}/rc.d/init.d/passerelle
/usr/share/passerelle/static
/usr/bin/passerelle_manage.py
/etc/passerelle/synchro-cron.sh
/etc/passerelle/synchro-wcs-suivi.sh
%config /etc/passerelle/local_settings.py
%config /etc/passerelle/synchro-wcs-suivi.conf
%config /etc/cron.d/wcs-au-quotidien
%doc LICENSE
%changelog
* Wed Apr 17 2013 Entr'ouvert <info@entrouvert.org> - 0-1
- Initial release

View File

@ -0,0 +1,5 @@
#!/bin/sh
cd /etc/passerelle/
./synchro-wcs-suivi.sh solis-suivi-visite
./synchro-wcs-suivi.sh solis-suivi-presentation-commission
./synchro-wcs-suivi.sh solis-suivi-decision-commission

View File

@ -0,0 +1,19 @@
#
# Configuration synchro wcs/passerelle
#
# production
#BASE_URL=https://teleservices.calvados.fr/passerelle/
#APIKEY=d24709cfde8b9e9b5743c43c3ab49f65
#VHOST=apl108
# recette
#BASE_URL=https://rec-teleservices.calvados.fr/passerelle/
#APIKEY=d24709cfde8b9e9b5743c43c3ab49f65
#VHOST=srl108
# developpement
#BASE_URL=http://passerelle.dev.au-quotidien.com/
#APIKEY=test
#VHOST=calvados.dev.entrouvert.org

View File

@ -0,0 +1,63 @@
#!/bin/bash
set -e
BASE_URL=https://teleservices.calvados.fr/passerelle/
APIKEY=d24709cfde8b9e9b5743c43c3ab49f65
VHOST=apl108
if [ -r /etc/passerelle/synchro-wcs-suivi.conf ]
then
. /etc/passerelle/synchro-wcs-suivi.conf
fi
CURL=/usr/bin/curl
WCSCTL_OPTS="--vhost=$VHOST --app-dir=/var/lib/wcs-au-quotidien"
mkdir -p /var/tmp/synchro-wcs-solis
cd /var/tmp/synchro-wcs-solis
###
### End of configuration
###
if [ ! -x $CURL ]
then
echo "cURL not found ($CURL)"
exit 1
fi
if [ $# -lt 1 ]
then
echo "syntax: $0 <triggername>"
exit 1
fi
TRIGGER=$1
URL="${BASE_URL}repost/${TRIGGER}/json?apikey=${APIKEY}"
output=${TRIGGER}.json
$CURL --max-time 20 --insecure -sS -o ${output}.raw "$URL" || exit
# JSON analyse
python << EOP > $output
import json
import sys
output = json.load(file('${output}.raw'))
data = output['data']
err = output['err']
if err == 0 and data is not None:
print json.dumps(data, indent=4)
else:
print >> sys.stderr, 'err:', err
print >> sys.stderr, 'err_class:', output.get('err_class')
print >> sys.stderr, 'err_desc:', output.get('err_desc')
sys.exit(1)
EOP
#echo "trigger $TRIGGER"
wcsctl trigger-jumps ${WCSCTL_OPTS} --trigger=${TRIGGER} ${output}

View File

@ -0,0 +1,22 @@
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=jean-damien.bouvier@calvados.fr
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
# production
10,30,50 * * * * wcs-au-quotidien /etc/passerelle/synchro-cron.sh
# test/recette
# 0,5,10,15,20,25,30,35,40,45,50,55 * * * * wcs-au-quotidien /etc/passerelle/synchro-cron.sh

Binary file not shown.

View File

@ -0,0 +1,85 @@
#
# spec file for package python-Beaker
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-Beaker
Version: 1.6.4
Release: 0
Url: http://beaker.rtfd.org/
Summary: A Session and Caching library with WSGI Middleware
License: BSD-3-Clause
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/B/Beaker/Beaker-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-distribute
Provides: python-beaker = %{version}
Obsoletes: python-beaker < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
Beaker is a web session and general caching library that includes WSGI
middleware for use in web applications.
As a general caching library, Beaker can handle storing for various times
any Python object that can be pickled with optional back-ends on a
fine-grained basis.
Beaker was built largely on the code from MyghtyUtils, then refactored and
extended with database support.
Beaker includes Cache and Session WSGI middleware to ease integration with
WSGI capable frameworks, and is automatically used by Pylons.
Features:
* Fast, robust performance
* Multiple reader/single writer lock system to avoid duplicate simultaneous
cache creation
* Cache back-ends include dbm, file, memory, memcached, and database (Using
SQLAlchemy for multiple-db vendor support)
* Signed cookie's to prevent session hijacking/spoofing
* Cookie-only sessions to remove the need for a db or file backend (ideal
for clustered systems)
* Extensible Container object to support new back-ends
* Cache's can be divided into namespaces (to represent templates, objects,
etc.) then keyed for different copies
* Create functions for automatic call-backs to create new cache copies after
expiration
* Fine-grained toggling of back-ends, keys, and expiration per Cache object
%prep
%setup -q -n Beaker-%{version}
sed -i "1d" beaker/crypto/pbkdf2.py # Fix non-executable script
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%files
%defattr(-,root,root,-)
%doc CHANGELOG LICENSE
%{python_sitelib}/beaker/
%{python_sitelib}/Beaker-%{version}-py%{python_version}.egg-info
%changelog

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">http</param>
<param name="path">/packages/source/M/MarkupSafe/MarkupSafe-0.15.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,59 @@
#
# spec file for package python-MarkupSafe
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-MarkupSafe
Version: 0.15
Release: 1
Url: http://dev.pocoo.org/
Summary: Implements a XML/HTML/XHTML Markup safe string for Python
License: BSD-3-Clause
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-distribute
%if 0%{?suse_version}
%py_requires
%endif
Provides: python-markupsafe = %{version}
Obsoletes: python-markupsafe < %{version}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%description
Implements a unicode subclass that supports HTML strings. This can be used to
safely encode strings for dynamically generated web pages.
%prep
%setup -q -n MarkupSafe-%{version}
%build
CFLAGS="%{optflags}" python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%check
python setup.py test
%files
%defattr(-,root,root,-)
%doc AUTHORS LICENSE README.rst
%{python_sitearch}/markupsafe/
%{python_sitearch}/MarkupSafe-%{version}-py%{python_version}.egg-info
%changelog

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">https</param>
<param name="path">/packages/source/S/South/South-0.8.1.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,59 @@
#
# spec file for package python-South
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-South
Version: 0.8.1
Release: 0
Url: http://south.aeracode.org/
Summary: South: Migrations for Django
License: Apache-2.0
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/S/South/South-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-distribute
Requires: python-django
Provides: python-django-south = %{version}
Obsoletes: python-django-south < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
South is an intelligent database migrations library for the Django web framework. It is database-independent and DVCS-friendly, as well as a whole host of other features.
%prep
%setup -q -n South-%{version}
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%check
python setup.py test
%files
%defattr(-,root,root,-)
%doc README
%{python_sitelib}/*
%changelog

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">http</param>
<param name="path">/packages/source/d/django-jsonresponse/django-jsonresponse-0.9.0.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,36 @@
Name: python-django-jsonresponse
Version: 0.9.0
Release: 1%{?dist}
Summary: Simple wrap django views to render json
Group: Development/Languages
License: BSD
URL: http://pypi.python.org/pypi/django-jsonresponse
Source: http://pypi.python.org/packages/source/d/django-jsonresponse/django-jsonresponse-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools-devel
Requires: python-django
%description
Wrap view functions, allowng them render python native and custom objects to json
%prep
%setup -q -n django-jsonresponse-%{version}
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%files
%{python_sitelib}/jsonresponse
%{python_sitelib}/tests
%doc README.txt PKG-INFO
%{python_sitelib}/django_jsonresponse-%{version}-py?.?.egg-info
%changelog
* Wed Apr 17 2013 Entr'ouvert <info@entrouvert.org> - 0.5-2
- Initial release

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">http</param>
<param name="path">/packages/source/d/django-model-utils/django-model-utils-1.3.1.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,35 @@
Name: python-django-model-utils
Version: 1.3.1
Release: 1%{?dist}
Summary: Django model mixins and utilities
Group: Development/Languages
License: BSD
URL: http://pypi.python.org/pypi/django-model-utils
Source: http://pypi.python.org/packages/source/d/django-model-utils/django-model-utils-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools-devel
Requires: python-django
%description
Django model mixins and utilities
%prep
%setup -q -n django-model-utils-%{version}
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%files
%{python_sitelib}/model_utils
%doc AUTHORS.rst CHANGES.rst LICENSE.txt README.rst TODO.rst
%{python_sitelib}/django_model_utils-%{version}-py?.?.egg-info
%changelog
* Wed Apr 17 2013 Entr'ouvert <info@entrouvert.org> - 1.3.1-1
- Initial release

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">www.djangoproject.com</param>
<param name="protocol">https</param>
<param name="path">/m/releases/1.5/Django-1.5.5.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,61 @@
#
# spec file for package python-django
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-django
Version: 1.5.5
Release: 0
Summary: A high-level Python Web framework
License: BSD-3-Clause
Group: Development/Languages/Python
Url: http://www.djangoproject.com
Source: Django-%{version}.tar.gz
BuildRequires: python-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#Requires: gettext-tools
%if 0%{?suse_version}
%py_requires
%if 0%{?suse_version} > 1110
BuildArch: noarch
%endif
%endif
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%description
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
%prep
%setup -q -n Django-%{version}
# %patch1
# %patch2
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
install -D -m 0755 extras/django_bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/django_bash_completion.sh
ln -s %{_bindir}/django-admin.py %{buildroot}%{_bindir}/django-admin
%files
%defattr(-,root,root,-)
%doc AUTHORS LICENSE README.rst
%{_bindir}/django-admin*
%{python_sitelib}/*
%{_sysconfdir}/bash_completion.d/django_bash_completion.sh
%changelog

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">http</param>
<param name="path">/packages/source/g/gunicorn/gunicorn-0.14.6.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,37 @@
From 4b478e1a6651f33b36e30294c5a320388ed527f4 Mon Sep 17 00:00:00 2001
From: benoitc <bchesneau@gmail.com>
Date: Fri, 3 Aug 2012 06:27:26 +0200
Subject: [PATCH] fix request line check. close #390
We never had the possibility to check the limit since we were quitting
the loop before it.
---
gunicorn/http/message.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py
index e2c7500..d2361ca 100644
--- a/gunicorn/http/message.py
+++ b/gunicorn/http/message.py
@@ -165,13 +165,14 @@ def parse(self, unreader):
idx = data.find("\r\n")
if idx >= 0:
break
-
- if len(data) - 2 > self.limit_request_line > 0:
- raise LimitRequestLine(len(data), self.limit_request_line)
-
self.get_data(unreader, buf)
data = buf.getvalue()
+ # check if the request line is too large
+ if len(data) - 2 > self.limit_request_line and \
+ self.limit_request_line> 0 :
+ raise LimitRequestLine(len(data), self.limit_request_line)
+
self.parse_request_line(data[:idx])
buf = StringIO()
buf.write(data[idx+2:]) # Skip \r\n
--
1.7.10

View File

@ -0,0 +1,70 @@
%global upstream_name gunicorn
Name: python-gunicorn
Version: 0.14.6
Release: 1%{?dist}
Summary: Python WSGI application server
Group: System Environment/Daemons
License: MIT
URL: http://gunicorn.org/
Source0: http://pypi.python.org/packages/source/g/gunicorn/gunicorn-%{version}.tar.gz
# https://github.com/benoitc/gunicorn/issues/390
# https://github.com/benoitc/gunicorn/commit/4b478e1a6651f33b36e30294c5a320388ed527f4
Patch1: %{name}-0.14.6-LimitRequestLine.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-nose
%description
Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It uses the
pre-fork worker model, ported from Ruby's Unicorn project. It supports WSGI,
Django, and Paster applications.
%prep
%setup -q -n %{upstream_name}-%{version}
%patch1 -p1
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%check
%{__python} setup.py test
%files
%doc LICENSE NOTICE README.rst THANKS
%{python_sitelib}/%{upstream_name}*
%{_bindir}/%{upstream_name}
%{_bindir}/%{upstream_name}_django
%{_bindir}/%{upstream_name}_paster
%changelog
* Mon Aug 20 2012 Dan Callaghan <dcallagh@redhat.com> - 0.14-6-2
- fix for LimitRequestLine test failure (upstream issue #390)
* Wed Aug 01 2012 Dan Callaghan <dcallagh@redhat.com> - 0.14.6-1
- upstream bugfix release 0.14.6
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Mon Jun 25 2012 Dan Callaghan <dcallagh@redhat.com> - 0.14.5-1
- upstream bugfix release 0.14.5
* Thu Jun 07 2012 Dan Callaghan <dcallagh@redhat.com> - 0.14.3-1
- updated to upstream release 0.14.3
* Wed Feb 08 2012 Dan Callaghan <dcallagh@redhat.com> - 0.13.4-3
- renamed package to python-gunicorn, and other minor fixes
* Tue Jan 31 2012 Dan Callaghan <dcallagh@redhat.com> - 0.13.4-2
- patch for failing test (gunicorn issue #294)
* Mon Jan 30 2012 Dan Callaghan <dcallagh@redhat.com> - 0.13.4-1
- initial version

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">https</param>
<param name="path">/packages/source/M/Mako/Mako-0.7.3.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,71 @@
#
# spec file for package python-Mako
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-Mako
Version: 0.7.3
Release: 0
Url: http://www.makotemplates.org/
Summary: A super-fast Python templating language
License: MIT
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/M/Mako/Mako-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-MarkupSafe
BuildRequires: python-devel
BuildRequires: python-distribute
# BuildRequires: python-nose
Requires: python-Beaker >= 1.1
Requires: python-MarkupSafe
Provides: python-mako = %{version}
Obsoletes: python-mako < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
Mako is a template library written in Python. It provides a familiar, non-XML
syntax which compiles into Python modules for maximum performance. Mako's
syntax and API borrows from the best ideas of many others, including Django
templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded
Python (i.e. Python Server Page) language, which refines the familiar ideas
of componentized layout and inheritance to produce one of the most
straightforward and flexible models available, while also maintaining close
ties to Python calling and scoping semantics.
%prep
%setup -q -n Mako-%{version}
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%check
# python setup.py test
%files
%defattr(-,root,root,-)
%doc CHANGES LICENSE README.rst examples
%{_bindir}/mako-render
%{python_sitelib}/mako/
%{python_sitelib}/Mako-%{version}-py%{python_version}.egg-info
%changelog

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">quixote.ca</param>
<param name="protocol">http</param>
<param name="path">/releases/Quixote-2.7.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,51 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%define srcname Quixote
Name: python-quixote
Version: 2.7
Release: 6%{?dist}
Summary: A highly Pythonic Web application framework
Group: Development/Libraries
License: CNRI
URL: http://quixote.ca/
Source0: http://quixote.python.ca/releases/%{srcname}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python-devel gcc
%description
Quixote is a framework for developing Web applications in Python. Quixote is
based on a simple, flexible design, making it possible to write applications
quickly and to benefit from the wide range of available third-party Python
modules. Deployed appropriately, Quixote has excellent performance that allows
you to put Quixote-based applications into large-scale production use.
%prep
%setup -q -n %{srcname}-%{version}
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc doc/ CHANGES.txt README.txt TODO LICENSE.txt
%dir %{python_sitearch}/quixote
%{python_sitearch}/quixote/*
%{python_sitearch}/Quixote-%{version}-py?.?.egg-info
%changelog
* Tue Feb 19 2013 Entr'ouvert <info@entrouvert.com> - 2.7-1
- Initial package

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">pypi.python.org</param>
<param name="protocol">https</param>
<param name="path">/packages/source/r/raven/raven-3.4.1.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,36 @@
Name: python-raven
Version: 3.4.1
Release: 1%{?dist}
Summary: Raven is a client for Sentry (https://www.getsentry.com)
Group: Development/Languages
License: BSD
URL: http://pypi.python.org/pypi/raven
Source: https://pypi.python.org/packages/source/r/raven/raven-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools-devel
%description
Raven is a Python client for Sentry http://getsentry.com/. It provides full
out-of-the-box support for many of the popular frameworks, including Django
http://djangoproject.com, Flask http://flask.pocoo.org/ and Pylons
http://www.pylonsproject.org/. Raven also includes drop-in support for any
WSGI-compatible web application.
%prep
%setup -q -n raven-%{version}
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%files
%{python_sitelib}/raven
%{_bindir}/raven
%doc README.rst PKG-INFO
%{python_sitelib}/raven-%{version}-py?.?.egg-info

View File

@ -0,0 +1,7 @@
<services>
<service name="download_src_package">
<param name="host">download.fedoraproject.org</param>
<param name="protocol">http</param>
<param name="path">/pub/epel/6/SRPMS/python-vobject-0.8.1c-5.el6.src.rpm</param>
</service>
</services>

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">repos.entrouvert.org</param>
<param name="protocol">http</param>
<param name="path">/auquotidien.git/snapshot/auquotidien-53f5c62.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,112 @@
#!/bin/sh
#
# w.c.s.
#
# chkconfig: 2345 20 80
# description: w.c.s. web form manager
### BEGIN INIT INFO
# Provides: wcs
# Required-Start: $local_fs $network $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: w.c.s. (Au quotidien)
# Description: w.c.s. Form Server (with Au Quotidien Extension)
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="w.c.s. (+Au Quotidien)"
NAME=wcs-au-quotidien
DAEMON=/usr/bin/wcsctl
PIDFILE=/var/run/wcs-au-quotidien/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
WCS_USER=wcs-au-quotidien
WCS_GROUP=wcs-au-quotidien
PYTHON_VERSION=`/usr/bin/env python -c \
"import sys; print '%d.%d' % (sys.version_info[0], sys.version_info[1])"`
OPTIONS="--extra /usr/lib/python$PYTHON_VERSION/site-packages/extra-wcs-au-quotidien/"
CONFIG_FILE=/etc/wcs/wcs-au-quotidien.cfg
lockfile=/var/lock/subsys/$NAME
[ -e /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
start() {
[ -x $DAEMON ] || exit 5
[ -f $CONFIG_FILE ] || exit 6
echo -n $"Starting $NAME: "
[ x$START_DAEMON != xyes ] && echo " disable by /etc/sysconfig/$NAME" && exit 6
daemon --user=$WCS_USER $DAEMON -f $CONFIG_FILE start --daemonize --pidfile=$PIDFILE $OPTIONS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $NAME: "
killproc -p $PIDFILE $NAME
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p $PIDFILE $NAME
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -0,0 +1,106 @@
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%define tag 1.10.2
%define commit 53f5c62
# si possible, minor = nombre de commit depuis le tag (à la "git describe")
%define minor 0
# si minor == 0
#%define version %{tag}
# sinon :
%define version %{tag}.%{minor}.g%{commit}
Name: wcs-au-quotidien
Version: %{version}
Release: 2
Summary: w.c.s. Form Server (Au Quotidien Extension)
Group: Development/Libraries
License: GPLv2
URL: http://www.entrouvert.com/fr/e-administration/au-quotidien/
Source0: http://repos.entrouvert.org/auquotidien.git/snapshot/auquotidien-%{commit}.tar.gz
Source1: wcs-au-quotidien.init
Source2: wcs-au-quotidien.sysconf
Source3: wcs-cg14-tool
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel python-quixote make gettext
Requires: python-vobject wcs
Requires(pre): shadow-utils
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/service, /sbin/chkconfig
Requires(postun): /sbin/service
%description
w.c.s. Form Server (Au Quotidien Extension)
%prep
%setup -q -n auquotidien-%{commit}
%pre
getent group wcs-au-quotidien >/dev/null || groupadd -r wcs-au-quotidien
getent passwd wcs-au-quotidien >/dev/null || \
useradd -r -g wcs-au-quotidien -d /var/lib/wcs-au-quotidien -s /sbin/nologin \
-c "w.c.s. au quotidien software user" wcs-au-quotidien
exit 0
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/var/lib/wcs-au-quotidien
install -d $RPM_BUILD_ROOT/etc/wcs
install -m 644 wcs-au-quotidien.cfg-sample $RPM_BUILD_ROOT/etc/wcs/wcs-au-quotidien.cfg
install -D -p -m 0755 %{SOURCE1} \
%{buildroot}%{_sysconfdir}/rc.d/init.d/wcs-au-quotidien
install -D -p -m 644 %{SOURCE2} \
$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wcs-au-quotidien
mkdir -p %{buildroot}/var/run/wcs-au-quotidien
for i in $RPM_BUILD_ROOT/usr/lib/python2.*; do \
mv $i/site-packages/extra \
$i/site-packages/extra-wcs-au-quotidien; done
cd po && make install prefix=$RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/usr/local/bin
install -D -p -m 0755 %{SOURCE3} $RPM_BUILD_ROOT/usr/local/bin/wcs-cg14-tool
%post
/sbin/chkconfig --add wcs-au-quotidien
%preun
if [ $1 -eq 0 ]; then
/sbin/service wcs-au-quotidien stop &>/dev/null || :
/sbin/chkconfig --del wcs-au-quotidien
fi
%postun
if [ $1 -ge 1 ]; then
/sbin/service wcs-au-quotidien condrestart &>/dev/null || :
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README
%{python_sitelib}/extra-wcs-au-quotidien*
%{python_sitelib}/wcs_au_quotidien-*.egg-info
%{_datadir}/wcs*
%{_datadir}/auquotidien*
/usr/share/locale*
/usr/local/bin/wcs*
%{_sysconfdir}/rc.d/init.d/wcs-au-quotidien
%config(noreplace) /etc/wcs/wcs-au-quotidien.cfg
%config(noreplace) %{_sysconfdir}/sysconfig/*
%defattr(-,wcs-au-quotidien,wcs-au-quotidien,-)
%dir /var/lib/wcs-au-quotidien
%dir /var/run/wcs-au-quotidien
%changelog
* Tue Feb 20 2013 Entr'ouvert <info@entrouvert.com> - 20130205+2e7cace-1
- Initial package

View File

@ -0,0 +1 @@
START_DAEMON=no

View File

@ -0,0 +1,64 @@
#!/bin/sh -e
APPDIR=/var/lib/wcs-au-quotidien
COMMAND=$1
VHOST=$2
FILENAME=$3
if [ -z "$VHOST" ]; then
echo "Usage: $0 export vhost"
echo " $0 import vhost filename.tgz"
exit 2
fi
APPDIR=$APPDIR/$VHOST
cd $APPDIR || exit 2
su wcs-au-quotidien -c /usr/bin/id >/dev/null || exit 2
OUTFILE=/tmp/$VHOST-datas-`date +%Y%m%d-%H%M%S`-$$.tgz
tar_c() {
cd $APPDIR
tar zcf $OUTFILE categories roles formdefs workflows models links themes
echo "$OUTFILE created"
}
tar_x() {
tar ztf "$FILENAME" > /dev/null || exit 2
cd $APPDIR
echo "extract $FILENAME in $APPDIR:"
tar zxvf "$FILENAME" || exit 2
chown -R wcs-au-quotidien categories roles formdefs workflows models links themes
echo "synchronize sql tables"
su wcs-au-quotidien -c /usr/bin/python << EOPY
import os
from wcs import publisher
from wcs.formdef import FormDef
APP_DIR = '/var/lib/wcs-au-quotidien'
VHOST = '$VHOST'
pub = publisher.WcsPublisher.create_publisher()
pub.app_dir = os.path.join(APP_DIR, VHOST)
for f in FormDef.select():
print f.name.strip(), ' ... ',
f.store()
print 'ok'
EOPY
chown -R wcs-au-quotidien formdefs # superstition ...
}
case "$1" in
export)
tar_c
;;
import)
tar_x
;;
*)
echo "Usage: $0 export vhost"
echo " $0 import vhost filename.tgz"
exit 2
esac

View File

@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="host">repos.entrouvert.org</param>
<param name="protocol">http</param>
<param name="path">/wcs.git/snapshot/wcs-870cff1.tar.gz</param>
</service>
</services>

View File

@ -0,0 +1,14 @@
diff --git a/wcs/forms/root.py b/wcs/forms/root.py
index e1215ea..346d33f 100644
--- a/wcs/forms/root.py
+++ b/wcs/forms/root.py
@@ -316,6 +316,9 @@ class FormPage(Directory):
session = get_session()
+ if get_request().get_method() == 'POST':
+ get_logger().debug('POST data: %r', get_request().form)
+
existing_formdata = None
if editing:
existing_formdata = editing.data

View File

@ -0,0 +1,109 @@
#!/bin/sh
#
# w.c.s.
#
# chkconfig: 2345 20 80
# description: w.c.s. web form manager
### BEGIN INIT INFO
# Provides: wcs
# Required-Start: $local_fs $network $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start w.c.s. web form manager
# Description: Start w.c.s. web form manager
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="w.c.s."
NAME=wcs
DAEMON=/usr/bin/wcsctl
PIDFILE=/var/run/wcs/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
WCS_USER=wcs
WCS_GROUP=wcs
CONFIG_FILE=/etc/wcs/wcs.cfg
lockfile=/var/lock/subsys/$NAME
[ -e /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
start() {
[ -x $DAEMON ] || exit 5
[ -f $CONFIG_FILE ] || exit 6
echo -n $"Starting $NAME: "
[ x$START_DAEMON != xyes ] && echo " disable by /etc/sysconfig/$NAME" && exit 6
daemon --user=$WCS_USER $DAEMON -f $CONFIG_FILE start --daemonize --pidfile=$PIDFILE $DAEMON_ARGS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $NAME: "
killproc -p $PIDFILE $NAME
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p $PIDFILE $NAME
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -0,0 +1,103 @@
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%define tag 1.10.8
%define commit 870cff1
# si possible, minor = nombre de commit depuis le tag (à la "git describe")
%define minor 0
# si minor == 0
#%define version %{tag}
# sinon :
%define version %{tag}.%{minor}.g%{commit}
Name: wcs
Version: %{version}
Release: 9%{?dist}
Summary: web application to design and set up online forms
Group: Development/Libraries
License: GPLv2
URL: http://www.entrouvert.com/fr/e-administration/wcs/
Source0: http://repos.entrouvert.org/wcs.git/snapshot/wcs-%{commit}.tar.gz
Source1: wcs.init
Source2: wcs.sysconf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel python-quixote make gettext
Requires: mod_scgi python-quixote python-raven
Requires(pre): shadow-utils
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/service, /sbin/chkconfig
Requires(postun): /sbin/service
Patch1: %{name}-log-post-form.patch
%description
w.c.s. is a web application which allows to design and set up online forms.
It gives a user the ability to create web forms easily without requiring any
other skill than familiarity with web surfing
%prep
%setup -q -n wcs-%{commit}
%patch1 -p1
%pre
getent group wcs >/dev/null || groupadd -r wcs
getent passwd wcs >/dev/null || \
useradd -r -g wcs -d /var/lib/wcs -s /sbin/nologin \
-c "w.c.s software user" wcs
exit 0
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/var/lib/wcs
install -d $RPM_BUILD_ROOT/etc/wcs
install -m 644 wcs.cfg-sample $RPM_BUILD_ROOT/etc/wcs/wcs.cfg
install -D -p -m 0755 %{SOURCE1} \
%{buildroot}%{_sysconfdir}/rc.d/init.d/wcs
install -D -p -m 644 %{SOURCE2} \
$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wcs
mv %{buildroot}%{_bindir}/wcsctl.py %{buildroot}%{_bindir}/wcsctl
mkdir -p %{buildroot}/var/run/wcs
cd po && make install prefix=$RPM_BUILD_ROOT
%post
/sbin/chkconfig --add wcs
%preun
if [ $1 -eq 0 ]; then
/sbin/service wcs stop &>/dev/null || :
/sbin/chkconfig --del wcs
fi
%postun
if [ $1 -ge 1 ]; then
/sbin/service wcs condrestart &>/dev/null || :
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc doc/ COPYING NEWS README
%{python_sitelib}/wcs*
%{_bindir}/wcsctl
%{_datadir}/wcs*
/usr/share/locale*
%{_sysconfdir}/rc.d/init.d/wcs
%config(noreplace) /etc/wcs/wcs.cfg
%config(noreplace) %{_sysconfdir}/sysconfig/*
%defattr(-,wcs,wcs,-)
%dir /var/lib/wcs
%dir /var/run/wcs
%changelog

View File

@ -0,0 +1 @@
START_DAEMON=no