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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
#!/usr/bin/make -f
# David Martnez <ender@debian.org>
# It seems that I finally changed this cursed Makefile to DHv3.
version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
# WBS codec is licensed by British Telecommunications,
# and its license is not compatible with DFSG.
CFLAGS += -DREMOVE_WBS_CODEC
#export DH_VERBOSE=1
# Debhelper compatibility flag to use
export DH_COMPAT=3
CFLAGS += -O2
export CFLAGS
config: patch config-stamp
config-stamp:
dh_testdir
./configure --enable-ipv6 \
--with-tcl=/usr/include/tcl8.0 \
--with-tk=/usr/include/tk8.0 \
--with-common=/usr/include/uclmmbase \
--mandir=$(CURDIR)/debian/tmp/usr/share/man
touch config-stamp
build: config build-stamp
build-stamp:
dh_testdir
$(MAKE)
touch build-stamp
clean: clean1 unpatch
clean1:
dh_testdir
dh_testroot
rm -f build-stamp config-stamp patch-stamp
-$(MAKE) distclean
dh_clean
patch: patch-stamp
patch-stamp:
test -d debian/patched || install -d debian/patched
@echo "Patches applied in the Debian version of rat:" > $@T
@for patch in `cat debian/patches/00list`; do \
stamp=debian/patched/$$patch.dpatch; \
patch=debian/patches/$$patch.dpatch; \
test -x $$patch || chmod +x $$patch; \
if test -f $$stamp; then \
echo "$$patch already applied."; \
/bin/echo -e "\n$$patch:" >> $@T; \
sed -n 's/^## *DP: */ /p' $$patch >> $@T; \
else \
echo "trying to apply patch $$patch..."; \
if $$patch -patch >$$stamp.new 2>&1; then \
mv $$stamp.new $$stamp; \
touch $$stamp; \
/bin/echo -e "\n$$patch:" >> $@T; \
sed -n 's/^## *DP: */ /p' $$patch >> $@T; \
else \
echo "error in applying $$patch patch."; \
exit 1; \
fi; \
fi; \
done
mv -f $@T $@
unpatch:
@for patch in `tac debian/patches/00list`; do \
stamp=debian/patched/$$patch.dpatch; \
patch=debian/patches/$$patch.dpatch; \
test -x $$patch || chmod +x $$patch; \
if test -f $$stamp; then \
echo "trying to revert patch $$patch..."; \
if $$patch -unpatch 2>&1 >/dev/null; then \
rm -f $$stamp; \
else \
echo "error in reverting $$patch patch."; \
exit 1; \
fi; \
fi; \
done
rm -f patch-stamp
install: build
dh_testdir
dh_testroot
dh_clean
dh_installdirs
$(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
dh_movefiles
binary-indep: build
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs
# dh_installmenu
dh_installmanpages
dh_undocumented rat-ui.1 rat-media.1
dh_installchangelogs
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_makeshlibs
dh_md5sums
dh_builddeb
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary
# vim:set noet ai sts=8 sw=8 tw=0:
|