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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
#!/usr/bin/make -f
SHELL = /bin/sh
r = $(shell pwd)/debian/wml
t = $(shell pwd)/debian/tmp
p = wml
# Repackaging variables
DEBIAN_REVISION := $(shell echo -n `head -1 debian/changelog | sed -e 's/^.*(\(.*\)).*$$/\\1/'`)
DEBIAN_VERSION := $(shell echo -n $(DEBIAN_REVISION) | sed -e 's/-.*//')
UPSTREAM_VERSION := $(shell echo -n $(DEBIAN_VERSION) | sed -e 's/ds[0-9]$$//')
UPSTREAM_DIR := "$(t)/wml-$(UPSTREAM_VERSION)"
DEBIAN_DIR := "$(t)/wml-$(UPSTREAM_VERSION).orig"
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
%:
dh $@ --with autotools-dev
override_dh_auto_configure:
dh_auto_configure -Dwml_common/gd
env -uCFLAGS -uCPPFLAGS -uLDFLAGS dh_auto_configure
override_dh_auto_install:
dh_auto_install -- prefix=$(r)/usr mandir=$(r)/usr/share/man INSTALLDIRS=perl
dh_auto_install -Dwml_common/filepathconvert -- prefix=$(r)/usr mandir=$(r)/usr/share/man INSTALLDIRS=perl
dh_auto_install -Dwml_common/gd -- prefix=$(r)/usr mandir=$(r)/usr/share/man INSTALLDIRS=perl
# Install icons for wml::std::logo
dh_auto_install -Dwml_misc -- libdir=$(r)/usr/share/wml
find $(r)/usr -type f -name .packlist -delete
find $(r) -type d -empty -delete
# Fix documentation
for f in $(r)/usr/share/man/*/*; do \
sed -e 's|.*/\([^/ ]*\) .*/\([^/ ]*\)|s/\2/\1/|' debian/links |\
sed -f - $$f > $$f.new && mv $$f.new $$f; \
done
override_dh_installdocs:
dh_installdocs
find $(r) '(' -name '*.spec' -o -name '*.spec.in' ')' -delete
override_dh_perl:
dh_perl usr/lib/wml/perl/lib
########################################################
### The remainder is just the get-orig-source target ###
########################################################
get-orig-source:
# Prepare repackaging directory
rm -rf $(t)
mkdir -p $(t)
# Unpack tar ball as downloaded by uscan(1)
tar xvz -C $(t) -f ../wml_$(UPSTREAM_VERSION).orig.tar.gz
# Rename directory
mv -v $(UPSTREAM_DIR) $(DEBIAN_DIR)
# We don't want upstream VCS stuff in our orig.tar.gz
-find $(DEBIAN_DIR) -name .svn -exec rm -rvf '{}' ';'
# Also remove stuff which should not belong in the upstream
# distribution files either.
find $(DEBIAN_DIR) -name '*~' -exec rm -vf '{}' ';'
find $(DEBIAN_DIR) -name '*.tmp' -exec rm -rvf '{}' ';'
# Remove stuff which will be removed by make distclean anyway
find $(DEBIAN_DIR) -mindepth 1 -name '*.orig' -exec rm -rvf '{}' ';'
rm -rvf $(DEBIAN_DIR)/wml_backend/p2_mp4h/autom4te.cache
# Remove non-free stuff
rm -vf $(DEBIAN_DIR)/wml_docs/wml_std_*.txt
rm -vf $(DEBIAN_DIR)/wml_docs/wml_barebone.txt
# This was maybe not the brightest idea, if one wants to
# switch to dh-autoreconf...
find $(DEBIAN_DIR) -name 'configure.in' -exec rm -vf '{}' ';'
# Remove all embedded code copies not needed to build the
# Debian package.
rm -vf $(DEBIAN_DIR)/config/aclocal.m4
rm -vf $(DEBIAN_DIR)/config/configure*
rm -vf $(DEBIAN_DIR)/config/prep_modules_files.sh
rm -rvf $(DEBIAN_DIR)/wml_aux/freetable
rm -rvf $(DEBIAN_DIR)/wml_aux/txt2html
rm -rvf $(DEBIAN_DIR)/wml_aux/htmlclean
rm -rvf $(DEBIAN_DIR)/wml_aux/iselect
rm -rvf $(DEBIAN_DIR)/wml_aux/linklint
rm -rvf $(DEBIAN_DIR)/wml_aux/tidy
rm -rvf $(DEBIAN_DIR)/wml_aux/weblint
rm -rvf $(DEBIAN_DIR)/wml_backend/p2_mp4h
rm -rvf $(DEBIAN_DIR)/wml_backend/p3_eperl
rm -rvf $(DEBIAN_DIR)/wml_backend/p4_gm4
rm -rvf $(DEBIAN_DIR)/wml_backend/p9_slice
rm -rvf $(DEBIAN_DIR)/wml_common/bitvector
rm -rvf $(DEBIAN_DIR)/wml_common/gd/libgd
rm -rvf $(DEBIAN_DIR)/wml_common/getoptlong
rm -rvf $(DEBIAN_DIR)/wml_common/imagesize
rm -rvf $(DEBIAN_DIR)/wml_common/io
rm -rvf $(DEBIAN_DIR)/wml_common/htmlclean
rm -rvf $(DEBIAN_DIR)/wml_common/termreadkey
# Do not remove wml_test for now.
# Pack the Debian Source
tar cv -C $(t) -f ../wml_$(DEBIAN_VERSION).orig.tar \
wml-$(UPSTREAM_VERSION).orig
gzip -9vf ../wml_$(DEBIAN_VERSION).orig.tar
# Clean up again
rm -rf $(t)
|