#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS include /usr/share/dpkg/pkg-info.mk %: dh $@ override_dh_auto_clean: find . -name "*.pyc" -exec rm {} \; find . -name "*.oxt" -exec rm {} \; dh_clean # manually needed as long as we don't build -editor rm -rf debian/libreoffice-lightproof-editor rm -f debian/libreoffice-lightproof-editor.substvars override_dh_auto_build: for cfg in `find src -name "*.cfg"`; do \ python3 make.py $$cfg; \ done override_dh_auto_install: for oxt in `find . -name "*.oxt"`; do \ oxt=`echo $$oxt | sed -e 's,./,,'`; \ pkg="libreoffice-`echo $$oxt | cut -d- -f1 | sed -e "s/_/-/g" | tr A-Z a-z`"; \ dir=`echo $$oxt | cut -d- -f1`; \ mkdir -p $(CURDIR)/debian/$$pkg/usr/lib/libreoffice/share/extensions/$$dir && \ cd $(CURDIR)/debian/$$pkg/usr/lib/libreoffice/share/extensions/$$dir && \ unzip -o $(CURDIR)/$$oxt; \ done override_dh_gencontrol: for oxt in `find . -name "*.oxt"`; do \ oxt=`echo $$oxt | sed -e 's,./,,'`; \ pkg="libreoffice-`echo $$oxt | cut -d- -f1 | sed -e "s/_/-/g" | tr A-Z a-z`"; \ if ! dh_listpackages | grep -q $$pkg; then continue; fi; \ ver=$$(basename $$(echo $$oxt | cut -d- -f2) .oxt); \ dh_gencontrol -p$$pkg -- -v$$ver+$(DEB_VERSION); \ done