Index: GIDs =================================================================== --- GIDs +++ GIDs @@ -94,6 +94,7 @@ xorp:*:155: monetdb:*:156: barman:*:157: +pootle:*:158: sfs:*:171: agk:*:172: polipo:*:173: Index: UIDs =================================================================== --- UIDs +++ UIDs @@ -101,6 +101,7 @@ trircd:*:154:154::0:0:& user:/usr/local/etc/tr-ircd:/usr/sbin/nologin monetdb:*:156:156::0:0:MonetDB user:/usr/local/monetdb5:/bin/sh barman:*:157:157::0:0:Barman user:/var/barman:/bin/sh +pootle:*:158:158::0:0:Pootle User:/var/db/pootle:/usr/sbin/nologin sfs:*:171:171::0:0:Self-Certifying File System:/nonexistent:/usr/sbin/nologin agk:*:172:172::0:0:AquaGateKeeper:/nonexistent:/nonexistent polipo:*:173:173::0:0:polipo web cache:/nonexistent:/usr/sbin/nologin Index: textproc/pootle/Makefile =================================================================== --- textproc/pootle/Makefile +++ textproc/pootle/Makefile @@ -2,97 +2,78 @@ # $FreeBSD$ PORTNAME= pootle -PORTVERSION= 2.1.6 -PORTREVISION= 2 +PORTVERSION= 2.5.1.3 CATEGORIES= textproc -MASTER_SITES= SF/translate/Pootle/${PORTVERSION}/ +MASTER_SITES= CHEESESHOP DISTNAME= Pootle-${PORTVERSION} +#XXX change MAINTAINER MAINTAINER= ports@FreeBSD.org -COMMENT= Pootle is a user-friendly web portal for simple translation process +COMMENT= User-friendly web portal for simple translation process -BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}django>=1.2:${PORTSDIR}/www/py-django \ - translate-toolkit>=1.8.1:${PORTSDIR}/textproc/translate-toolkit \ - ${PYTHON_PKGNAMEPREFIX}south>=0.7:${PORTSDIR}/databases/py-south +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/LICENSE -RUN_DEPENDS:= ${BUILD_DEPENDS} +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=1.1:${PORTSDIR}/textproc/py-sphinx -BROKEN= Does not install -CONFLICTS= ${PYTHON_PKGNAMEPREFIX}django-profiles-[0-9]* \ - ${PYTHON_PKGNAMEPREFIX}django-registration-[0-9]* +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 tar:bzip2 -USE_PYTHON= yes -USE_PYDISTUTILS=yes -PYDISTUTILS_PKGNAME= Pootle +USES= gettext python tar:bzip2 +USE_PYTHON= distutils autoplist -POOTLEUSER?= nobody -POOTLEGROUP?= nobody +USERS= pootle +GROUPS= pootle -POOTLEDBDIR?= /var/db/pootle -POOTLELOGDIR?= /var/log/pootle -POOTLERUNDIR?= /var/run/pootle +PLIST_SUB+= POOTLEUSER="${USERS}" \ + POOTLEGROUP="${GROUPS}" USE_RC_SUBR= pootle -SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}" \ - POOTLEDBDIR="${POOTLEDBDIR}" \ - POOTLELOGDIR="${POOTLELOGDIR}" \ - POOTLERUNDIR="${POOTLERUNDIR}" \ - POOTLEUSER="${POOTLEUSER}" \ - POOTLEGROUP="${POOTLEGROUP}" \ - CHOWN="${CHOWN}" \ - CHMOD="${CHMOD}" \ - MKDIR="${MKDIR}" - -PLIST_SUB+= POOTLEDBDIR="${POOTLEDBDIR}" \ - POOTLELOGDIR="${POOTLELOGDIR}" - -SUB_FILES+= pkg-install -PKGINSTALL= ${WRKDIR}/pkg-install - -PORTDOCS= ChangeLog COPYING INSTALL README wsgi.py - -OPTIONS_DEFINE= MYSQL SUBVERSION MEMCACHED -OPTIONS_DEFAULT= MYSQL SUBVERSION MEMCACHED -SUBVERSION_DESC= ${SVN_DESC} -MEMCACHED_DESC= Enable memcached support - -NO_STAGE= yes -.include - -.if ${PORT_OPTIONS:MMYSQL} -USE_MYSQL= yes -.endif - -.if ${PORT_OPTIONS:MSUBVERSION} -RUN_DEPENDS+= svn:${PORTSDIR}/devel/subversion -.endif - -.if ${PORT_OPTIONS:MMEMCACHED} -LIB_DEPENDS+= libmemcached.so:${PORTSDIR}/databases/libmemcached -RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}memcached>=1.45:${PORTSDIR}/databases/py-memcached -.endif - -post-patch: - @${MV} ${WRKSRC}/localsettings.py ${WRKSRC}/localsettings.py.sample - @${REINPLACE_CMD} -e "s|^CONFIG_DIR.*=.*|CONFIG_DIR = \'${PREFIX}/etc/pootle\'|g" \ - -e "s|^DATA_DIR.*=.*|DATA_DIR = \\'${DATADIR}\\'|g" \ - -e "s|^WORKING_DIR.*=.*|WORKING_DIR = \\'${POOTLEDBDIR}\\'|g" \ - ${WRKSRC}/pootle/install_dirs.py - @${REINPLACE_CMD} -e "s|^INSTALL_CONFIG_DIR.*=.*|INSTALL_CONFIG_DIR = \'${PREFIX}/etc/pootle\'|g" \ - -e "s|^INSTALL_WORKING_DIR.*=.*|INSTALL_WORKING_DIR = \'${POOTLEDBDIR}\'|g" \ - ${WRKSRC}/setup.py +SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}" -post-install: - @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL - @${CP} -n ${PREFIX}/etc/pootle/localsettings.py.sample \ - ${PREFIX}/etc/pootle/localsettings.py || ${TRUE} +PORTDOCS= CREDITS INSTALL LICENSE + +OPTIONS_DEFINE= LDAP MEMCACHED MYSQL PGSQL SUBVERSION +OPTIONS_DEFAULT=MEMCACHED MYSQL SUBVERSION + +MEMCACHED_DESC= Use memcached to improve performance +SUBVERSION_DESC=Install Subversion + +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 -.if ${PORT_OPTIONS:MDOCS} - ${MKDIR} ${DOCSDIR} +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} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/${docs} ${STAGEDIR}/${DOCSDIR} .endfor -.endif -.include +.include Index: textproc/pootle/distinfo =================================================================== --- textproc/pootle/distinfo +++ textproc/pootle/distinfo @@ -1,2 +1,2 @@ -SHA256 (Pootle-2.1.6.tar.bz2) = 1f3b492b76914596b01ebe040a59d9df10ffdf29a58ab9a4600f2f49dccd298e -SIZE (Pootle-2.1.6.tar.bz2) = 2921970 +SHA256 (Pootle-2.5.1.3.tar.bz2) = f0303896af702f6bc6cbd7f28fae9478f3f11e804c6f0194c1fb34d2557f4243 +SIZE (Pootle-2.5.1.3.tar.bz2) = 6387947 Index: textproc/pootle/files/patch-pootle_apps_djblets_util_fields.py =================================================================== --- textproc/pootle/files/patch-pootle_apps_djblets_util_fields.py +++ 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 + + Index: textproc/pootle/files/patch-pootle_apps_pootle__app_views_admin_dashboard.py =================================================================== --- textproc/pootle/files/patch-pootle_apps_pootle__app_views_admin_dashboard.py +++ 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 Index: textproc/pootle/files/patch-pootle_apps_pootle__misc_forms.py =================================================================== --- textproc/pootle/files/patch-pootle_apps_pootle__misc_forms.py +++ 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): Index: textproc/pootle/files/patch-pootle_apps_pootle__misc_util.py =================================================================== --- textproc/pootle/files/patch-pootle_apps_pootle__misc_util.py +++ 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 + Index: textproc/pootle/files/patch-pootle_apps_pootle__store_models.py =================================================================== --- textproc/pootle/files/patch-pootle_apps_pootle__store_models.py +++ 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() Index: textproc/pootle/files/patch-pootle_apps_pootle__store_views.py =================================================================== --- textproc/pootle/files/patch-pootle_apps_pootle__store_views.py +++ 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 Index: textproc/pootle/files/patch-pootle_apps_pootle__terminology_views.py =================================================================== --- textproc/pootle/files/patch-pootle_apps_pootle__terminology_views.py +++ 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 . + + 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): Index: textproc/pootle/files/patch-pootle_apps_registration_models.py =================================================================== --- textproc/pootle/files/patch-pootle_apps_registration_models.py +++ 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) + Index: textproc/pootle/files/patch-pootle_middleware_captcha.py =================================================================== --- textproc/pootle/files/patch-pootle_middleware_captcha.py +++ 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 _ + + Index: textproc/pootle/files/patch-pootle_middleware_errorpages.py =================================================================== --- textproc/pootle/files/patch-pootle_middleware_errorpages.py +++ 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 _ + Index: textproc/pootle/files/pootle.in =================================================================== --- textproc/pootle/files/pootle.in +++ textproc/pootle/files/pootle.in @@ -4,6 +4,7 @@ # # PROVIDE: pootle # REQUIRE: DAEMON +# KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to run pootle: # @@ -22,6 +23,13 @@ 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%%" @@ -29,25 +37,29 @@ command="%%PREFIX%%/bin/PootleServer" -load_rc_config $name -: ${pootle_enable="NO"} -: ${pootle_user="%%POOTLEUSER%%"} -: ${pootle_logdir="%%POOTLELOGDIR%%"} - -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 - -start_cmd="pootle_start_cmd" +start_command=pootle_start_cmd +start_precmd=pootle_start_precmd -pootle_start_cmd () { +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"