1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

textproc/pootle: update to 2.8.2

This version does not fully work yet, but neither does version 2.5.1.3 anymore.
Furthermore, version 2.5.1.3 was last updated upstream on 2015-06-03

- License switched from GPL2 to GPL3
- Switch from CHEESESHOP to GitHub
- LDAP support has been (temporarily) dropped upstream
- MEMCACHED has been replaced by Redis
- Switch default database to SQLite for easier testing
This commit is contained in:
Rene Ladan 2018-10-07 10:58:42 +00:00
parent 66a70b67cb
commit fcc6f4a1ab
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=481439
13 changed files with 62 additions and 235 deletions

View File

@ -2,71 +2,90 @@
# $FreeBSD$
PORTNAME= pootle
PORTVERSION= 2.5.1.3
PORTREVISION= 3
DISTVERSION= 2.8.2
CATEGORIES= textproc
MASTER_SITES= CHEESESHOP
DISTNAME= Pootle-${PORTVERSION}
MAINTAINER= rene@FreeBSD.org
COMMENT= User-friendly web portal for simple translation process
LICENSE= GPLv2
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= translate-toolkit>=1.11.0:textproc/translate-toolkit \
${PYTHON_PKGNAMEPREFIX}argparse>=0:devel/py-argparse@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}cssmin>=0.1.4:www/py-cssmin@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}south>=0.7.6:databases/py-south@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}lxml>=2.1.4:devel/py-lxml@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-assets>=0.8:www/py-django-assets@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-taggit>0.10:www/py-django-taggit@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-voting>=0.1:www/py-django-voting@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}south>=0.7.6:databases/py-south@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}diff-match-patch>=0:textproc/py-diff-match-patch@${PY_FLAVOR}
# actually diff-match-patch is a dependency of translate-toolkit,
# but only this port uses it.
RUN_DEPENDS= translate-toolkit>=2.2.5:textproc/translate-toolkit \
${PYTHON_PKGNAMEPREFIX}Babel>=2.5.1:devel/py-babel@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}bleach>=2.0.0:www/py-bleach@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}country>=17.5.14:devel/py-country@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}cssmin>=0.2.0:www/py-cssmin@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}dateutil>=2.6.1:devel/py-dateutil@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}diff-match-patch>=20121119:textproc/py-diff-match-patch@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}dirsync>=2.2.2:sysutils/py-dirsync@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-allauth>=0.33.0:www/py-django-allauth@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-assets>=0.12:www/py-django-assets@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-bulk-update>=2.2.0:www/py-django-bulk-update@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-contact-form>=1.4.2:www/py-django-contact-form@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-contrib-comments>=1.7.3:www/py-django-contrib-comments@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-overextends>=0.4.3:www/py-django-overextends@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-redis>=4.8.0:www/py-django-redis@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-rq>=0.9.6:devel/py-django-rq@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-sortedm2m>=1.5.0:www/py-django-sortedm2m@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django-statici18n>=1.4.0:www/py-django-statici18n@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}jsonfield>=2.0.2:www/py-jsonfield@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}lxml>=3.5:devel/py-lxml@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}markdown>=2.6.9:textproc/py-markdown@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pathlib>=1.0.1:devel/py-pathlib@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-Levenshtein>=0.12.0:devel/py-python-Levenshtein@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytz>=2017.2:devel/py-pytz@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}raven>=6.1.0:devel/py-raven@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}scandir>=1.5:sysutils/py-scandir@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}stemming>=1.0.1:textproc/py-stemming@${PY_FLAVOR}
NO_ARCH= yes
USES= gettext python:2.7 tar:bzip2 shebangfix
USE_PYTHON= autoplist distutils
SHEBANG_FILES= pootle/assets/admin/js/compress.py
USE_GITHUB= yes
GH_ACCOUNT= translate
NO_ARCH= yes
USERS= pootle
GROUPS= pootle
PLIST_SUB+= POOTLEUSER="${USERS}" \
POOTLEGROUP="${GROUPS}"
SUB_LIST+= POOTLEUSER="${USERS}" \
POOTLEGROUP="${GROUPS}" \
POOTLERUNDIR="/var/run/${PORTNAME}/"
USE_RC_SUBR= pootle
SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}"
PORTDOCS= CREDITS INSTALL LICENSE
PORTDOCS= AUTHORS CONTRIBUTING.rst INSTALL README.rst
OPTIONS_DEFINE= DOCS LDAP MEMCACHED
OPTIONS_DEFINE= DOCS
OPTIONS_GROUP= DB
DB_DESC= Database backend
OPTIONS_GROUP_DB=MYSQL PGSQL
OPTIONS_DEFAULT=MEMCACHED MYSQL
MEMCACHED_DESC= Use memcached to improve performance
LDAP_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}ldap2>0:devel/py-ldap2@${PY_FLAVOR}
MEMCACHED_LIB_DEPENDS= libmemcached.so:databases/libmemcached
MEMCACHED_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}python-memcached>=1.45:databases/py-python-memcached@${PY_FLAVOR}
OPTIONS_GROUP_DB=MYSQL PGSQL SQLITE
OPTIONS_DEFAULT=SQLITE
MYSQL_USES= mysql:client
MYSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}MySQLdb>0:databases/py-MySQLdb@${PY_FLAVOR}
PGSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}psycopg2>0:databases/py-psycopg2@${PY_FLAVOR}
MYSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mysqlclient>=1.3.3:databases/py-mysqlclient@${PY_FLAVOR}
PGSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}psycopg2>=2.4.5:databases/py-psycopg2@${PY_FLAVOR}
SQLITE_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>=0:databases/py-sqlite3@${PY_FLAVOR}
post-extract:
${RM} ${WRKSRC}/tests/__init__.py # prevent conflict with py-django-bulk-update dependency
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" \
# switch off pip checks
${REINPLACE_CMD} -e '/^check_pep440_versions()/d' ${WRKSRC}/setup.py
# relax versions for packaging
${REINPLACE_CMD} -e "s/==/>=/g" \
-e "s/~=/>=/g" \
-e "s/,<=.*//g" \
${WRKSRC}/requirements/base.txt
# fix django-bulk-update invocations
${REINPLACE_CMD} -e "s/bulk_update.helper/django_bulk_update.helper/g" \
${WRKSRC}/pootle/core/batch.py \
${WRKSRC}/pootle/core/bulk.py \
${WRKSRC}/pootle/apps/pootle_store/migrations/0054_clean_abs_file_paths.py \
${WRKSRC}/pootle/apps/pootle_fs/plugin.py
post-install-DOCS-on:
${MKDIR} ${STAGEDIR}/${DOCSDIR}

View File

@ -1,2 +1,3 @@
SHA256 (Pootle-2.5.1.3.tar.bz2) = f0303896af702f6bc6cbd7f28fae9478f3f11e804c6f0194c1fb34d2557f4243
SIZE (Pootle-2.5.1.3.tar.bz2) = 6387947
TIMESTAMP = 1505559121
SHA256 (translate-pootle-2.8.2_GH0.tar.gz) = b8cc5e05066fe2517ca03882ef41eaa22ac5e47b6918591aaf3d8fa36fd0e5a2
SIZE (translate-pootle-2.8.2_GH0.tar.gz) = 8498394

View File

@ -1,11 +0,0 @@
--- 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

View File

@ -1,11 +0,0 @@
--- 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

View File

@ -1,11 +0,0 @@
--- 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):

View File

@ -1,12 +0,0 @@
--- 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

View File

@ -1,58 +0,0 @@
--- 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()

View File

@ -1,12 +0,0 @@
--- 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

View File

@ -1,20 +0,0 @@
--- 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):

View File

@ -1,36 +0,0 @@
--- 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)

View File

@ -1,11 +0,0 @@
--- 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 _

View File

@ -1,11 +0,0 @@
--- 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 _

View File

@ -5,4 +5,4 @@ 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
WWW: http://docs.translatehouse.org/projects/pootle/