1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export PYBUILD_NAME = hyperkitty
%:
dh $@ --with python3,sphinxdoc --buildsystem=pybuild
override_dh_clean:
dh_clean -X.txt.orig
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
set -e; \
for python3 in $(shell py3versions -r); do \
$$python3 $(shell which django-admin) test -v 3 --pythonpath=. --settings=hyperkitty.tests.settings_test hyperkitty; \
done
endif
override_dh_auto_build:
PYTHONPATH=. sphinx-build -b html -E -N doc build/sphinx/html
dh_auto_build
override_dh_python3:
dh_python3
# Due to bug #908999, dh_python3 removes the empty directory
# 'usr/share/python3-django-hyperkitty', so run mkdir manually.
mkdir -p debian/python3-django-hyperkitty/usr/share/python3-django-hyperkitty
# Move static files outside of the lib directory
mv debian/python3-django-hyperkitty/usr/lib/python3/dist-packages/hyperkitty/static \
debian/python3-django-hyperkitty/usr/share/python3-django-hyperkitty/
dh_link usr/share/python3-django-hyperkitty/static \
usr/lib/python3/dist-packages/hyperkitty/static
# Don't embed fonts
find debian/python3-django-hyperkitty -name 'fontawesome-webfont.eot' -type f -exec \
ln -sf /usr/share/fonts-font-awesome/fonts/fontawesome-webfont.eot {} \;
find debian/python3-django-hyperkitty -name 'fontawesome-webfont.woff' -type f -exec \
ln -sf /usr/share/fonts-font-awesome/fonts/fontawesome-webfont.woff {} \;
find debian/python3-django-hyperkitty -name 'fontawesome-webfont.woff2' -type f -exec \
ln -sf /usr/share/fonts-font-awesome/fonts/fontawesome-webfont.woff2 {} \;
# Don't embed glewlwyd glyphicons as they're also shipped into debian.
for type in eot ttf woff woff2; do \
find debian/python3-django-hyperkitty -name "glyphicons-halflings-regular.$$type" -type f -exec \
ln -sf /usr/share/fonts-glyphicons/glyphicons-halflings-regular.$$type {} \; ; \
done
# Don't embed JQuery stuff
find debian/python3-django-hyperkitty -name 'jquery-3.6.0.min.map' -type f -exec \
ln -sf /usr/share/javascript/jquery/jquery.min.map {} \;
find debian/python3-django-hyperkitty -name 'jquery-3.6.0.min.js' -type f -exec \
ln -sf /usr/share/javascript/jquery/jquery.min.js {} \;
find debian/python3-django-hyperkitty -name 'jquery-3.6.0.js' -type f -exec \
ln -sf /usr/share/javascript/jquery/jquery.js {} \;
find debian/python3-django-hyperkitty -name 'jquery-ui-1.13.1.min.js' -type f -exec \
ln -sf /usr/share/javascript/jquery-ui/jquery-ui.min.js {} \;
find debian/python3-django-hyperkitty -name 'jquery-ui-1.13.1.js' -type f -exec \
ln -sf /usr/share/javascript/jquery-ui/jquery-ui.js {} \;
# Don't embed bootstrap JS scripts
rm -rf debian/python3-django-hyperkitty/usr/share/python3-django-hyperkitty/static/hyperkitty/libs/bootstrap/stylesheets
# Compile scss + css files using sassc
sassc hyperkitty/static/hyperkitty/sass/hyperkitty.scss \
debian/python3-django-hyperkitty/usr/share/python3-django-hyperkitty/static/hyperkitty/libs/hyperkitty.css
# Compile django LC messages
cd debian/python3-django-hyperkitty/usr/lib/python3/dist-packages/hyperkitty && django-admin compilemessages
override_dh_installchangelogs:
dh_installchangelogs doc/news.rst
override_dh_fixperms:
dh_fixperms
chmod 644 debian/python3-django-hyperkitty/usr/share/doc/python3-django-hyperkitty/examples/wsgi.py
|