[arch-commits] Commit in (8 files)

David Runge dvzrv at archlinux.org
Tue Jan 14 11:48:07 UTC 2020


    Date: Tuesday, January 14, 2020 @ 11:48:07
  Author: dvzrv
Revision: 552486

Adding postorius (optdepends for mailman3).

Added:
  postorius/
  postorius/repos/
  postorius/trunk/
  postorius/trunk/PKGBUILD
  postorius/trunk/postorius-1.3.2-settings.patch
  postorius/trunk/postorius.sysusers
  postorius/trunk/postorius.tmpfiles
  postorius/trunk/postorius.uwsgi

--------------------------------+
 PKGBUILD                       |   81 +++++++++++++++++++++++++++++++++++++++
 postorius-1.3.2-settings.patch |   39 ++++++++++++++++++
 postorius.sysusers             |    1 
 postorius.tmpfiles             |    4 +
 postorius.uwsgi                |   17 ++++++++
 5 files changed, 142 insertions(+)

Added: postorius/trunk/PKGBUILD
===================================================================
--- postorius/trunk/PKGBUILD	                        (rev 0)
+++ postorius/trunk/PKGBUILD	2020-01-14 11:48:07 UTC (rev 552486)
@@ -0,0 +1,81 @@
+# Maintainer: David Runge <dvzrv at archlinux.org>
+
+pkgname=postorius
+pkgver=1.3.2
+pkgrel=1
+pkgdesc="The New Mailman Web UI"
+arch=('any')
+url="https://gitlab.com/mailman/postorius"
+license=('GPL3')
+depends=('python-cmarkgfm' 'python-django' 'python-django-mailman3'
+'python-mailmanclient' 'python-readme-renderer')
+makedepends=('python-setuptools')
+checkdepends=('mailman3' 'python-beautifulsoup4' 'python-isort' 'python-mock'
+'python-pytest' 'python-pytest-django' 'python-vcrpy')
+optdepends=('uwsgi-plugin-python: for running inside uwsgi')
+replaces=('python-django-postorius')
+backup=("etc/uwsgi/${pkgname}.ini"
+        "etc/webapps/${pkgname}/settings.py")
+source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.asc}
+        "${pkgname}.sysusers"
+        "${pkgname}.tmpfiles"
+        "${pkgname}.uwsgi"
+        "${pkgname}-1.3.2-settings.patch")
+sha512sums=('41ff225fa574dd4bd0ac88419a10a55a71c52a64df01a1a593963fdfa62baf16a0df735364688ea24680c8e88093841892474279d40c1428948375db7eb6333b'
+            'SKIP'
+            '3884b818da2deb148279e50316f720c95f0aaa529777b1b3662d8ab253cda823a90682a9eb47e941ca5ba80eefcb9a2d4afacd29f0340d7f9828b36ebcee23b3'
+            '0be8c2bac3feb69519a8d7039002b43b7a705db638d7385b925a4c9fd6ba70d4707954872cabbe5fab2176f48d48fabd8f31338064bb630d02ad1380536915c4'
+            'f7ec287cac22679166398f53b6db440f0defa022554dd8997092b99eab972bb8ba8d158e7415da939645d2e5ff298e496eb46011c6391b9857e6405c9f0c2c47'
+            '811d52a246d55c900ee07cdb7572410aebc7eff05261166287c196ae9994079ee3e925bbf5e539155ecf452328316ae8dac2176dfb4398df1acb519a2accf0b8')
+validpgpkeys=('541EA0448453394FF77A0ECC9D9B2BA061D0A67C') # Abhilash Raj <raj.abhilash1 at gmail.com>
+
+prepare() {
+  cd "$pkgname-$pkgver"
+  # patch global paths into settings.py
+  patch -Np1 -i "../${pkgname}-1.3.2-settings.patch"
+}
+
+build() {
+  cd "$pkgname-$pkgver"
+  python setup.py build
+}
+
+check() {
+  cd "$pkgname-$pkgver"
+  local python_stdlib_basepath="$(python -c "from sysconfig import get_path; print(get_path('stdlib'))")"
+  # install to temporary location, so that tests can run
+  python setup.py install --root="${PWD}/tmp_install" --optimize=1
+  export PYTHONPATH="${PWD}/tmp_install/${python_stdlib_basepath/\//}/site-packages:${PYTHONPATH}"
+  cd example_project/
+  pytest -v "../tmp_install/${python_stdlib_basepath/\//}/site-packages/${pkgname}"
+}
+
+package() {
+  cd "$pkgname-$pkgver"
+  local python_stdlib_basepath="$(python -c "from sysconfig import get_path; print(get_path('stdlib'))")"
+  python setup.py install --skip-build \
+    --optimize=1 \
+    --prefix=/usr \
+    --root="${pkgdir}"
+  # django project
+  install -vDm 644 example_project/{__init__,manage,urls,wsgi}.py \
+    -t "${pkgdir}/usr/share/webapps/${pkgname}"
+  # symlink locale and static files (instead of generating them)
+  ln -svf "$python_stdlib_basepath/site-packages/${pkgname}/locale/" \
+    "${pkgdir}/usr/share/webapps/${pkgname}"
+  ln -svf "$python_stdlib_basepath/site-packages/${pkgname}/static/" \
+    "${pkgdir}/usr/share/webapps/${pkgname}"
+  # config
+  install -vDm 640 example_project/settings.py \
+    -t "${pkgdir}/etc/webapps/${pkgname}"
+  ln -svf "/etc/webapps/${pkgname}/settings.py" \
+    "${pkgdir}/usr/share/webapps/${pkgname}/settings.py"
+  # uwsgi
+  install -vDm 644 "../${pkgname}.uwsgi" "${pkgdir}/etc/uwsgi/${pkgname}.ini"
+  # tmpfiles.d
+  install -vDm 644 "../${pkgname}.tmpfiles" \
+    "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
+  # sysusers.d
+  install -vDm 644 "../${pkgname}.sysusers" \
+    "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
+}

Added: postorius/trunk/postorius-1.3.2-settings.patch
===================================================================
--- postorius/trunk/postorius-1.3.2-settings.patch	                        (rev 0)
+++ postorius/trunk/postorius-1.3.2-settings.patch	2020-01-14 11:48:07 UTC (rev 552486)
@@ -0,0 +1,39 @@
+diff -ruN a/example_project/settings.py b/example_project/settings.py
+--- a/example_project/settings.py	2019-04-22 07:45:09.000000000 +0200
++++ b/example_project/settings.py	2020-01-13 23:13:35.505547214 +0100
+@@ -33,7 +33,7 @@
+ from django.contrib.messages import constants as messages
+ 
+ 
+-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
++BASE_DIR = '/'
+ 
+ 
+ # Quick-start development settings - unsuitable for production
+@@ -136,7 +136,7 @@
+ DATABASES = {
+     'default': {
+         'ENGINE': 'django.db.backends.sqlite3',
+-        'NAME': os.path.join(BASE_DIR, 'postorius.db'),
++        'NAME': os.path.join(BASE_DIR, '/var/lib/', 'postorius.db'),
+     }
+ }
+ 
+@@ -180,7 +180,7 @@
+ # Don't put anything in this directory yourself; store your static files
+ # in apps' "static/" subdirectories and in STATICFILES_DIRS.
+ # Example: "/var/www/example.com/static/"
+-STATIC_ROOT = os.path.join(BASE_DIR, 'static')
++STATIC_ROOT = os.path.join(BASE_DIR, '/usr/share/webapps/postorius', 'static')
+ 
+ # URL prefix for static files.
+ # Example: "http://example.com/static/", "http://static.example.com/"
+@@ -259,7 +259,7 @@
+             'level': 'INFO',
+             #'class': 'logging.handlers.RotatingFileHandler',
+             'class': 'logging.handlers.WatchedFileHandler',
+-            'filename': os.path.join(BASE_DIR, 'logs', 'postorius.log'),
++            'filename': os.path.join(BASE_DIR, '/var/log/postorius/', 'postorius.log'),
+             'formatter': 'verbose',
+         },
+     },

Added: postorius/trunk/postorius.sysusers
===================================================================
--- postorius/trunk/postorius.sysusers	                        (rev 0)
+++ postorius/trunk/postorius.sysusers	2020-01-14 11:48:07 UTC (rev 552486)
@@ -0,0 +1 @@
+u postorius - "GNU Mailman Web User Interface" -

Added: postorius/trunk/postorius.tmpfiles
===================================================================
--- postorius/trunk/postorius.tmpfiles	                        (rev 0)
+++ postorius/trunk/postorius.tmpfiles	2020-01-14 11:48:07 UTC (rev 552486)
@@ -0,0 +1,4 @@
+z /etc/webapps/postorius/settings.py 0640 root postorius -
+d %L/postorius - postorius postorius -
+d %S/postorius - postorius postorius -
+d %t/postorius - postorius postorius -

Added: postorius/trunk/postorius.uwsgi
===================================================================
--- postorius/trunk/postorius.uwsgi	                        (rev 0)
+++ postorius/trunk/postorius.uwsgi	2020-01-14 11:48:07 UTC (rev 552486)
@@ -0,0 +1,17 @@
+[uwsgi]
+procname-master = postorius
+master = true
+plugins = python
+socket = /run/postorius/%n.sock
+stats = /run/postorius/%n-stats.sock
+uid = postorius
+gid = postorius
+processes = 10
+cheaper = 2
+cheaper-step = 1
+idle = 120
+die-on-idle = true
+chdir = /usr/share/webapps
+module = postorius.wsgi
+home = /
+vacuum = true



More information about the arch-commits mailing list