diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-11-09 12:47:23 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-11-09 13:03:09 +0200 |
commit | af45ff11f46d4c1a1e4d0776782c1b18dc41ca56 (patch) | |
tree | 040ea9d4399f001e2a78a4b16cf30b5498931dda | |
parent | ccc9b9f17eb08977cee1fba425a2876a004266b5 (diff) | |
download | muck-poc-af45ff11f46d4c1a1e4d0776782c1b18dc41ca56.tar.gz |
Add: Debian packaging
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 24 | ||||
-rw-r--r-- | debian/copyright | 23 | ||||
-rw-r--r-- | debian/dirs | 1 | ||||
-rw-r--r-- | debian/install | 1 | ||||
-rw-r--r-- | debian/postinst | 41 | ||||
-rwxr-xr-x | debian/rules | 25 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rw-r--r-- | muck.service | 28 | ||||
-rw-r--r-- | muck/__init__.py | 1 | ||||
-rw-r--r-- | muck/version.py | 2 | ||||
-rw-r--r-- | setup.py | 33 | ||||
-rw-r--r-- | without-tests | 1 |
14 files changed, 188 insertions, 0 deletions
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 <liw@liw.fi> 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 <liw@liw.fi> +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 <liw@liw.fi> +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 <http://www.gnu.org/licenses/>. + . + 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 <http://www.gnu.org/licenses/>. + +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 <http://www.gnu.org/licenses/>. + +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 <http://www.gnu.org/licenses/>. + +[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 <http://www.gnu.org/licenses/>. +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 <liw@liw.fi> +# +# 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 <http://www.gnu.org/licenses/>. + +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 |