summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-10-14 20:50:49 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2022-10-19 17:18:14 -0400
commit002a3cf6a8b407133736b39f2f8d5fddd04822ed (patch)
tree4fa6a6a48cdc41f5510a9630926eff1c8ea65bda
parent0bcfc852caa1e548c59a7f19818be980cb5d8b47 (diff)
sq goblin python depswip-mediagoblin
-rw-r--r--pcr/mediagoblin/PKGBUILD176
1 files changed, 119 insertions, 57 deletions
diff --git a/pcr/mediagoblin/PKGBUILD b/pcr/mediagoblin/PKGBUILD
index aba11d263..5c7f7b068 100644
--- a/pcr/mediagoblin/PKGBUILD
+++ b/pcr/mediagoblin/PKGBUILD
@@ -6,25 +6,52 @@
# parabola changes and rationale:
# - allow building offline (no pip, npm, etc)
# - dependencies packaged only for mediagoblin:
-# * python-billiard3
-# * python-celery4.2
-# * python-docutils0.16
+# * python-amqp2 (down-grade of 'python-amqp')
+# * python-billiard3 (down-grade of 'python-billiard')
+# * python-celery4.2 (down-grade of 'python-celery')
+# * python-docutils0.16 (down-grade of 'python-docutils')
# * python-exifread
-# * python-jinja2
-# * python-kombu4
-# * python-markupsafe2.0 <- python-jinja2
+# * python-jinja2 (down-grade of 'python-jinja')
+# * python-kombu4 (down-grade of 'python-kombu')
+# * python-markupsafe2.0 <- python-jinja2 (down-grade of 'python-markupsafe')
# * python-pastescript
# * python-pyld
# * python-soundfile
-# * python-sphinx4
-# * python-vine1.3
-# * python-werkzeug1
-# * python-wtforms2
-# file conflicts:
+# * python-sphinx4 (down-grade of 'python-sphinx')
+# * python-vine1.3 (down-grade of 'python-vine')
+# * python-werkzeug1 (down-grade of 'python-werkzeug')
+# * python-wtforms2 (down-grade of 'python-wtforms')
+# NOTE: Several run-time dependencies are needed because they provide library wrappers
+# under /usr/bin, with which this package would clobber/conflict ('lib wrappers' below).
+# Consequently, several (more) of the down-graded build dependencies above
+# are also run-time dependencies ('down-grades' below).
+# * python-amqp2 -> python-amqp
+# * python-billiard3 -> python-billiard
+# * python-vine1.3 -> python-vine
+# * python-kombu4 -> python-kombu
+
+# TODO: Like many "modern-web apps", this build expects to download a large set of
+# dependencies from the internet at build time; which is against parabola's policy.
+# This recipe is currently de-pipped (all python deps are packaged for parabola);
+# but does not yet address any javascript dependencies (eg: per 'npm'/'bower').
+# ie: the web interface (if the service starts at all) is probably completely broken.
+
+# FIXME: file conflicts:
# mediagoblin: /usr/bin/jsonschema ekzistas en dosiersistemo (python-jsonschema ĝin posedas)
# mediagoblin: /usr/bin/markdown_py ekzistas en dosiersistemo (python-markdown ĝin posedas)
# mediagoblin: /usr/bin/pybabel ekzistas en dosiersistemo (python-babel ĝin posedas)
# mediagoblin: /usr/bin/pygmentize ekzistas en dosiersistemo (python-pygments ĝin posedas)
+# probalby we want only `/usr/bin/gmg`
+# $ ls pkg/mediagoblin/usr/bin
+# alembic* email_validator* jsonschema* markdown_py* pybabel* sphinx-apidoc* sphinx-build* unidecode*
+# celery* gmg* mako-render* paster* pygmentize* sphinx-autogen* sphinx-quickstart* waitress-serve*
+# for ea in $(ls /build/mediagoblin/pkg/mediagoblin/usr/bin/) ; do pacman -Qo /usr/bin/$ea || echo $ea NFG ; done
+# :: ne povas plenumi dependaĵon 'python-celery4.2' postulita de mediagoblin
+# :: ne povas plenumi dependaĵon 'python-pastescript' postulita de mediagoblin
+# :: ne povas plenumi dependaĵon 'python-sphinx4' postulita de mediagoblin
+# https://tracker.debian.org/media/packages/m/mediagoblin/rules-0.9.0~dfsg-1~exp4
+# https://git.savannah.gnu.org/cgit/mediagoblin.git/tree/guix-env.scm
+# sudo pacman -R python-alembic python-amqp python-billiard python-case python-dateutil python-editor python-email-validator python-kombu python-mako python-nose python-sqlalchemy python-unidecode python-vine python-waitress mediagoblin python-celery4.2 python-pastescript python-sphinx4
pkgname=mediagoblin
@@ -32,37 +59,24 @@ pkgver=0.12.0
pkgrel=1
pkgdesc="A free software media publishing platform"
url=https://mediagoblin.org
-license=(AGPL)
+license=(AGPL custom:CC0) # licenses dir also contains LGPL and CC0
arch=(armv7h i686 x86_64)
depends=(nodejs python-lxml python-pillow sqlite)
-makedepends=(
-python-alembic
-python-amqp2
-python-babel
-python-bcrypt
-python-billiard3
-python-celery4.2
-python-certifi
-python-configobj
-python-dateutil
-python-docutils0.16
-python-email-validator
-python-exifread
-python-feedgenerator
-python-itsdangerous
-python-jinja2
-python-jsonschema
-python-kombu4
-python-markdown
-python-oauthlib
-python-paste
-python-pastedeploy
-python-pastescript python-pyld=1.0.5 python-setuptools python-soundfile python-sphinx4 python-sqlalchemy1.3 python-unidecode
-python-vine1.3
-python-waitress python-werkzeug1 python-wtforms2)
+depends+=(python-alembic python-babel python-celery4.2 python-email-validator
+ python-jsonschema python-mako python-markdown python-pastescript
+ python-pygments python-sphinx4 python-unidecode python-waitress) # lib wrappers (see note above)
+depends+=(python-amqp2 python-billiard3 python-vine1.3 python-kombu4 ) # down-grades (see note above)
+makedepends=(python-amqp2 python-bcrypt python-billiard3 python-certifi python-configobj
+ python-dateutil python-docutils0.16 python-exifread python-feedgenerator
+ python-itsdangerous python-jinja2 python-kombu4 python-oauthlib python-paste
+ python-pastedeploy python-pyld=1.0.5 python-setuptools python-soundfile
+ python-sqlalchemy1.3 python-vine1.3 python-werkzeug1 python-wtforms2)
optdepends=('postgresql: to use the postgresql database backend'
'python-psycopg2: to use the postgresql database backend'
'python-gobject: to handle videos'
+ 'python-ldap: for LDAP plugin'
+ 'python-openid: for LDAP plugin'
+ 'python-requests: for `batchaddmedia.py`'
'gst-libav: to handle videos'
'gst-python: to handle videos'
'gst-plugins-good: to handle videos'
@@ -103,6 +117,15 @@ prepare()
# offered upstream https://lists.gnu.org/archive/html/mediagoblin-devel/2022-10/msg00001.html
echo "applying ac.patch"
patch -Np1 < "${srcdir}"/ac.patch
+
+ # TODO: The extlib/ directory is partially populated, and has stub dirs for git-modules/
+ # For now, we are simply deleting them, assuming that they are non-essential.
+ # If they are later found to be required for this build, note that neither the
+ # 'licenses' array nor the mediagoblin documentation accounts for their licenses.
+ # * extlib/thingiview.js is apparently the reason for licenses/LGPLv3.txt
+ # * extlib/inconsolata and extlib/lato are under the OFL_1.1 (OFL_1.1.txt)
+ # * extlib/inconsolata is packaged (community/ttf-inconsolata)
+ rm -rf extlib/
}
build()
@@ -110,33 +133,72 @@ build()
cd "${srcdir}"/${pkgname}-${pkgver}
./bootstrap.sh
- ./configure --prefix=/usr
+ ./configure --prefix=/usr --without-virtualenv # NOTE: expect removes "unrecognized option" per ac.patch
make
+ cd docs ; make html info ;
}
package()
{
+# return 0
+
cd "${srcdir}"/${pkgname}-${pkgver}
make DESTDIR="${pkgdir}" install
-return 0
- install -dm755 "${pkgdir}"/usr/share/webapps/mediagoblin/
- cp -a . "${pkgdir}"/usr/share/webapps/mediagoblin
- find "${pkgdir}"/usr/share/webapps/mediagoblin -name '*.pyc' -delete
- find "${pkgdir}"/usr/share/webapps/mediagoblin -type f -exec sed -Ei \
- "s|${srcdir}/${pkgname}(-${pkgver})?|/usr/share/webapps/${pkgname}|g" {} \;
-
- install -dm755 "${pkgdir}"/etc/webapps/mediagoblin
- install -Dm644 "${srcdir}"/paste_local.ini "${pkgdir}"/etc/webapps/mediagoblin/paste_local.ini
- install -Dm644 "${srcdir}"/mediagoblin_local.ini "${pkgdir}"/etc/webapps/mediagoblin/mediagoblin_local.ini
- ln -s /etc/webapps/mediagoblin/paste_local.ini "${pkgdir}"/usr/share/webapps/mediagoblin/paste_local.ini
- ln -s /etc/webapps/mediagoblin/mediagoblin_local.ini "${pkgdir}"/usr/share/webapps/mediagoblin/mediagoblin_local.ini
-
- install -dm755 "${pkgdir}"/var/lib/mediagoblin
- ln -s /var/lib/mediagoblin/ "${pkgdir}"/usr/share/webapps/mediagoblin/user_dev
-
- install -Dm644 "${srcdir}"/mediagoblin-paster.service "${pkgdir}"/usr/lib/systemd/system/mediagoblin-paster.service
- install -Dm644 "${srcdir}"/mediagoblin-celeryd.service "${pkgdir}"/usr/lib/systemd/system/mediagoblin-celeryd.service
- install -Dm644 "${srcdir}"/mediagoblin-tmpfiles.conf "${pkgdir}"/usr/lib/tmpfiles.d/mediagoblin.conf
+ # delete library wrappers which conflict with system depends=() packages
+ rm "${pkgdir}"/usr/bin/{alembic,email_validator,jsonschema,markdown_py,pybabel}
+ rm "${pkgdir}"/usr/bin/{sphinx-apidoc,sphinx-build,unidecode,celery,mako-render,paster}
+ rm "${pkgdir}"/usr/bin/{pygmentize,sphinx-autogen,sphinx-quickstart,waitress-serve}
+
+ local python_ver=3.10
+ local eggs_dir=/usr/lib/python${python_ver}/site-packages
+ local egg_dir=${eggs_dir}/${pkgname}-${pkgver}-py${python_ver}.egg/${pkgname}
+ local www_dir=/usr/share/webapps/${pkgname}
+ local config_dir=/etc/webapps/${pkgname}
+ local lib_dir=/var/lib/mediagoblin
+ local docs_dir="${pkgdir}"/usr/share/doc
+ local info_dir="${pkgdir}"/usr/share/info
+ local licenses_dir="${pkgdir}"/usr/share/licenses
+ local systemd_dir="${pkgdir}"/usr/lib/systemd/system
+ local tmpfiles_dir="${pkgdir}"/usr/lib/tmpfiles.d
+
+ # purge pickles
+ find "${pkgdir}"${egg_dir} -name '*.pyc' -delete
+
+ # install www root
+ install -dm755 "${pkgdir}"${www_dir}
+ cp -a "${pkgdir}"${egg_dir}/* "${pkgdir}"${www_dir}/
+
+ # prepare uploads directory
+ install -dm755 "${pkgdir}"${lib_dir}
+ ln -s ${lib_dir} "${pkgdir}"${www_dir}/user_dev
+
+ # install documentation
+ install -dm755 "${docs_dir}"
+ install -dm755 "${info_dir}"
+ cp -a docs/build/html "${docs_dir}"/${pkgname}
+ install -Dm644 docs/build/texinfo/mediagoblin.info "${info_dir}"/${pkgname}.info
+
+ # install documentation license
+ install -dm755 "${licenses_dir}"
+ install -Dm644 licenses/CC0_1.0.txt "${licenses_dir}"/${pkgname}/CC0_1.0.txt
+
+ cd "${srcdir}"/
+
+ # install server configs
+ install -dm755 "${pkgdir}"${config_dir}
+ install -Dm644 paste_local.ini "${pkgdir}"${config_dir}/paste_local.ini
+ install -Dm644 mediagoblin_local.ini "${pkgdir}"${config_dir}/mediagoblin_local.ini
+ ln -s ${config_dir}/paste_local.ini "${pkgdir}"${www_dir}/paste_local.ini
+ ln -s ${config_dir}/mediagoblin_local.ini "${pkgdir}"${www_dir}/mediagoblin_local.ini
+
+ # install systemd service files
+ install -dm755 "${systemd_dir}"
+ install -dm755 "${tmpfiles_dir}"
+ install -Dm644 mediagoblin-paster.service "${systemd_dir}"/mediagoblin-paster.service
+ install -Dm644 mediagoblin-celeryd.service "${systemd_dir}"/mediagoblin-celeryd.service
+ install -Dm644 mediagoblin-tmpfiles.conf "${tmpfiles_dir}"/mediagoblin.conf
+
+ # TODO: install non-systemd service files
}