Package: plinth Severity: wishlist Tags: patch This is a suggestion to add a number of binary metapackages, one for each optional plinth module like plinth-mumble, plinth-quassel, etc.
Each module metapackage simply Depends on the required packages for that module, and in its postinst will run "plinth --setup <modulename>". So installing plinth-mumble is equivalent to going to the Mumble page in Plinth, and clicking install. These packages shouldn't need to change often (only if we decide to add/remove required packages for a module). Here are some reasons why we might want to do this: - It provides a more Debian-ish way to setup Plinth modules. - We could start to define tasks that are groups of these metapackages that might be used together. - Possibly, Plinth could use these to install and setup modules. This could also make the uninstall process easier, just remove the module package and run "apt autoremove". I'm attaching 2 patches. The 1st one adds a script to generate the module packages, it can be run using "./debian/rules gen-module-packages". The 2nd patch is the result of running this command. Currently the list of optional modules is manually set in debian/rules. But we could add a command to plinth to get this list. -- James
From 5a1ba66e1131bfc49eca2f41970a74991a0b32da Mon Sep 17 00:00:00 2001 From: James Valleroy <[email protected]> Date: Thu, 8 Dec 2016 14:43:24 -0500 Subject: [PATCH 1/2] Add scripts to generate binary packages for each optional plinth module --- debian/add-module-package | 56 +++++++++++++++++++++++++++++++++ debian/control.in | 79 +++++++++++++++++++++++++++++++++++++++++++++++ debian/rules | 13 ++++++-- 3 files changed, 146 insertions(+), 2 deletions(-) create mode 100755 debian/add-module-package create mode 100644 debian/control.in diff --git a/debian/add-module-package b/debian/add-module-package new file mode 100755 index 0000000..6b295f2 --- /dev/null +++ b/debian/add-module-package @@ -0,0 +1,56 @@ +#!/bin/sh +# Add a binary package for a Plinth module. + +set -e + +if [ "$#" -ne 1 ]; then + echo "Usage: ./debian/add-module-package <modulename>" + exit 1 +fi + +MODULE="$1" + +if grep -q "plinth-$MODULE" debian/control; then + echo "Package plinth-$MODULE already exists in debian/control." + exit 1 +fi + +# Ask plinth for a list of dependencies for this module +DEPS=$(./run --list-dependencies "$MODULE" 2>/dev/null | tr '\n' ', ') + +if [ -z "$DEPS" ]; then + echo "Error: Plinth returned no dependencies for $MODULE module." + exit 1 +fi + +# Add binary package info to debian/control +cat >>debian/control <<EOF + +Package: plinth-$MODULE +Architecture: all +Depends: plinth + , \${misc:Depends} + , $DEPS +Description: $MODULE module for Plinth + This metapackage will setup the $MODULE module for Plinth by + installing required packages and performing any additional + configuration needed. +EOF + +# Create postinst to run plinth setup for this module +cat >"debian/plinth-$MODULE.postinst" <<EOF +#!/bin/sh + +set -e + +case "\$1" in +configure) + plinth --setup-no-install $MODULE + ;; +esac + +#DEBHELPER# + +exit 0 +EOF +chmod +x "debian/plinth-$MODULE.postinst" diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 0000000..34934eb --- /dev/null +++ b/debian/control.in @@ -0,0 +1,79 @@ +Source: plinth +Section: python +Priority: optional +Maintainer: FreedomBox packaging team <[email protected]> +Uploaders: + Tzafrir Cohen <[email protected]> + , Piotr Ożarowski <[email protected]> + , Bdale Garbee <[email protected]> + , Petter Reinholdtsen <[email protected]> + , Sunil Mohan Adapa <[email protected]> + , Nick Daly <[email protected]> + , Federico Ceratto <[email protected]> +Build-Depends: debhelper (>= 9) + , dblatex + , dh-python + , dh-systemd + , docbook-utils + , gir1.2-networkmanager-1.0 + , libjs-bootstrap + , python3-all + , python3-apt + , python3-augeas + , python3-bootstrapform + , python3-cherrypy3 + , python3-coverage + , python3-django (>= 1.10) + , python3-django-stronghold + , python3-gi + , python3-psutil + , python3-requests + , python3-ruamel.yaml + , python3-setuptools + , python3-setuptools-git + , xmlto +Standards-Version: 3.9.8 +Homepage: https://github.com/freedombox/Plinth/ +Vcs-Git: https://anonscm.debian.org/git/freedombox/plinth.git +Vcs-Browser: https://anonscm.debian.org/gitweb/?p=freedombox/plinth.git;a=summary + +Package: plinth +Breaks: freedombox-setup (<< 0.9.2~) +Replaces: freedombox-setup (<< 0.9.2~) +Architecture: all +Depends: ${python3:Depends} + , ${misc:Depends} + , ${plinth:Depends} + , adduser + , augeas-tools + , gettext + , gir1.2-glib-2.0 + , gir1.2-networkmanager-1.0 + , javascript-common + , ldapscripts + , libjs-bootstrap + , libjs-jquery + , libjs-modernizr + , network-manager + , ppp + , pppoe + , python3-apt + , python3-augeas + , python3-bootstrapform + , python3-cherrypy3 + , python3-django (>= 1.10) + , python3-django-stronghold + , python3-gi + , python3-psutil + , python3-requests + , python3-ruamel.yaml + , sudo +Description: web front end for administering every aspect of a FreedomBox + The FreedomBox is a net appliance conceived by Eben Moglen. It + contains free software and is designed to allow you to interface with + the rest of the net under conditions of protected privacy and data + security. + . + The Plinth front end is a web interface to administer the functions of + the FreedomBox. For example, the FreedomBox is a wireless router, + and the front end is where you can adjust its settings. diff --git a/debian/rules b/debian/rules index a54942d..b99d04f 100755 --- a/debian/rules +++ b/debian/rules @@ -3,13 +3,22 @@ export DH_VERBOSE=1 export PYBUILD_NAME=plinth +MODULES = deluge dynamicdns ikiwiki letsencrypt minetest monkeysphere mumble openvpn pagekite privoxy quassel radicale repro roundcube shaarli snapshot tor transmission ttrss xmpp + %: dh $@ --with python3 --with systemd --buildsystem=pybuild override_dh_auto_install-indep: dh_auto_install - ./run --list-dependencies 2> /dev/null | tr '\n' ', ' | \ - sed -e 's/^/plinth:Depends=/' >> debian/plinth.substvars + # Skip for plinth-<module> binary packages + if [ command -v ./run 2>/dev/null ]; then \ + ./run --list-dependencies 2> /dev/null | tr '\n' ', ' | \ + sed -e 's/^/plinth:Depends=/' >> debian/plinth.substvars; \ + fi new-upstream: gbp import-orig --uscan --verbose --pristine-tar --no-filter-pristine-tar + +gen-module-packages: + cp debian/control.in debian/control + $(foreach module,$(MODULES),./debian/add-module-package $(module) || exit;) -- 2.10.2
From ec57db811250e4330915930f30dedcf39449abcb Mon Sep 17 00:00:00 2001 From: James Valleroy <[email protected]> Date: Thu, 8 Dec 2016 14:55:19 -0500 Subject: [PATCH 2/2] Generate module packages --- debian/control | 200 ++++++++++++++++++++++++++++++++++++ debian/plinth-deluge.postinst | 13 +++ debian/plinth-dynamicdns.postinst | 13 +++ debian/plinth-ikiwiki.postinst | 13 +++ debian/plinth-letsencrypt.postinst | 13 +++ debian/plinth-minetest.postinst | 13 +++ debian/plinth-monkeysphere.postinst | 13 +++ debian/plinth-mumble.postinst | 13 +++ debian/plinth-openvpn.postinst | 13 +++ debian/plinth-pagekite.postinst | 13 +++ debian/plinth-privoxy.postinst | 13 +++ debian/plinth-quassel.postinst | 13 +++ debian/plinth-radicale.postinst | 13 +++ debian/plinth-repro.postinst | 13 +++ debian/plinth-roundcube.postinst | 13 +++ debian/plinth-shaarli.postinst | 13 +++ debian/plinth-snapshot.postinst | 13 +++ debian/plinth-tor.postinst | 13 +++ debian/plinth-transmission.postinst | 13 +++ debian/plinth-ttrss.postinst | 13 +++ debian/plinth-xmpp.postinst | 13 +++ 21 files changed, 460 insertions(+) create mode 100755 debian/plinth-deluge.postinst create mode 100755 debian/plinth-dynamicdns.postinst create mode 100755 debian/plinth-ikiwiki.postinst create mode 100755 debian/plinth-letsencrypt.postinst create mode 100755 debian/plinth-minetest.postinst create mode 100755 debian/plinth-monkeysphere.postinst create mode 100755 debian/plinth-mumble.postinst create mode 100755 debian/plinth-openvpn.postinst create mode 100755 debian/plinth-pagekite.postinst create mode 100755 debian/plinth-privoxy.postinst create mode 100755 debian/plinth-quassel.postinst create mode 100755 debian/plinth-radicale.postinst create mode 100755 debian/plinth-repro.postinst create mode 100755 debian/plinth-roundcube.postinst create mode 100755 debian/plinth-shaarli.postinst create mode 100755 debian/plinth-snapshot.postinst create mode 100755 debian/plinth-tor.postinst create mode 100755 debian/plinth-transmission.postinst create mode 100755 debian/plinth-ttrss.postinst create mode 100755 debian/plinth-xmpp.postinst diff --git a/debian/control b/debian/control index 34934eb..26d9627 100644 --- a/debian/control +++ b/debian/control @@ -77,3 +77,203 @@ Description: web front end for administering every aspect of a FreedomBox The Plinth front end is a web interface to administer the functions of the FreedomBox. For example, the FreedomBox is a wireless router, and the front end is where you can adjust its settings. + +Package: plinth-deluge +Architecture: all +Depends: plinth + , ${misc:Depends} + , deluged,deluge-web, +Description: deluge module for Plinth + This metapackage will setup the deluge module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-dynamicdns +Architecture: all +Depends: plinth + , ${misc:Depends} + , ez-ipupdate, +Description: dynamicdns module for Plinth + This metapackage will setup the dynamicdns module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-ikiwiki +Architecture: all +Depends: plinth + , ${misc:Depends} + , ikiwiki,libdigest-sha-perl,libxml-writer-perl,xapian-omega,libsearch-xapian-perl,libimage-magick-perl, +Description: ikiwiki module for Plinth + This metapackage will setup the ikiwiki module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-letsencrypt +Architecture: all +Depends: plinth + , ${misc:Depends} + , certbot, +Description: letsencrypt module for Plinth + This metapackage will setup the letsencrypt module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-minetest +Architecture: all +Depends: plinth + , ${misc:Depends} + , minetest-server, +Description: minetest module for Plinth + This metapackage will setup the minetest module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-monkeysphere +Architecture: all +Depends: plinth + , ${misc:Depends} + , monkeysphere, +Description: monkeysphere module for Plinth + This metapackage will setup the monkeysphere module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-mumble +Architecture: all +Depends: plinth + , ${misc:Depends} + , mumble-server, +Description: mumble module for Plinth + This metapackage will setup the mumble module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-openvpn +Architecture: all +Depends: plinth + , ${misc:Depends} + , openvpn,easy-rsa, +Description: openvpn module for Plinth + This metapackage will setup the openvpn module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-pagekite +Architecture: all +Depends: plinth + , ${misc:Depends} + , pagekite, +Description: pagekite module for Plinth + This metapackage will setup the pagekite module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-privoxy +Architecture: all +Depends: plinth + , ${misc:Depends} + , privoxy, +Description: privoxy module for Plinth + This metapackage will setup the privoxy module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-quassel +Architecture: all +Depends: plinth + , ${misc:Depends} + , quassel-core, +Description: quassel module for Plinth + This metapackage will setup the quassel module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-radicale +Architecture: all +Depends: plinth + , ${misc:Depends} + , radicale, +Description: radicale module for Plinth + This metapackage will setup the radicale module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-repro +Architecture: all +Depends: plinth + , ${misc:Depends} + , repro, +Description: repro module for Plinth + This metapackage will setup the repro module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-roundcube +Architecture: all +Depends: plinth + , ${misc:Depends} + , sqlite3,roundcube,roundcube-sqlite3, +Description: roundcube module for Plinth + This metapackage will setup the roundcube module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-shaarli +Architecture: all +Depends: plinth + , ${misc:Depends} + , shaarli, +Description: shaarli module for Plinth + This metapackage will setup the shaarli module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-snapshot +Architecture: all +Depends: plinth + , ${misc:Depends} + , snapper, +Description: snapshot module for Plinth + This metapackage will setup the snapshot module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-tor +Architecture: all +Depends: plinth + , ${misc:Depends} + , tor,tor-geoipdb,torsocks,obfs4proxy,apt-transport-tor, +Description: tor module for Plinth + This metapackage will setup the tor module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-transmission +Architecture: all +Depends: plinth + , ${misc:Depends} + , transmission-daemon, +Description: transmission module for Plinth + This metapackage will setup the transmission module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-ttrss +Architecture: all +Depends: plinth + , ${misc:Depends} + , tt-rss,postgresql,dbconfig-pgsql,php-pgsql, +Description: ttrss module for Plinth + This metapackage will setup the ttrss module for Plinth by + installing required packages and performing any additional + configuration needed. + +Package: plinth-xmpp +Architecture: all +Depends: plinth + , ${misc:Depends} + , libjs-jsxc,ejabberd, +Description: xmpp module for Plinth + This metapackage will setup the xmpp module for Plinth by + installing required packages and performing any additional + configuration needed. diff --git a/debian/plinth-deluge.postinst b/debian/plinth-deluge.postinst new file mode 100755 index 0000000..0d74322 --- /dev/null +++ b/debian/plinth-deluge.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install deluge + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-dynamicdns.postinst b/debian/plinth-dynamicdns.postinst new file mode 100755 index 0000000..7cf3c02 --- /dev/null +++ b/debian/plinth-dynamicdns.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install dynamicdns + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-ikiwiki.postinst b/debian/plinth-ikiwiki.postinst new file mode 100755 index 0000000..21a4e45 --- /dev/null +++ b/debian/plinth-ikiwiki.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install ikiwiki + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-letsencrypt.postinst b/debian/plinth-letsencrypt.postinst new file mode 100755 index 0000000..ccd599d --- /dev/null +++ b/debian/plinth-letsencrypt.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install letsencrypt + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-minetest.postinst b/debian/plinth-minetest.postinst new file mode 100755 index 0000000..e4b06f9 --- /dev/null +++ b/debian/plinth-minetest.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install minetest + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-monkeysphere.postinst b/debian/plinth-monkeysphere.postinst new file mode 100755 index 0000000..108721f --- /dev/null +++ b/debian/plinth-monkeysphere.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install monkeysphere + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-mumble.postinst b/debian/plinth-mumble.postinst new file mode 100755 index 0000000..64f6e18 --- /dev/null +++ b/debian/plinth-mumble.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install mumble + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-openvpn.postinst b/debian/plinth-openvpn.postinst new file mode 100755 index 0000000..1ffbc89 --- /dev/null +++ b/debian/plinth-openvpn.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install openvpn + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-pagekite.postinst b/debian/plinth-pagekite.postinst new file mode 100755 index 0000000..c6ae6ac --- /dev/null +++ b/debian/plinth-pagekite.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install pagekite + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-privoxy.postinst b/debian/plinth-privoxy.postinst new file mode 100755 index 0000000..91fc933 --- /dev/null +++ b/debian/plinth-privoxy.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install privoxy + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-quassel.postinst b/debian/plinth-quassel.postinst new file mode 100755 index 0000000..78a3661 --- /dev/null +++ b/debian/plinth-quassel.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install quassel + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-radicale.postinst b/debian/plinth-radicale.postinst new file mode 100755 index 0000000..e5b15c0 --- /dev/null +++ b/debian/plinth-radicale.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install radicale + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-repro.postinst b/debian/plinth-repro.postinst new file mode 100755 index 0000000..e01a1a6 --- /dev/null +++ b/debian/plinth-repro.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install repro + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-roundcube.postinst b/debian/plinth-roundcube.postinst new file mode 100755 index 0000000..0e008ad --- /dev/null +++ b/debian/plinth-roundcube.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install roundcube + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-shaarli.postinst b/debian/plinth-shaarli.postinst new file mode 100755 index 0000000..e30c6e0 --- /dev/null +++ b/debian/plinth-shaarli.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install shaarli + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-snapshot.postinst b/debian/plinth-snapshot.postinst new file mode 100755 index 0000000..a41a158 --- /dev/null +++ b/debian/plinth-snapshot.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install snapshot + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-tor.postinst b/debian/plinth-tor.postinst new file mode 100755 index 0000000..ebc8802 --- /dev/null +++ b/debian/plinth-tor.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install tor + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-transmission.postinst b/debian/plinth-transmission.postinst new file mode 100755 index 0000000..976e4dd --- /dev/null +++ b/debian/plinth-transmission.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install transmission + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-ttrss.postinst b/debian/plinth-ttrss.postinst new file mode 100755 index 0000000..c65fecb --- /dev/null +++ b/debian/plinth-ttrss.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install ttrss + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/plinth-xmpp.postinst b/debian/plinth-xmpp.postinst new file mode 100755 index 0000000..d9ae99b --- /dev/null +++ b/debian/plinth-xmpp.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + plinth --setup-no-install xmpp + ;; +esac + +#DEBHELPER# + +exit 0 -- 2.10.2
signature.asc
Description: OpenPGP digital signature

