From 7479c7d9f1d4343f0e19232aa6390510354c326f Mon Sep 17 00:00:00 2001 From: s3lph Date: Wed, 7 Nov 2018 14:53:59 +0100 Subject: [PATCH] Debian package quality assurance (lintian) --- .gitlab-ci.yml | 19 +++++++++++-------- package/debian/matemat/DEBIAN/conffiles | 1 + package/debian/matemat/DEBIAN/control | 10 +++++----- .../lib/systemd/system/matemat.service | 0 .../share/doc/matemat}/copyright | 0 testing/Dockerfile | 2 +- 6 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 package/debian/matemat/DEBIAN/conffiles rename package/debian/matemat/{usr => }/lib/systemd/system/matemat.service (100%) rename package/debian/matemat/{DEBIAN => usr/share/doc/matemat}/copyright (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 34390da..a2557e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ --- -image: s3lph/matemat-ci:20181103-01 +image: s3lph/matemat-ci:20181107-01 stages: - test @@ -62,25 +62,28 @@ build_wheel: build_debian: stage: build script: - - echo -n > package/debian/matemat/DEBIAN/changelog + - echo -n > package/debian/matemat/usr/share/doc/matemat/changelog - | for version in "$(cat CHANGELOG.md | grep '" | grep -B 1000 "<"'!'"-- END CHANGES ${version} -->" | tail -n +2 | head -n -1 | sed -re 's/^-/ */g' >> package/debian/matemat/DEBIAN/changelog - echo "\n -- ${PACKAGE_AUTHOR} $(date -R)\n" >> package/debian/matemat/DEBIAN/changelog + echo "matemat (${version}-1); urgency=medium\n" >> package/debian/matemat/usr/share/doc/matemat/changelog + cat CHANGELOG.md | grep -A 1000 "<"'!'"-- BEGIN CHANGES ${version} -->" | grep -B 1000 "<"'!'"-- END CHANGES ${version} -->" | tail -n +2 | head -n -1 | sed -re 's/^-/ */g' >> package/debian/matemat/usr/share/doc/matemat/changelog + echo "\n -- ${PACKAGE_AUTHOR} $(date -R)\n" >> package/debian/matemat/usr/share/doc/matemat/changelog done + - gzip -9 package/debian/matemat/usr/share/doc/matemat/changelog - cp -r static/ package/debian/matemat/usr/lib/matemat/static/ - cp -r templates/ package/debian/matemat/usr/lib/matemat/templates/ - - python3.6 setup.py egg_info -d -b +master install --root=package/debian/matemat/ --prefix=/usr --optimize=1 + - python3 setup.py egg_info install --root=package/debian/matemat/ --prefix=/usr --optimize=1 - export PYTHON_BIN=$(which python3) - cd package/debian - chmod 0755 -R matemat/DEBIAN - - mv matemat/usr/lib/python3.6/{site,dist}-packages + - mv matemat/usr/lib/python3/{site,dist}-packages + - find matemat/usr/lib/python3/dist-packages -name __pycache__ -exec rm -r {} \; + - find matemat/usr/lib/python3/dist-packages -name '*.pyc' -exec rm {} \; - mv matemat/usr/bin/matemat matemat/usr/lib/matemat/matemat - rm -rf matemat/usr/bin - - find . -type f -exec sed -re "s#${PYTHON_BIN}#/usr/bin/python3.6#g" -i {} \; - dpkg-deb --build matemat - mv matemat.deb "matemat_${MATEMAT_VERSION}-1_all.deb" + - lintian "matemat_${MATEMAT_VERSION}-1_all.deb" - sha256sum *.deb > SHA256SUMS artifacts: paths: diff --git a/package/debian/matemat/DEBIAN/conffiles b/package/debian/matemat/DEBIAN/conffiles new file mode 100644 index 0000000..6cda54c --- /dev/null +++ b/package/debian/matemat/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/matemat.conf diff --git a/package/debian/matemat/DEBIAN/control b/package/debian/matemat/DEBIAN/control index 6c64cfe..41f5013 100644 --- a/package/debian/matemat/DEBIAN/control +++ b/package/debian/matemat/DEBIAN/control @@ -2,10 +2,10 @@ Package: matemat Version: 0.1 Maintainer: s3lph Section: web -Priority: extra +Priority: optional Architecture: all Depends: python3 (>= 3.6), python3-jinja2, python3-magic, python3-pil -Description: A soda machine stock-keeping webservice - A web service for automated stock-keeping of a soda machine written in Python. - It provides a touch-input-friendly user interface (as most input happens through the - soda machine's touch screen). +Description: Soda machine stock-keeping webservice + A web service for automated stock-keeping of a soda machine written in Python. + It provides a touch-input-friendly user interface (as most input happens + through the soda machine's touch screen). diff --git a/package/debian/matemat/usr/lib/systemd/system/matemat.service b/package/debian/matemat/lib/systemd/system/matemat.service similarity index 100% rename from package/debian/matemat/usr/lib/systemd/system/matemat.service rename to package/debian/matemat/lib/systemd/system/matemat.service diff --git a/package/debian/matemat/DEBIAN/copyright b/package/debian/matemat/usr/share/doc/matemat/copyright similarity index 100% rename from package/debian/matemat/DEBIAN/copyright rename to package/debian/matemat/usr/share/doc/matemat/copyright diff --git a/testing/Dockerfile b/testing/Dockerfile index 6b9cfab..5d93d45 100644 --- a/testing/Dockerfile +++ b/testing/Dockerfile @@ -8,7 +8,7 @@ RUN sed -re 's/stretch/buster/g' -i /etc/apt/sources.list \ && chown matemat:matemat -R /var/matemat/db \ && chown matemat:matemat -R /var/matemat/upload \ && apt-get update -qy \ - && apt-get install -y --no-install-recommends file sudo openssh-client git docker.io build-essential \ + && apt-get install -y --no-install-recommends file sudo openssh-client git docker.io build-essential lintian \ && python3.6 -m pip install coverage wheel pycodestyle mypy \ && rm -rf /var/lib/apt/lists/*