summaryrefslogtreecommitdiff
path: root/pcr/mediagoblin
diff options
context:
space:
mode:
authorIsaac David <isacdaavid@isacdaavid.info>2017-08-19 21:59:13 -0500
committerIsaac David <isacdaavid@isacdaavid.info>2017-08-19 21:59:13 -0500
commita4271086f7889d9362a11ebc8842e7e059be60c0 (patch)
tree523af552e22d8311f8370fbda84f7a1b45fc49ed /pcr/mediagoblin
parent7fe9b0e80355ef62638712e7366d752c86603603 (diff)
downloadabslibre-a4271086f7889d9362a11ebc8842e7e059be60c0.tar.gz
abslibre-a4271086f7889d9362a11ebc8842e7e059be60c0.tar.bz2
abslibre-a4271086f7889d9362a11ebc8842e7e059be60c0.zip
mediagoblin 0.9.0: add new package to [pcr]
Diffstat (limited to 'pcr/mediagoblin')
-rw-r--r--pcr/mediagoblin/PKGBUILD85
-rw-r--r--pcr/mediagoblin/mediagoblin-celeryd.service17
-rw-r--r--pcr/mediagoblin/mediagoblin-paster.service19
-rw-r--r--pcr/mediagoblin/mediagoblin-tmpfiles.conf2
-rwxr-xr-xpcr/mediagoblin/mediagoblin.install29
-rw-r--r--pcr/mediagoblin/mediagoblin_local.ini64
-rw-r--r--pcr/mediagoblin/paste_local.ini86
7 files changed, 302 insertions, 0 deletions
diff --git a/pcr/mediagoblin/PKGBUILD b/pcr/mediagoblin/PKGBUILD
new file mode 100644
index 000000000..bda9ee821
--- /dev/null
+++ b/pcr/mediagoblin/PKGBUILD
@@ -0,0 +1,85 @@
+# Maintainer (AUR): Immae <ismael.bouya@normalesup.org>
+# Maintainer: Isaac David <isacdaavid@at@isacdaavid@dot@info>
+
+pkgname=mediagoblin
+pkgver=0.9.0
+pkgrel=4
+pkgdesc='A free software media publishing platform'
+arch=('i686' 'x86_64')
+url='http://mediagoblin.org'
+license=('AGPL')
+provides=('mediagoblin')
+conflicts=('mediagoblin-git')
+depends=('python' 'python-lxml' 'sqlite' 'python-pillow' 'python-virtualenv' 'npm' 'nodejs')
+optdepends=(
+ 'postgresql: to use the postgresql database backend'
+ 'python-psycopg2: to use the postgresql database backend'
+ 'python-gobject: to handle videos'
+ 'gst-libav: to handle videos'
+ 'gst-python: to handle videos'
+ 'gst-plugins-good: to handle videos'
+ 'gst-plugins-bad: to handle videos'
+ 'gst-plugins-ugly: to handle videos'
+ )
+backup=('etc/webapps/mediagoblin/paste_local.ini' 'etc/webapps/mediagoblin/mediagoblin_local.ini')
+install=mediagoblin.install
+makedepends=('git' 'automake')
+mksource=("mediagoblin-$pkgver::git://git.savannah.gnu.org/mediagoblin.git#tag=v$pkgver")
+mksha256sums=('SKIP')
+source=(
+ "https://repo.parabola.nu/other/$pkgname/$pkgname-$pkgver-src.tar.xz"{,.sig}
+ 'mediagoblin-paster.service'
+ 'mediagoblin-celeryd.service'
+ 'paste_local.ini'
+ 'mediagoblin_local.ini'
+ 'mediagoblin-tmpfiles.conf'
+)
+sha256sums=('a37657c686933a21dbf47e095a24c086ea509590f1e6bf95a63fe8779c198d31'
+ 'SKIP'
+ '2a02c90dcc8f69ac2a072044d3e4281347ed048c2610cb2e11295e4876cfb409'
+ 'f636d02f86d2dab5ecc901be5b0f7c42366500393f22dfdc7e354ca299fca65a'
+ 'ac914d60886d9bf53d3f40b8b00a60d46ada1cac9130210e045a4776d898e884'
+ '9adf338f5dbfb94ee7ae29433091b6991a1fa39a6135a8295f9f1cc1fde0edc1'
+ 'abb6c4c4e54d4372adfe67ab22371ad625505098311955e5ae8e34102b059d47')
+validpgpkeys=('38D33EF29A7691134357648733466E12EC7BA943') # Isaac David <isacdaavid@isacdaavid@dot@info>
+
+prepare() {
+ cd "$srcdir/mediagoblin-$pkgver"
+ git submodule init
+ git submodule update
+}
+
+build() {
+ cd "$srcdir/mediagoblin-$pkgver"
+
+ ./bootstrap.sh
+ ./configure --with-python3
+ make || make
+ ./bin/easy_install flup
+}
+
+package() {
+ cd "$srcdir/mediagoblin-$pkgver"
+ rm -rf .git .gitignore
+
+ install -dm755 "$pkgdir"/usr/share/webapps/mediagoblin/
+ cp -a . "$pkgdir"/usr/share/webapps/mediagoblin
+
+ cd "$pkgdir"/usr/share/webapps/mediagoblin
+ find . -name '*.pyc' -delete
+ find . -type f -exec sed -i "s|$srcdir/mediagoblin|/usr/share/webapps/mediagoblin|g" {} \;
+
+ install -dm755 "$pkgdir"/var/lib/mediagoblin
+ install -dm755 "$pkgdir"/etc/webapps/mediagoblin
+
+ install -Dm644 "$srcdir"/paste_local.ini "$pkgdir"/etc/webapps/mediagoblin/paste_local.ini
+ ln -s /etc/webapps/mediagoblin/paste_local.ini "$pkgdir"/usr/share/webapps/mediagoblin/paste_local.ini
+ install -Dm644 "$srcdir"/mediagoblin_local.ini "$pkgdir"/etc/webapps/mediagoblin/mediagoblin_local.ini
+ ln -s /etc/webapps/mediagoblin/mediagoblin_local.ini "$pkgdir"/usr/share/webapps/mediagoblin/mediagoblin_local.ini
+
+ 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
+}
diff --git a/pcr/mediagoblin/mediagoblin-celeryd.service b/pcr/mediagoblin/mediagoblin-celeryd.service
new file mode 100644
index 000000000..4100d2111
--- /dev/null
+++ b/pcr/mediagoblin/mediagoblin-celeryd.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Mediagoblin Celeryd
+
+[Service]
+User=mediagoblin
+Group=mediagoblin
+Type=simple
+WorkingDirectory=/usr/share/webapps/mediagoblin/
+Environment=MEDIAGOBLIN_CONFIG=/usr/share/webapps/mediagoblin/mediagoblin_local.ini \
+ CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_celery
+ExecStart=/usr/share/webapps/mediagoblin/bin/celery worker \
+ --logfile=/var/log/mediagoblin/celery.log \
+ --loglevel=INFO
+PIDFile=/var/run/mediagoblin/mediagoblin-celeryd.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/pcr/mediagoblin/mediagoblin-paster.service b/pcr/mediagoblin/mediagoblin-paster.service
new file mode 100644
index 000000000..f640375e6
--- /dev/null
+++ b/pcr/mediagoblin/mediagoblin-paster.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Mediagoblin
+
+[Service]
+Type=simple
+WorkingDirectory=/usr/share/webapps/mediagoblin
+User=mediagoblin
+Group=mediagoblin
+ExecStart=/usr/share/webapps/mediagoblin/bin/paster serve \
+ /usr/share/webapps/mediagoblin/paste_local.ini \
+ --pid-file=/var/run/mediagoblin/mediagoblin.pid \
+ --log-file=/var/log/mediagoblin/mediagoblin.log
+ExecStop=/usr/share/webapps/mediagoblin/bin/paster serve \
+ --pid-file=/var/run/mediagoblin/mediagoblin.pid \
+ /usr/share/webapps/mediagoblin/paste_local.ini stop
+PIDFile=/var/run/mediagoblin/mediagoblin.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/pcr/mediagoblin/mediagoblin-tmpfiles.conf b/pcr/mediagoblin/mediagoblin-tmpfiles.conf
new file mode 100644
index 000000000..daf0e4e55
--- /dev/null
+++ b/pcr/mediagoblin/mediagoblin-tmpfiles.conf
@@ -0,0 +1,2 @@
+D /var/run/mediagoblin 0755 mediagoblin mediagoblin -
+D /var/log/mediagoblin 0755 mediagoblin mediagoblin -
diff --git a/pcr/mediagoblin/mediagoblin.install b/pcr/mediagoblin/mediagoblin.install
new file mode 100755
index 000000000..4149ed0cf
--- /dev/null
+++ b/pcr/mediagoblin/mediagoblin.install
@@ -0,0 +1,29 @@
+pkgname=mediagoblin
+
+post_install() {
+ if [ ! `grep mediagoblin /etc/group` ]; then
+ groupadd mediagoblin &>/dev/null;
+ fi
+
+ id mediagoblin &>/dev/null || \
+ useradd -g mediagoblin -d /var/lib/mediagoblin -s /bin/false mediagoblin
+
+ /usr/bin/systemd-tmpfiles --create mediagoblin.conf
+
+ chown -R mediagoblin:mediagoblin /var/run/mediagoblin /var/lib/mediagoblin
+
+ cd /usr/share/webapps/mediagoblin/
+ /bin/su -s /bin/sh -c "/usr/share/webapps/mediagoblin/bin/gmg dbupdate" mediagoblin
+}
+
+post_upgrade() {
+ cd /usr/share/webapps/mediagoblin/
+ /bin/su -s /bin/sh -c "/usr/share/webapps/mediagoblin/bin/gmg dbupdate" mediagoblin
+}
+
+pre_remove() {
+ /usr/bin/systemd-tmpfiles --remove mediagoblin.conf
+
+ userdel mediagoblin &> /dev/null
+ groupdel mediagoblin &> /dev/null
+}
diff --git a/pcr/mediagoblin/mediagoblin_local.ini b/pcr/mediagoblin/mediagoblin_local.ini
new file mode 100644
index 000000000..2f7753ab7
--- /dev/null
+++ b/pcr/mediagoblin/mediagoblin_local.ini
@@ -0,0 +1,64 @@
+# If you want to make changes to this file, first copy it to
+# mediagoblin_local.ini, then make the changes there.
+#
+# If you don't see what you need here, have a look at mediagoblin/config_spec.ini
+# It defines types and defaults so it's a good place to look for documentation
+# or to find hidden options that we didn't tell you about. :)
+
+# To change the directory you should make sure you change the
+# directory in paste.ini and/or your webserver configuration.
+#
+[DEFAULT]
+data_basedir = "/var/lib/mediagoblin"
+
+[mediagoblin]
+direct_remote_path = /mgoblin_static/
+email_sender_address = "notice@mediagoblin.example.org"
+
+## Uncomment and change to your DB's appropiate setting.
+## Default is a local sqlite db "mediagoblin.db".
+## Don't forget to run `./bin/gmg dbupdate` after having changed it.
+sql_engine = sqlite:///%(data_basedir)s/mediagoblin.db
+
+# Set to false to enable sending notices
+email_debug_mode = true
+
+# Set to false to disable registrations
+allow_registration = true
+
+# Set to false to disable the ability for users to report offensive content
+allow_reporting = true
+
+## Uncomment this to put some user-overriding templates here
+# local_templates = %(data_basedir)s/templates/
+
+## You can set your theme by specifying this (not specifying it will
+## use the default theme). Run `gmg assetlink` to apply the change.
+## The airy and sandyseventiesspeedboat theme comes with GMG; please
+## see the theming docs on how to install other themes.
+# theme = airy
+
+## If you want the terms of service displayed, you can uncomment this
+# show_tos = true
+
+user_privilege_scheme = "uploader,commenter,reporter"
+[storage:queuestore]
+base_dir = %(data_basedir)s/media/queue
+
+[storage:publicstore]
+base_dir = %(data_basedir)s/media/public
+base_url = /mgoblin_media/
+
+[celery]
+CELERY_RESULT_DBURI = sqlite:///%(data_basedir)s/celery.db
+BROKER_URL = sqlite:///%(data_basedir)s/kombu.db
+
+# Put celery stuff here
+
+# Place plugins here, each in their own subsection of [plugins].
+# See http://docs.mediagoblin.org/siteadmin/plugins.html for details.
+[plugins]
+[[mediagoblin.plugins.geolocation]]
+[[mediagoblin.plugins.basic_auth]]
+[[mediagoblin.plugins.processing_info]]
+[[mediagoblin.media_types.image]]
diff --git a/pcr/mediagoblin/paste_local.ini b/pcr/mediagoblin/paste_local.ini
new file mode 100644
index 000000000..ce3f01e85
--- /dev/null
+++ b/pcr/mediagoblin/paste_local.ini
@@ -0,0 +1,86 @@
+# If you want to make changes to this file, first copy it to
+# paste_local.ini, then make the changes there.
+
+[DEFAULT]
+# Set to true to enable web-based debugging messages and etc.
+debug = false
+
+[pipeline:main]
+# pipeline = errors mediagoblin
+pipeline = mediagoblin
+
+[app:mediagoblin]
+use = egg:mediagoblin#app
+config = %(here)s/mediagoblin_local.ini %(here)s/mediagoblin.ini
+# static paths
+/mgoblin_media = %(here)s/user_dev/media/public
+/mgoblin_static = %(here)s/mediagoblin/static
+/theme_static = %(here)s/user_dev/theme_static
+/plugin_static = %(here)s/user_dev/plugin_static
+
+[loggers]
+keys = root
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = INFO
+handlers = console
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)-7.7s [%(name)s] %(message)s
+
+[filter:errors]
+use = egg:mediagoblin#errors
+debug = false
+
+
+##############################
+# Server configuration options
+##############################
+
+# The server that is run by default.
+# By default, should only be accessable locally
+[server:main]
+use = egg:waitress#main
+host = 127.0.0.1
+port = 6543
+# # Gunicorn settings. See http://docs.gunicorn.org/en/19.0/settings.html
+# # for more information about configuring Gunicorn
+# proc_name = gmg
+# reload = true
+# accesslog = -
+
+#######################
+# Helper server configs
+# ---------------------
+# If you are configuring the paste config manually, you can remove
+# these.
+
+# Use this if you want to run on port 6543 and have MediaGoblin be
+# viewable externally
+[server:broadcast]
+use = egg:waitress#main
+host = 0.0.0.0
+port = 6543
+
+# Use this if you want to connect via fastcgi
+[server:fcgi]
+use = egg:flup#fcgi_fork
+host = %(fcgi_host)s
+port = %(fcgi_port)s
+
+[server:http]
+use = egg:waitress#main
+host = %(http_host)s
+port = %(http_port)s