summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-python/mwlib
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-python/mwlib')
-rw-r--r--dev-python/mwlib/Manifest1
-rw-r--r--dev-python/mwlib/files/mw-qserve.confd14
-rw-r--r--dev-python/mwlib/files/mw-qserve.initd21
-rw-r--r--dev-python/mwlib/files/mw-qserve.logrotate7
-rw-r--r--dev-python/mwlib/files/mwlib-purge-cache.cron-r14
-rw-r--r--dev-python/mwlib/files/nserve.confd20
-rw-r--r--dev-python/mwlib/files/nserve.initd24
-rw-r--r--dev-python/mwlib/files/nserve.logrotate7
-rw-r--r--dev-python/mwlib/files/nslave.confd-r126
-rw-r--r--dev-python/mwlib/files/nslave.initd-r127
-rw-r--r--dev-python/mwlib/files/nslave.logrotate7
-rw-r--r--dev-python/mwlib/files/postman.confd12
-rw-r--r--dev-python/mwlib/files/postman.initd-r121
-rw-r--r--dev-python/mwlib/files/postman.logrotate7
-rw-r--r--dev-python/mwlib/metadata.xml12
-rw-r--r--dev-python/mwlib/mwlib-0.15.15.ebuild132
16 files changed, 342 insertions, 0 deletions
diff --git a/dev-python/mwlib/Manifest b/dev-python/mwlib/Manifest
new file mode 100644
index 000000000000..f66c91553737
--- /dev/null
+++ b/dev-python/mwlib/Manifest
@@ -0,0 +1 @@
+DIST mwlib-0.15.15.tar.gz 1705073 SHA256 06ce351df76fb4605913cda6c9702f8e5ea99147921921c2f8462c60791e4946 SHA512 e1c04c0cd86b8fd31f54033387426dcad343d4b5ef03f2f51b3689c0894f2cfa85c9246401f713836d76435c42c380ecf94c3000b4f38d1f1b2789780d93c5ca WHIRLPOOL b854d06f8b5450b519d0aa6e9232b8480839ecf867d111fc9f189e9c70fd7b857152cd40548132a1ac8fd3313c0ab5c79e244f4434ab752ac0ea4cc56bee5d53
diff --git a/dev-python/mwlib/files/mw-qserve.confd b/dev-python/mwlib/files/mw-qserve.confd
new file mode 100644
index 000000000000..bcd18d4667af
--- /dev/null
+++ b/dev-python/mwlib/files/mw-qserve.confd
@@ -0,0 +1,14 @@
+# The port to listen to
+MW_QSERVE_PORT=14311
+
+# The interface to listen to (for example: 127.0.0.1)
+MW_QSERVE_INTERFACE="127.0.0.1"
+
+# The user running the mw-qserve service, defaults to 'mwlib'
+# MW_QSERVE_USER="mwlib"
+
+# The group running the mq-qserve service, defaults to 'mwlib'
+# MW_QSERVE_GROUP="mwlib"
+
+# The logfile collecting all output from stdout and stderr, comment out for no logging
+MW_QSERVE_LOGFILE="/var/log/mwlib/mw-qserve.log"
diff --git a/dev-python/mwlib/files/mw-qserve.initd b/dev-python/mwlib/files/mw-qserve.initd
new file mode 100644
index 000000000000..ac9dd78016b8
--- /dev/null
+++ b/dev-python/mwlib/files/mw-qserve.initd
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="mw-qserve is a job queue server used to distribute and manage jobs"
+
+command="/usr/bin/mw-qserve"
+command_args="--interface=${MW_QSERVE_INTERFACE} --port=${MW_QSERVE_PORT}"
+
+pidfile="/var/run/${SVCNAME}.pid"
+command_background="yes"
+
+start_stop_daemon_args="--user ${MW_QSERVE_USER:-mwlib} \
+ --group ${MW_QSERVE_GROUP:-mwlib} \
+ ${MW_QSERVE_LOGFILE:+--stderr ${MW_QSERVE_LOGFILE}} \
+ ${MW_QSERVE_LOGFILE:+--stdout ${MW_QSERVE_LOGFILE}}"
+
+depend() {
+ need net localmount
+}
diff --git a/dev-python/mwlib/files/mw-qserve.logrotate b/dev-python/mwlib/files/mw-qserve.logrotate
new file mode 100644
index 000000000000..3b9cf46e9411
--- /dev/null
+++ b/dev-python/mwlib/files/mw-qserve.logrotate
@@ -0,0 +1,7 @@
+/var/log/mwlib/mw-qserve.log {
+ su mwlib mwlib
+ missingok
+ postrotate
+ /etc/init.d/mw-qserve restart > /dev/null 2>&1
+ endscript
+}
diff --git a/dev-python/mwlib/files/mwlib-purge-cache.cron-r1 b/dev-python/mwlib/files/mwlib-purge-cache.cron-r1
new file mode 100644
index 000000000000..870beecad232
--- /dev/null
+++ b/dev-python/mwlib/files/mwlib-purge-cache.cron-r1
@@ -0,0 +1,4 @@
+# purge mw-serve cache directory
+# --cache-dir=DIR: the NSLAVE_CACHEDIR directory specified in /etc/conf.d/nslave
+# --purge-cache=HOURS: remove cache files that have not been touched for at east HOURS hours
+00 23 * * * sudo -u mwlib mw-serve-ctl --cache-dir=/var/cache/mwlib --purge-cache=24
diff --git a/dev-python/mwlib/files/nserve.confd b/dev-python/mwlib/files/nserve.confd
new file mode 100644
index 000000000000..7a482e9989c8
--- /dev/null
+++ b/dev-python/mwlib/files/nserve.confd
@@ -0,0 +1,20 @@
+# The port on which the mw-qserve service is listening
+MW_QSERVE_PORT=14311
+
+# The interface on which the mw-qserve is listening (for example: 127.0.0.1)
+MW_QSERVE_INTERFACE="127.0.0.1"
+
+# The port to listen to
+NSERVE_PORT=8899
+
+# The interface to listen to (for example: 127.0.0.1)
+NSERVE_INTERFACE="127.0.0.1"
+
+# The user running the nserve service, defaults to 'mwlib'
+# NSERVE_USER="mwlib"
+
+# The group running the nserve service, defaults to 'mwlib'
+# NSERVE_GROUP="mwlib"
+
+# The logfile collecting all output from stdout and stderr, comment out for no logging
+NSERVE_LOGFILE="/var/log/mwlib/nserve.log"
diff --git a/dev-python/mwlib/files/nserve.initd b/dev-python/mwlib/files/nserve.initd
new file mode 100644
index 000000000000..498bd738d63d
--- /dev/null
+++ b/dev-python/mwlib/files/nserve.initd
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="nserve is a HTTP server which distributes received jobs to a mw-qserve instance"
+
+command="/usr/bin/nserve"
+command_args="--port=${NSERVE_PORT} \
+ --interface=${NSERVE_INTERFACE} \
+ --qserve=${MW_QSERVE_INTERFACE}:${MW_QSERVE_PORT}"
+
+pidfile="/var/run/${SVCNAME}.pid"
+command_background="yes"
+
+start_stop_daemon_args="--user ${NSERVE_USER:-mwlib} \
+ --group ${NSERVE_GROUP:-mwlib} \
+ ${NSERVE_LOGFILE:+--stderr ${NSERVE_LOGFILE}} \
+ ${NSERVE_LOGFILE:+--stdout ${NSERVE_LOGFILE}}"
+
+depend() {
+ need net localmount
+ use mw-qserve
+}
diff --git a/dev-python/mwlib/files/nserve.logrotate b/dev-python/mwlib/files/nserve.logrotate
new file mode 100644
index 000000000000..54cc4587335d
--- /dev/null
+++ b/dev-python/mwlib/files/nserve.logrotate
@@ -0,0 +1,7 @@
+/var/log/mwlib/nserve.log {
+ su mwlib mwlib
+ missingok
+ postrotate
+ /etc/init.d/nserve restart > /dev/null 2>&1
+ endscript
+}
diff --git a/dev-python/mwlib/files/nslave.confd-r1 b/dev-python/mwlib/files/nslave.confd-r1
new file mode 100644
index 000000000000..ccf758498163
--- /dev/null
+++ b/dev-python/mwlib/files/nslave.confd-r1
@@ -0,0 +1,26 @@
+# The address to serve the rendered files to the wiki
+NSLAVE_ADDRESS="localhost"
+
+# The port to serve the rendered files to the wiki
+NSLAVE_PORT=8898
+
+# The url to serve the rendered files to the wiki
+NSLAVE_URL="http://${NSLAVE_ADDRESS}:${NSLAVE_PORT}/cache"
+
+# The directory to save the rendered PDFs to
+NSLAVE_CACHEDIR="/var/cache/mwlib/"
+
+# The umask to create files in NSLAVE_CACHEDIR
+NSLAVE_UMASK=027
+
+# How many greenlets are allowed to run in parallel
+NSLAVE_NUMPROCS=10
+
+# The user running the nserve service, defaults to 'mwlib'
+# NSLAVE_USER="mwlib"
+
+# The group running the nserve service, defaults to 'mwlib'
+# NSLAVE_GROUP="mwlib"
+
+# The logfile collecting all output from stdout and stderr, comment out for no logging
+NSLAVE_LOGFILE="/var/log/mwlib/nslave.log"
diff --git a/dev-python/mwlib/files/nslave.initd-r1 b/dev-python/mwlib/files/nslave.initd-r1
new file mode 100644
index 000000000000..81f81d3a944f
--- /dev/null
+++ b/dev-python/mwlib/files/nslave.initd-r1
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="nslave pulls new jobs from a mw-qserve instance"
+
+command="/usr/bin/nslave"
+command_args="--cachedir=${NSLAVE_CACHEDIR} \
+ --serve-files-address=${NSLAVE_ADDRESS} \
+ --serve-files-port=${NSLAVE_PORT} \
+ --url=${NSLAVE_URL} \
+ --numprocs=${NSLAVE_NUMPROCS}"
+
+pidfile="/var/run/${SVCNAME}.pid"
+command_background="yes"
+
+start_stop_daemon_args="--user ${NSLAVE_USER:-mwlib} \
+ --group ${NSLAVE_GROUP:-mwlib} \
+ ${NSLAVE_LOGFILE:+--stderr ${NSLAVE_LOGFILE}} \
+ ${NSLAVE_LOGFILE:+--stdout ${NSLAVE_LOGFILE}} \
+ --umask ${NSLAVE_UMASK}"
+
+depend() {
+ need net localmount
+ use mw-qserve
+}
diff --git a/dev-python/mwlib/files/nslave.logrotate b/dev-python/mwlib/files/nslave.logrotate
new file mode 100644
index 000000000000..0637e248f2e7
--- /dev/null
+++ b/dev-python/mwlib/files/nslave.logrotate
@@ -0,0 +1,7 @@
+/var/log/mwlib/nslave.log {
+ su mwlib mwlib
+ missingok
+ postrotate
+ /etc/init.d/nslave restart > /dev/null 2>&1
+ endscript
+}
diff --git a/dev-python/mwlib/files/postman.confd b/dev-python/mwlib/files/postman.confd
new file mode 100644
index 000000000000..168627480dda
--- /dev/null
+++ b/dev-python/mwlib/files/postman.confd
@@ -0,0 +1,12 @@
+# The cache-directory to which the collections are saved, make sure you enter
+# the same directory as in /etc/conf.d/nslave
+POSTMAN_CACHEDIR="/var/cache/mwlib/"
+
+# The user running the postman service, defaults to 'mwlib'
+# POSTMAN_USER="mwlib"
+
+# The group running the postman service, defaults to 'mwlib'
+# POSTMAN_GROUP="mwlib"
+
+# The logfile collecting all output from stdout and stderr, comment out for no logging
+POSTMAN_LOGFILE="/var/log/mwlib/postman.log"
diff --git a/dev-python/mwlib/files/postman.initd-r1 b/dev-python/mwlib/files/postman.initd-r1
new file mode 100644
index 000000000000..0b276240a1d1
--- /dev/null
+++ b/dev-python/mwlib/files/postman.initd-r1
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="postman uploads zip collections to pediapress in case someone likes to order printed books"
+
+command="/usr/bin/postman"
+command_args="--cachedir=${POSTMAN_CACHEDIR}"
+
+pidfile="/var/run/${SVCNAME}.pid"
+command_background="yes"
+
+start_stop_daemon_args="--user ${POSTMAN_USER:-mwlib} \
+ --group ${POSTMAN_GROUP:-mwlib} \
+ ${POSTMAN_LOGFILE:+--stderr ${POSTMAN_LOGFILE}} \
+ ${POSTMAN_LOGFILE:+--stdout ${POSTMAN_LOGFILE}}"
+
+depend() {
+ need net localmount
+}
diff --git a/dev-python/mwlib/files/postman.logrotate b/dev-python/mwlib/files/postman.logrotate
new file mode 100644
index 000000000000..50cbccda7df9
--- /dev/null
+++ b/dev-python/mwlib/files/postman.logrotate
@@ -0,0 +1,7 @@
+/var/log/mwlib/postman.log {
+ su mwlib mwlib
+ missingok
+ postrotate
+ /etc/init.d/postman restart > /dev/null 2>&1
+ endscript
+}
diff --git a/dev-python/mwlib/metadata.xml b/dev-python/mwlib/metadata.xml
new file mode 100644
index 000000000000..a27761e03ab6
--- /dev/null
+++ b/dev-python/mwlib/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>python</herd>
+ <upstream>
+ <remote-id type="pypi">mwlib</remote-id>
+ <remote-id type="github">pediapress/mwlib</remote-id>
+ </upstream>
+ <use>
+ <flag name="server">Install the daemons required when using mwlib for generating PDFs on a MediaWiki instance.</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-python/mwlib/mwlib-0.15.15.ebuild b/dev-python/mwlib/mwlib-0.15.15.ebuild
new file mode 100644
index 000000000000..6be53b70b32b
--- /dev/null
+++ b/dev-python/mwlib/mwlib-0.15.15.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 user
+
+DESCRIPTION="Tools for parsing Mediawiki content to other formats"
+HOMEPAGE="http://code.pediapress.com/code/ http://pypi.python.org/pypi/mwlib https://github.com/pediapress/mwlib/"
+SRC_URI="https://github.com/pediapress/mwlib/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc server test"
+
+RDEPEND="dev-python/lxml[${PYTHON_USEDEP}]
+ >=dev-python/odfpy-0.9[${PYTHON_USEDEP}]
+ <dev-python/odfpy-0.10[${PYTHON_USEDEP}]
+ >=dev-python/pyPdf-1.12[${PYTHON_USEDEP}]
+ >=dev-python/pyparsing-1.5.5[${PYTHON_USEDEP}]
+ <dev-python/pyparsing-1.6[${PYTHON_USEDEP}]
+ >=dev-python/timelib-0.2[${PYTHON_USEDEP}]
+ virtual/latex-base
+ >=dev-python/simplejson-2.3[${PYTHON_USEDEP}]
+ dev-python/gevent[${PYTHON_USEDEP}]
+ >=dev-python/bottle-0.10[${PYTHON_USEDEP}]
+ >=dev-python/apipkg-1.2[${PYTHON_USEDEP}]
+ >=dev-python/qserve-0.2.7[${PYTHON_USEDEP}]
+ dev-python/roman[${PYTHON_USEDEP}]
+ >=dev-python/py-1.4[${PYTHON_USEDEP}]
+ dev-python/sqlite3dbm[${PYTHON_USEDEP}]
+ dev-python/pillow[${PYTHON_USEDEP}]
+ server? ( app-admin/sudo )"
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ app-arch/unzip
+ dev-util/re2c
+ dev-python/cython[${PYTHON_USEDEP}]
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+ test? ( >=dev-python/wsgiintercept-0.6[${PYTHON_USEDEP}] )"
+
+# TODO: requires ploticus to generate timelines
+
+DOCS=(changelog.rst)
+
+pkg_setup() {
+ if use server ; then
+ enewgroup mwlib
+ enewuser mwlib -1 -1 -1 mwlib
+ fi
+}
+
+python_prepare_all() {
+ # mwlib.apipkg is actually used.
+ sed -e 's/, "apipkg"//' -i setup.py || die
+
+ # Execute odflint script.
+ sed \
+ -e "/def _get_odflint_module():/,/odflint = _get_odflint_module()/d" \
+ -e "s/odflint.lint(path)/os.system('odflint %s' % path)/" \
+ -i tests/test_odfwriter.py || die
+
+ # Disable test which requires installed mw-zip or mw-render script
+ # which don't get generated in distutils_install_for_testing for some reason
+ rm -f tests/test_{nuwiki,redirect,render,zipwiki}.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ if [[ ${EPYTHON} == python2* ]] ; then
+ local CFLAGS="${CFLAGS} -fno-strict-aliasing"
+ export CFLAGS
+ fi
+
+ distutils-r1_python_compile
+}
+
+python_compile_all() {
+ use doc && emake -C docs html
+}
+
+python_test() {
+ distutils_install_for_testing
+ PATH="${TEST_DIR}/scripts:${PATH}" py.test || die
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/_build/html/. )
+ distutils-r1_python_install_all
+
+ if use server ; then
+ keepdir /var/log/mwlib
+ keepdir /var/cache/mwlib
+
+ fowners mwlib:mwlib /var/log/mwlib /var/cache/mwlib
+ fperms 0750 /var/log/mwlib /var/cache/mwlib
+
+ insinto /etc/logrotate.d
+ for d in mw-qserve nserve ; do
+ newins "${FILESDIR}/${d}.logrotate" "${d}"
+ newinitd "${FILESDIR}/${d}.initd" "${d}"
+ newconfd "${FILESDIR}/${d}.confd" "${d}"
+ done
+
+ newins "${FILESDIR}/nslave.logrotate" "nslave"
+ newinitd "${FILESDIR}/nslave.initd-r1" "nslave"
+ newconfd "${FILESDIR}/nslave.confd-r1" "nslave"
+
+ newins "${FILESDIR}/postman.logrotate" "postman"
+ newinitd "${FILESDIR}/postman.initd-r1" "postman"
+ newconfd "${FILESDIR}/postman.confd" "postman"
+
+ insinto /etc/cron.d
+ newins "${FILESDIR}/mwlib-purge-cache.cron-r1" "mwlib-purge-cache"
+ else
+ rm "${D}"/usr/bin/{mw-qserve,nserve,nslave,postman}* || die "removing binaries failed"
+ fi
+}
+
+pkg_postinst() {
+ elog "Please enable required image formats for dev-python/pillow"
+ if use server ; then
+ elog "A cronjob to cleanup the cache files got installed to"
+ elog " /etc/cron.d/mwlib-purge-cache"
+ elog "Default parameters are to clean every 24h, adjust it to your needs."
+ fi
+}