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