#!/usr/bin/make -f PACKAGE = slm %: dh $@ --with python3 override_dh_auto_clean: dh_auto_clean rm -rf aide/output rm -f aide/themes/genus/static/fonts/* rm -f aide/themes/genus/static/css/main.css SITES_AVAILABLE = $(CURDIR)/debian/$(PACKAGE)/etc/apache2/sites-available STATIC_DIR = $(CURDIR)/debian/$(PACKAGE)/var/lib/slm/gestion/static VERSION_PY = $(CURDIR)/debian/$(PACKAGE)/var/lib/slm/gestion/version.py override_dh_install: dh_install : # remove settings.py since it will be overwritten find debian/$(PACKAGE)/ -name settings.py | xargs rm -f : # remove CSV files find debian/$(PACKAGE)/ -name '.git*' | xargs rm -f : # modify the file gestion/version.py bash debian/modifversion $(VERSION_PY) : ############ fix symlinks to absolute locations ############### : ##### for gestion/static/* #################################### symlinks=$$(find $(STATIC_DIR) -type l); \ for s in $${symlinks}; do \ t=""; r=$$(realpath $$s); \ r1=$$(echo $$r | sed 's%/%../../../../../../%'); \ if [ -d $$r ]; then s=$$(dirname $$s); t=/$$(basename $$s); fi; \ echo "$$s$$t ===> $$r1"; \ ln -sf $$r1 $$s; \ done : ##### for aide/themes/genus/static/* symlinks=$$(find debian/$(PACKAGE)/var/lib/slm/aide/themes/genus/static/* -type l); \ for s in $${symlinks}; do \ t=""; r=$$(realpath $$s); \ r1=$$(echo $$r | sed 's%/%../../../../../../../../%'); \ if [ -d $$r ]; then s=$$(dirname $$s); t=/$$(basename $$s); fi; \ echo "$$s$$t ===> $$r1"; \ ln -sf $$r1 $$s; \ done : ##### for aide/output/theme/fonts/ ln -sf ../../../../../../../usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf debian/$(PACKAGE)/var/lib/slm/aide/output/theme/fonts/DejaVuSansMono.ttf echo "/var/lib/slm/aide/output/theme/fonts/DejaVuSansMono.ttf ===> ../../../../../../../usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf" : # remove outils/maj_sans_accent.django rm -f debian/$(PACKAGE)/var/lib/slm/outils/maj_sans_accent.django : # fix embedded jquery.js rm -f debian/$(PACKAGE)/var/lib/slm/aide/output/theme/js/jquery.js ln -s ../../../../../../../usr/share/javascript/jquery/jquery.js debian/$(PACKAGE)/var/lib/slm/aide/output/theme/js/ : # remove __pycache__ directories find debian/$(PACKAGE) -name __pycache__ | xargs rm -rf