create cg14-dev repo

This commit is contained in:
Thomas NOËL 2014-10-13 14:05:33 +02:00
parent 0e887d9e8e
commit 45356fa1f9
19 changed files with 731 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">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,22 @@
From 959e21356fde24e4557312203c665d2a787a36a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Tue, 22 Jul 2014 15:36:36 +0200
Subject: workflows: makes sure workflow id is exported as a string (#5198)
diff --git a/wcs/workflows.py b/wcs/workflows.py
index 8e6b870..66b9af3 100644
--- a/wcs/workflows.py
+++ b/wcs/workflows.py
@@ -207,7 +207,7 @@ class Workflow(StorableObject):
charset = get_publisher().site_charset
root = ET.Element('workflow')
if include_id and self.id and not str(self.id).startswith('_'):
- root.attrib['id'] = self.id
+ root.attrib['id'] = str(self.id)
ET.SubElement(root, 'name').text = unicode(self.name, charset)
roles_node = ET.SubElement(root, 'roles')
--
cgit v0.10.2

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,104 @@
%{!?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
Patch2: %{name}-workflow-id-as-string.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
%patch2 -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