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
|
#!/usr/bin/make -f
#export DH_VERBOSE = 1
export DH_GOPKG := github.com/subgraph/paxrat
export DESTDIR=$(CURDIR)/debian/paxrat
export MANSRC=$(CURDIR)/paxrat.1.md
%:
dh $@ --buildsystem=golang --with=golang
override_dh_auto_build:
[ -f $(MANSRC) ] || cp $(CURDIR)/README.md $(MANSRC)
dh_auto_build
override_dh_auto_install:
#
dh_auto_install -- --no-source
mkdir -p $(DESTDIR)/sbin
cp -r $(DESTDIR)/usr/bin/paxrat $(DESTDIR)/sbin
rm -rf $(DESTDIR)/usr/bin/paxrat
rmdir $(DESTDIR)/usr/bin/
# This is an ugly-but-it-works hack to generate a paxrat.1 manpage
# from existing documentation and avoiding to duplicate efforts.
# More elegant alternatives are welcome.
patch -p1 < debian/patches/manpage/adjust-README-for-manpage.patch
/usr/bin/go-md2man -in=$(MANSRC) -out=$(CURDIR)/debian/paxrat.1
override_dh_fixperms:
dh_fixperms
chmod 644 $(DESTDIR)/etc/apt/apt.conf.d/70paxrat
override_dh_auto_clean:
[ -f $(MANSRC) ] && rm $(MANSRC) || true
dh_auto_clean
|