From af45ff11f46d4c1a1e4d0776782c1b18dc41ca56 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 9 Nov 2018 12:47:23 +0200 Subject: Add: Debian packaging --- debian/changelog | 6 ++++++ debian/compat | 1 + debian/control | 24 ++++++++++++++++++++++++ debian/copyright | 23 +++++++++++++++++++++++ debian/dirs | 1 + debian/install | 1 + debian/postinst | 41 +++++++++++++++++++++++++++++++++++++++++ debian/rules | 25 +++++++++++++++++++++++++ debian/source/format | 1 + muck.service | 28 ++++++++++++++++++++++++++++ muck/__init__.py | 1 + muck/version.py | 2 ++ setup.py | 33 +++++++++++++++++++++++++++++++++ without-tests | 1 + 14 files changed, 188 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/install create mode 100644 debian/postinst create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 muck.service create mode 100644 muck/version.py create mode 100644 setup.py diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..61b971a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +muck-poc (0.1+git-1) UNRELEASED; urgency=medium + + * Initial packaging. This is not intended to be uploaded to Debian, so + no closing of an ITP bug. + + -- Lars Wirzenius Sat, 01 Apr 2017 19:49:25 +0300 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..5e1bfca --- /dev/null +++ b/debian/control @@ -0,0 +1,24 @@ +Source: muck-poc +Homepage: http://liw.fi/ick/ +Maintainer: Lars Wirzenius +Section: database +Priority: optional +Standards-Version: 4.0.0 +Build-Depends: debhelper (>= 9~), + python3-all, + python3-bottle, + python3-coverage-test-runner, + python3-cryptography, + pycodestyle, + dh-python, + cmdtest + +Package: muck-poc +Architecture: all +Depends: ${python3:Depends}, ${misc:Depends}, + python3, + python3-bottle, + python3-cryptography, + adduser +Description: work-in-progress CI server + This should be written. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..8d7a039 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,23 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: muck-poc +Upstream-Contact: Lars Wirzenius +Source: http://git.liw.fi/muck-poc + +Files: * +Copyright: 2018, Lars Wirzenius +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On a Debian system, you can find a copy of GPL version 3 at + /usr/share/common-licenses/GPL-3 . diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..49fa242 --- /dev/null +++ b/debian/dirs @@ -0,0 +1 @@ +var/lib/muck diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..79d3df2 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +*.service lib/systemd/system diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..743d528 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,41 @@ +#!/bin/sh +# Copyright 2018 Lars Wirzenius +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +set -eu + + +create_user() +{ + local name="$1" + local home="$2" + local logdir="$3" + + addgroup --force "$name" || true + adduser --disabled-login --disabled-password \ + --gecos "Muck JSON store" --home "$home" \ + --shell /bin/true --force \ + --ingroup "$name" \ + "$name" || true + install -d -m 0755 -o "$name" -g "$name" "$logdir" +} + +# Create a group and user +create_user _muck /var/lib/ick /var/log/muck + +# Create store dir +install -d -m 0755 -o _muck -g _muck /var/lib/muck + +#DEBHELPER# diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..73c7a00 --- /dev/null +++ b/debian/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# Copyright 2017 Lars Wirzenius +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +export PYBUILD_NAME=ick2 + +%: + dh $@ --with=python3 --buildsystem=pybuild + +override_dh_auto_test: +ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + ./check +endif diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/muck.service b/muck.service new file mode 100644 index 0000000..0cb3a70 --- /dev/null +++ b/muck.service @@ -0,0 +1,28 @@ +# Copyright 2018 Lars Wirzenius +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +[Unit] +Description=muck JSON store +After=network.target + +[Service] +Type=simple +User=_muck +Group=_muck +WorkingDirectory=/var/lib/muck +ExecStart=/usr/bin/muck_poc +KillSignal=QUIT + +[Install] +WantedBy=multi-user.target diff --git a/muck/__init__.py b/muck/__init__.py index d78e998..1782ea9 100644 --- a/muck/__init__.py +++ b/muck/__init__.py @@ -12,6 +12,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from .version import __version__, __version_info__ from .exc import Error from .idgen import IdGenerator diff --git a/muck/version.py b/muck/version.py new file mode 100644 index 0000000..3361381 --- /dev/null +++ b/muck/version.py @@ -0,0 +1,2 @@ +__version__ = "0.1+git" +__version_info__ = (0, 1, '+git') diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..20b17b7 --- /dev/null +++ b/setup.py @@ -0,0 +1,33 @@ +#!/usr/bin/python3 +# Copyright (C) 2018 Lars Wirzenius +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +from distutils.core import setup + +import muck + + +setup( + name='muck-poc', + version=muck.__version__, + description='JSON store', + author='Lars Wirzenius', + author_email='liw@liw.fi', + url='http://ick.liw.fi', + packages=['muck'], + scripts=[ + 'muck_poc' + ], +) diff --git a/without-tests b/without-tests index ead87d6..3806441 100644 --- a/without-tests +++ b/without-tests @@ -1,2 +1,3 @@ muck/__init__.py muck/exc.py +muck/version.py -- cgit v1.2.1