Debian package quality assurance (lintian)

This commit is contained in:
s3lph 2018-11-07 14:53:59 +01:00
parent 3c7e33e9fa
commit 7479c7d9f1
6 changed files with 18 additions and 14 deletions

View file

@ -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 '<!-- BEGIN CHANGES' | cut -d ' ' -f 4)"; do
echo "matemat (${version}-1); urgency=medium\n" >> package/debian/matemat/DEBIAN/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/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:

View file

@ -0,0 +1 @@
/etc/matemat.conf

View file

@ -2,10 +2,10 @@ Package: matemat
Version: 0.1
Maintainer: s3lph <account-gitlab-ideynizv@kernelpanic.lol>
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
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).
It provides a touch-input-friendly user interface (as most input happens
through the soda machine's touch screen).

View file

@ -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/*