aboutsummaryrefslogtreecommitdiff
path: root/textproc/pootle/files
diff options
context:
space:
mode:
authorSergey Skvortsov <skv@FreeBSD.org>2009-12-31 11:53:33 +0000
committerSergey Skvortsov <skv@FreeBSD.org>2009-12-31 11:53:33 +0000
commit6b8968349639afa62f246a89a90410ddda123c98 (patch)
treee979e7f4838696929bc18e62a10bdc5932053582 /textproc/pootle/files
parentfe41a50fa0a0da649e0a4c3fa584f746f83b091d (diff)
downloadports-6b8968349639afa62f246a89a90410ddda123c98.tar.gz
ports-6b8968349639afa62f246a89a90410ddda123c98.zip
Notes
Diffstat (limited to 'textproc/pootle/files')
-rw-r--r--textproc/pootle/files/patch-install_dirs.py15
-rw-r--r--textproc/pootle/files/patch-setup.py24
-rw-r--r--textproc/pootle/files/pootle.sh.in38
3 files changed, 77 insertions, 0 deletions
diff --git a/textproc/pootle/files/patch-install_dirs.py b/textproc/pootle/files/patch-install_dirs.py
new file mode 100644
index 000000000000..881e644c04d9
--- /dev/null
+++ b/textproc/pootle/files/patch-install_dirs.py
@@ -0,0 +1,15 @@
+--- pootle/install_dirs.py 2009-09-03 05:52:41.000000000 +0400
++++ pootle/install_dirs.py 2009-12-16 19:49:09.000000000 +0300
+@@ -1,9 +1,9 @@
+ import os
+
+-CONFIG_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+-DATA_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
++CONFIG_DIR = '/usr/local/etc/pootle'
++DATA_DIR = '/usr/local/share/pootle'
+ SOURCE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+-WORKING_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
++WORKING_DIR = '/var/db/pootle'
+
+ def config_path(filename):
+ return os.path.join(CONFIG_DIR, filename)
diff --git a/textproc/pootle/files/patch-setup.py b/textproc/pootle/files/patch-setup.py
new file mode 100644
index 000000000000..37ed22345c95
--- /dev/null
+++ b/textproc/pootle/files/patch-setup.py
@@ -0,0 +1,24 @@
+--- setup.py 2009-12-17 13:56:51.000000000 +0300
++++ setup.py 2009-12-17 13:57:06.000000000 +0300
+@@ -54,10 +54,10 @@
+ It uses the Translate Toolkit to get access to translation files and therefore
+ can edit a variety of files (including PO and XLIFF files)."""
+
+-INSTALL_CONFIG_DIR = '/etc/pootle'
++INSTALL_CONFIG_DIR = 'etc/pootle'
+ INSTALL_DATA_DIR = 'share/pootle'
+ INSTALL_DOC_DIR = 'share/doc/pootle'
+-INSTALL_WORKING_DIR = '/var/lib/pootle'
++INSTALL_WORKING_DIR = '/var/db/pootle'
+
+ ###############################################################################
+ # HELPER FUNCTIONS
+@@ -65,7 +65,7 @@
+
+ def collect_options():
+ data_files = [
+- (INSTALL_CONFIG_DIR, ['localsettings.py']),
++ (INSTALL_CONFIG_DIR, ['localsettings.py.sample']),
+ (INSTALL_DOC_DIR, ['wsgi.py', 'ChangeLog', 'COPYING', 'README', 'INSTALL']),
+ (INSTALL_WORKING_DIR + '/dbs', []) # Create the empty "dbs" dir
+ ] + list_tree(INSTALL_DATA_DIR, 'templates') + list_tree(INSTALL_DATA_DIR, 'html') + \
diff --git a/textproc/pootle/files/pootle.sh.in b/textproc/pootle/files/pootle.sh.in
new file mode 100644
index 000000000000..86c006f5e4e4
--- /dev/null
+++ b/textproc/pootle/files/pootle.sh.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: pootle
+# REQUIRE: DAEMON
+#
+# Add the following lines to /etc/rc.conf to run pootle:
+#
+# pootle_enable (bool): Set it to "YES" to enable pootle.
+# Default is "NO".
+# pootle_flags (flags): Set extra flags here. More options in pootle(1)
+# Default is empty "".
+# pootle_user (user): Set user to run pootle.
+# Default is "nobody".
+#
+
+. %%RC_SUBR%%
+
+name=pootle
+rcvar=${name}_enable
+pidfile="/var/run/pootle.pid"
+command_interpreter="%%PYTHON_CMD%%"
+
+required_files="%%PREFIX%%/etc/pootle/localsettings.py"
+
+command="%%PREFIX%%/bin/PootleServer"
+pootle_flags=" >>/var/log/pootle/access.log 2>>/var/log/pootle/error.log"
+
+load_rc_config $name
+: ${pootle_enable="NO"}
+: ${pootle_user="nobody"}
+
+start_cmd="/usr/sbin/daemon -p ${pidfile} -u ${pootle_user} ${command} ${pootle_flags}"
+
+start_precmd="touch ${pidfile}; chown ${pootle_user} ${pidfile}"
+
+run_rc_command "$1"