diff options
author | rene <rene@FreeBSD.org> | 2015-10-02 23:18:48 +0800 |
---|---|---|
committer | rene <rene@FreeBSD.org> | 2015-10-02 23:18:48 +0800 |
commit | 048aa9a5410e1c2f7e055eef6a2d84b52872d7c0 (patch) | |
tree | 28b6882da1343ffc42efb39731964b58e6211f5b /textproc/pootle | |
parent | 730d5cf61f8db424c37ec15ecf95482fb4cf48ec (diff) | |
download | freebsd-ports-gnome-048aa9a5410e1c2f7e055eef6a2d84b52872d7c0.tar.gz freebsd-ports-gnome-048aa9a5410e1c2f7e055eef6a2d84b52872d7c0.tar.zst freebsd-ports-gnome-048aa9a5410e1c2f7e055eef6a2d84b52872d7c0.zip |
Resurrect textproc/pootle and update it to 2.5.1.3
There might be some rough edges with getting it running properly, but
time will tell.
Add UID/GID 158 for pootle.
Differential Revision: https://reviews.freebsd.org/D1234
Diffstat (limited to 'textproc/pootle')
14 files changed, 343 insertions, 0 deletions
diff --git a/textproc/pootle/Makefile b/textproc/pootle/Makefile new file mode 100644 index 000000000000..f5da60c93e74 --- /dev/null +++ b/textproc/pootle/Makefile @@ -0,0 +1,75 @@ +# Created by: Denis Pokataev <catone@cpan.org> +# $FreeBSD$ + +PORTNAME= pootle +PORTVERSION= 2.5.1.3 +CATEGORIES= textproc +MASTER_SITES= CHEESESHOP +DISTNAME= Pootle-${PORTVERSION} + +MAINTAINER= rene@FreeBSD.org +COMMENT= User-friendly web portal for simple translation process + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= translate-toolkit>=1.11.0:${PORTSDIR}/textproc/translate-toolkit \ + ${PYTHON_PKGNAMEPREFIX}south>=0.7.6:${PORTSDIR}/databases/py-south\ + ${PYTHON_PKGNAMEPREFIX}cssmin>=0.1.4:${PORTSDIR}/www/py-cssmin \ + ${PYTHON_PKGNAMEPREFIX}lxml>=2.1.4:${PORTSDIR}/devel/py-lxml \ + ${PYTHON_PKGNAMEPREFIX}argparse>=0:${PORTSDIR}/devel/py-argparse \ + ${PYTHON_PKGNAMEPREFIX}django-taggit>0.10:${PORTSDIR}/www/py-django-taggit \ + ${PYTHON_PKGNAMEPREFIX}django-assets>=0.8:${PORTSDIR}/www/py-django-assets \ + ${PYTHON_PKGNAMEPREFIX}south>=0.7.6:${PORTSDIR}/databases/py-south \ + ${PYTHON_PKGNAMEPREFIX}django-voting>=0.1:${PORTSDIR}/www/py-django-voting \ + ${PYTHON_PKGNAMEPREFIX}simplejson>=0:${PORTSDIR}/devel/py-simplejson \ + ${PYTHON_PKGNAMEPREFIX}diff-match-patch>=0:${PORTSDIR}/textproc/py-diff-match-patch +# actually diff-match-patch is a dependency of translate-toolkit, +# but only this port uses it. + +USES= gettext python tar:bzip2 +USE_PYTHON= autoplist distutils + +USERS= pootle +GROUPS= pootle + +PLIST_SUB+= POOTLEUSER="${USERS}" \ + POOTLEGROUP="${GROUPS}" + +USE_RC_SUBR= pootle +SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}" + +PORTDOCS= CREDITS INSTALL LICENSE + +OPTIONS_DEFINE= LDAP MEMCACHED MYSQL PGSQL +OPTIONS_DEFAULT=MEMCACHED MYSQL + +MEMCACHED_DESC= Use memcached to improve performance + +MYSQL_USE= MYSQL=yes + +LDAP_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}ldap2>0:${PORTSDIR}/devel/py-ldap2 + +MEMCACHED_LIB_DEPENDS= libmemcached.so:${PORTSDIR}/databases/libmemcached +MEMCACHED_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}memcached>=1.45:${PORTSDIR}/databases/py-memcached + +MYSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}MySQLdb>0:${PORTSDIR}/databases/py-MySQLdb + +PGSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}psycopg2>0:${PORTSDIR}/databases/py-pyscopg2 + +SUBVERSION_RUN_DEPENDS= svn:${PORTSDIR}/devel/subversion + +pre-configure: + @${REINPLACE_CMD} -e "s/,<0.11.2//g" \ + -e "s/,<0.8//g" \ + -e "s/==0.1//g" \ + -e "s/,<1.5//g" \ + ${WRKSRC}/requirements/base.txt + +post-install: + ${MKDIR} ${STAGEDIR}/${DOCSDIR} +.for docs in ${PORTDOCS} + ${INSTALL_DATA} ${WRKSRC}/${docs} ${STAGEDIR}/${DOCSDIR} +.endfor + +.include <bsd.port.mk> diff --git a/textproc/pootle/distinfo b/textproc/pootle/distinfo new file mode 100644 index 000000000000..82f0833ec9df --- /dev/null +++ b/textproc/pootle/distinfo @@ -0,0 +1,2 @@ +SHA256 (Pootle-2.5.1.3.tar.bz2) = f0303896af702f6bc6cbd7f28fae9478f3f11e804c6f0194c1fb34d2557f4243 +SIZE (Pootle-2.5.1.3.tar.bz2) = 6387947 diff --git a/textproc/pootle/files/patch-pootle_apps_djblets_util_fields.py b/textproc/pootle/files/patch-pootle_apps_djblets_util_fields.py new file mode 100644 index 000000000000..036b729cc469 --- /dev/null +++ b/textproc/pootle/files/patch-pootle_apps_djblets_util_fields.py @@ -0,0 +1,11 @@ +--- pootle/apps/djblets/util/fields.py.orig 2015-06-03 13:30:23 UTC ++++ pootle/apps/djblets/util/fields.py +@@ -30,7 +30,7 @@ from datetime import datetime + from django.conf import settings + from django.core.serializers.json import DjangoJSONEncoder + from django.db import models +-from django.utils import simplejson ++import simplejson + from django.utils.encoding import smart_unicode + + diff --git a/textproc/pootle/files/patch-pootle_apps_pootle__app_views_admin_dashboard.py b/textproc/pootle/files/patch-pootle_apps_pootle__app_views_admin_dashboard.py new file mode 100644 index 000000000000..95f1393b590d --- /dev/null +++ b/textproc/pootle/files/patch-pootle_apps_pootle__app_views_admin_dashboard.py @@ -0,0 +1,11 @@ +--- pootle/apps/pootle_app/views/admin/dashboard.py.orig 2015-06-03 13:30:23 UTC ++++ pootle/apps/pootle_app/views/admin/dashboard.py +@@ -26,7 +26,7 @@ from django.core.cache import cache + from django.http import HttpResponse + from django.shortcuts import render_to_response + from django.template import RequestContext +-from django.utils import simplejson ++import simplejson + from django.utils.translation import ugettext as _ + + from pootle import depcheck diff --git a/textproc/pootle/files/patch-pootle_apps_pootle__misc_forms.py b/textproc/pootle/files/patch-pootle_apps_pootle__misc_forms.py new file mode 100644 index 000000000000..4b59f6148100 --- /dev/null +++ b/textproc/pootle/files/patch-pootle_apps_pootle__misc_forms.py @@ -0,0 +1,11 @@ +--- pootle/apps/pootle_misc/forms.py.orig 2015-06-03 13:30:23 UTC ++++ pootle/apps/pootle_misc/forms.py +@@ -79,7 +79,7 @@ def make_search_form(*args, **kwargs): + + if sparams_cookie: + import urllib +- from django.utils import simplejson ++ import simplejson + + initial_sparams = simplejson.loads(urllib.unquote(sparams_cookie)) + if isinstance(initial_sparams, dict): diff --git a/textproc/pootle/files/patch-pootle_apps_pootle__misc_util.py b/textproc/pootle/files/patch-pootle_apps_pootle__misc_util.py new file mode 100644 index 000000000000..a8edce23c0eb --- /dev/null +++ b/textproc/pootle/files/patch-pootle_apps_pootle__misc_util.py @@ -0,0 +1,12 @@ +--- pootle/apps/pootle_misc/util.py.orig 2015-06-03 13:30:23 UTC ++++ pootle/apps/pootle_misc/util.py +@@ -25,7 +25,8 @@ from django.conf import settings + from django.core.cache import cache + from django.core.paginator import Paginator + from django.http import HttpResponseBadRequest +-from django.utils import simplejson, timezone ++from django.utils import timezone ++import simplejson + from django.utils.encoding import force_unicode, iri_to_uri + from django.utils.functional import Promise + diff --git a/textproc/pootle/files/patch-pootle_apps_pootle__store_models.py b/textproc/pootle/files/patch-pootle_apps_pootle__store_models.py new file mode 100644 index 000000000000..616b3f3a57c6 --- /dev/null +++ b/textproc/pootle/files/patch-pootle_apps_pootle__store_models.py @@ -0,0 +1,58 @@ +--- pootle/apps/pootle_store/models.py.orig 2015-06-03 13:30:23 UTC ++++ pootle/apps/pootle_store/models.py +@@ -32,9 +32,8 @@ from django.conf import settings + from django.core.exceptions import ObjectDoesNotExist + from django.core.files.storage import FileSystemStorage + from django.core.urlresolvers import reverse +-from django.db import models, DatabaseError, IntegrityError ++from django.db import models, transaction, DatabaseError, IntegrityError + from django.db.models.signals import post_delete, post_save, pre_delete +-from django.db.transaction import commit_on_success + from django.utils import timezone, tzinfo + from django.utils.translation import ugettext_lazy as _ + +@@ -1102,7 +1101,7 @@ class Store(models.Model, base.Translati + + return False + +- @commit_on_success ++ @transaction.atomic + def parse(self, store=None): + self.clean_stale_lock() + +@@ -1154,7 +1153,7 @@ class Store(models.Model, base.Translati + if obsolete_unit: + obsolete_unit.delete() + +- @commit_on_success ++ @transaction.atomic + def update(self, update_structure=False, update_translation=False, + store=None, fuzzy=False, only_newer=False, modified_since=0): + """Update DB with units from file. +@@ -1320,7 +1319,7 @@ class Store(models.Model, base.Translati + # new qualitychecks, let's flush cache + deletefromcache(self, ["getcompletestats"]) + +- @commit_on_success ++ @transaction.atomic + def update_qualitychecks(self): + logging.debug(u"Updating quality checks for %s", self.pootle_path) + for unit in self.units.iterator(): +@@ -1583,7 +1582,7 @@ class Store(models.Model, base.Translati + """Returns a single unit based on the item number.""" + return self.units[item] + +- @commit_on_success ++ @transaction.atomic + def mergefile(self, newfile, profile, allownewstrings, suggestions, + notranslate, obsoletemissing): + """Merges :param:`newfile` with the current store. +@@ -1778,7 +1777,7 @@ class Store(models.Model, base.Translati + self.pending = pending_name + self.save() + +- @commit_on_success ++ @transaction.atomic + def import_pending(self): + """import suggestions from legacy .pending files, into database""" + self.init_pending() diff --git a/textproc/pootle/files/patch-pootle_apps_pootle__store_views.py b/textproc/pootle/files/patch-pootle_apps_pootle__store_views.py new file mode 100644 index 000000000000..2cb5fae3f24e --- /dev/null +++ b/textproc/pootle/files/patch-pootle_apps_pootle__store_views.py @@ -0,0 +1,12 @@ +--- pootle/apps/pootle_store/views.py.orig 2015-06-03 13:30:23 UTC ++++ pootle/apps/pootle_store/views.py +@@ -35,7 +35,8 @@ from django.shortcuts import get_object_ + from django.template import loader, RequestContext + from django.utils.translation import to_locale, ugettext as _ + from django.utils.translation.trans_real import parse_accept_lang_header +-from django.utils import simplejson, timezone ++from django.utils import timezone ++import simplejson + from django.utils.encoding import iri_to_uri + from django.views.decorators.cache import never_cache + from django.views.decorators.http import require_POST diff --git a/textproc/pootle/files/patch-pootle_apps_pootle__terminology_views.py b/textproc/pootle/files/patch-pootle_apps_pootle__terminology_views.py new file mode 100644 index 000000000000..179b8c055b01 --- /dev/null +++ b/textproc/pootle/files/patch-pootle_apps_pootle__terminology_views.py @@ -0,0 +1,20 @@ +--- pootle/apps/pootle_terminology/views.py.orig 2015-06-03 13:30:23 UTC ++++ pootle/apps/pootle_terminology/views.py +@@ -19,7 +19,7 @@ + # Pootle; if not, see <http://www.gnu.org/licenses/>. + + from django.conf import settings +-from django.db.transaction import commit_on_success ++from django.db import transaction + from django.shortcuts import render_to_response + from django.template import RequestContext + from django.utils.translation import ugettext as _ +@@ -63,7 +63,7 @@ def get_terminology_filename(translation + return 'pootle-terminology.' + translation_project.project.localfiletype + + +-@commit_on_success ++@transaction.atomic + @get_path_obj + @permission_required('administrate') + def extract(request, translation_project): diff --git a/textproc/pootle/files/patch-pootle_apps_registration_models.py b/textproc/pootle/files/patch-pootle_apps_registration_models.py new file mode 100644 index 000000000000..3590c5658ef2 --- /dev/null +++ b/textproc/pootle/files/patch-pootle_apps_registration_models.py @@ -0,0 +1,36 @@ +--- pootle/apps/registration/models.py.orig 2015-06-03 13:30:23 UTC ++++ pootle/apps/registration/models.py +@@ -1,4 +1,5 @@ + import datetime ++import hashlib + import random + import re + +@@ -8,7 +9,6 @@ from django.contrib.sites.models import + from django.db import models + from django.db import transaction + from django.template.loader import render_to_string +-from django.utils.hashcompat import sha_constructor + from django.utils.translation import ugettext_lazy as _ + + +@@ -146,7 +146,7 @@ class RegistrationManager(models.Manager + msg.send() + user_registered.send(sender=self.model, user=new_user) + return new_user +- create_inactive_user = transaction.commit_on_success(create_inactive_user) ++ create_inactive_user = transaction.atomic(create_inactive_user) + + def create_profile(self, user): + """ +@@ -158,8 +158,8 @@ class RegistrationManager(models.Manager + username and a random salt. + + """ +- salt = sha_constructor(str(random.random())).hexdigest()[:5] +- activation_key = sha_constructor(salt+user.email).hexdigest() ++ salt = hashlib.sha1(str(random.random())).hexdigest()[:5] ++ activation_key = hashlib.sha1(salt+user.email).hexdigest() + return self.create(user=user, + activation_key=activation_key) + diff --git a/textproc/pootle/files/patch-pootle_middleware_captcha.py b/textproc/pootle/files/patch-pootle_middleware_captcha.py new file mode 100644 index 000000000000..afb5fbba767f --- /dev/null +++ b/textproc/pootle/files/patch-pootle_middleware_captcha.py @@ -0,0 +1,11 @@ +--- pootle/middleware/captcha.py.orig 2015-06-03 13:30:24 UTC ++++ pootle/middleware/captcha.py +@@ -29,7 +29,7 @@ from django.conf import settings + from django.http import HttpResponse + from django.shortcuts import render_to_response + from django.template import loader, RequestContext +-from django.utils import simplejson ++import simplejson + from django.utils.translation import ugettext as _ + + diff --git a/textproc/pootle/files/patch-pootle_middleware_errorpages.py b/textproc/pootle/files/patch-pootle_middleware_errorpages.py new file mode 100644 index 000000000000..fc7dfa82ff4c --- /dev/null +++ b/textproc/pootle/files/patch-pootle_middleware_errorpages.py @@ -0,0 +1,11 @@ +--- pootle/middleware/errorpages.py.orig 2015-06-03 13:30:24 UTC ++++ pootle/middleware/errorpages.py +@@ -28,7 +28,7 @@ from django.http import (Http404, HttpRe + HttpResponseServerError) + from django.template import RequestContext + from django.template.loader import render_to_string +-from django.utils import simplejson ++import simplejson + from django.utils.encoding import force_unicode + from django.utils.translation import ugettext as _ + diff --git a/textproc/pootle/files/pootle.in b/textproc/pootle/files/pootle.in new file mode 100644 index 000000000000..dcdc31269ddb --- /dev/null +++ b/textproc/pootle/files/pootle.in @@ -0,0 +1,65 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: pootle +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# 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_logdir (path): Path to pootle log directory. +# Default is /var/log/pootle +# Empty is log to /dev/null. +# pootle_user (user): Set user to run pootle. +# Default is "%%POOTLEUSER%%". +# + +. /etc/rc.subr + +name=pootle +rcvar=pootle_enable +load_rc_config $name + +: ${pootle_enable:=NO} +: ${pootle_user="%%POOTLEUSER%%"} +: ${pootle_group="%%POOTLEGROUP%%"} +: ${pootle_logdir=/var/log/pootle} + +pidfile="%%POOTLERUNDIR%%/pootle.pid" +command_interpreter="%%PYTHON_CMD%%" + +required_files="%%PREFIX%%/etc/pootle/localsettings.py" + +command="%%PREFIX%%/bin/PootleServer" + +start_command=pootle_start_cmd +start_precmd=pootle_start_precmd + +pootle_start_cmd() +{ + [ -z "${rc_quiet}" ] && echo "Starting ${name}." + /usr/sbin/daemon -p ${pidfile} -u ${pootle_user} ${command} ${pootle_flags} \ + >>${pootle_stdout} 2>>${pootle_stderr} +} + +pootle_start_precmd() +{ + for i in db log run ; do + install -d -o ${pootle_user} -g ${pootle_group} -m 770 /var/${i}/pootle + done + + if [ -n "${pootle_logdir}" ] ; then + pootle_stdout="${pootle_logdir}/access.log" + pootle_stderr="${pootle_logdir}/error.log" + else + pootle_stdout="/dev/null" + pootle_stderr="/dev/null" + fi +} + +run_rc_command "$1" diff --git a/textproc/pootle/pkg-descr b/textproc/pootle/pkg-descr new file mode 100644 index 000000000000..68759ebfd487 --- /dev/null +++ b/textproc/pootle/pkg-descr @@ -0,0 +1,8 @@ +Pootle is a user-friendly web portal that makes +the translation process so much simpler. +It allows online translation, work assignment, +gives statistics and allows easy volunteer contribution. +You can run Pootle as an Internet server like +these projects or run your own copy on an Intranet. + +WWW: http://translate.sourceforge.net/wiki/pootle/index |