6
# Patches applied in this order.
7
debian_patches = news.texi
9
ARCH = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11
version := $(shell sed -n 's/Package: \(.*\)/\1/p' debian/control | head -1)
13
# Uncomment this to turn on verbose mode.
14
3
#export DH_VERBOSE=1
5
version := $(shell sed -n 's/Package: \(.*\)/\1/p' debian/control | head -n 1)
7
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),m68k))
22
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),amd64))
26
configure: configure-stamp
27
configure-stamp: patch-stamp
30
./configure --prefix=/usr --libexecdir=/usr/lib --mandir=/usr/share/man \
31
--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
32
--with-readline CFLAGS="$(CFLAGS)"
17
build-stamp: patched-stamp
37
build-stamp: configure-stamp
20
cp /usr/share/misc/config.guess /usr/share/misc/config.sub .
22
./configure --prefix=/usr --libexecdir=/usr/lib \
23
--mandir=/usr/share/man --with-readline $(ARCH)
30
rm -f build-stamp install-stamp
33
debian/rules reverse-patches
35
dh_clean src/rep-xgettext debian/librep-dev.files \
36
config.guess config.sub config.cache *.1 manpage.links manpage.refs
38
install: install-stamp
39
install-stamp: build-stamp
47
rm -f build-stamp configure-stamp
49
[ ! -f Makefile ] || $(MAKE) realclean
53
dh_clean src/rep-xgettext debian/librep-dev.files
45
61
$(MAKE) install DESTDIR=`pwd`/debian/${version}
46
# dh_installinfo will deal with this
47
63
-rm -rf debian/${version}/usr/info
49
65
-rm debian/librep-dev.files
105
109
dh_makeshlibs -p${version} -V 'librep9 (>= 0.15.1)'
108
111
dh_shlibdeps -a -ldebian/${version}/usr/lib
113
116
binary: binary-indep binary-arch
114
.PHONY: build clean binary-indep binary-arch binary
116
# ---------------------------------------------------------------------------
117
# various rules to unpack addons and (un)apply patches.
118
# borrowed from egcs package
120
patch_dir = debian/patches
122
apply-patches: patched-stamp
124
@for stamp in none patched-*; do \
125
case "$$stamp" in none|patched-stamp|patched-\*) continue; esac; \
126
patch=`echo $$stamp | sed -e 's/patched-//'`; \
127
echo "trying to revert patch $$patch ..."; \
128
if [ -x $(patch_dir)/$$patch.dpatch ]; then true; else \
129
chmod +x $(patch_dir)/$$patch.dpatch; fi; \
130
if $(patch_dir)/$$patch.dpatch -unpatch; then \
131
echo "reverted $$patch patch."; \
134
echo "error in reverting $$patch patch."; \
138
@echo "Removing patched-stamp"
141
patched-%: $(patch_dir)/%.dpatch
142
@if [ -x $< ]; then true; else chmod +x $<; fi
143
@if [ -f $@ ]; then \
144
echo "$* patches already applied."; exit 1; \
147
@echo "$* patches applied." > $@
149
patched-stamp: $(foreach p,$(debian_patches),patched-$(p))
150
@echo -e "\nPatches applied:" >> pxxx
151
@for i in none $(debian_patches); do \
152
if [ -r debian/patches/$$i.dpatch ]; then \
153
echo -e "\n$$i:" >> pxxx; \
154
sed -n 's/^# *DP: */ /p' debian/patches/$$i.dpatch >> pxxx; \
157
@echo "Writing patched-stamp"
158
@mv -f pxxx patched-stamp
117
.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch
119
DPATCH_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
120
PATCHLIST_ALL = $(shell cat debian/patches/00list)
121
PATCHLIST_ARCH = $(shell cat debian/patches/00list.${DPATCH_ARCH} 2>/dev/null)
122
PATCHLIST ?= $(sort ${PATCHLIST_ALL} ${PATCHLIST_ARCH})
124
UNPATCHLIST = $(shell echo ${PATCHLIST} | tr ' ' '\n' | tac)
128
test -d debian/patched || install -d debian/patched
129
@echo "Patches applied in the Debian version of ${PACKAGE}:" > $@T
130
@for patch in ${PATCHLIST}; do \
131
stamp=debian/patched/$$patch.dpatch; \
132
patch=debian/patches/$$patch.dpatch; \
133
author=`sed -n "s,^#* *.*dpatch by *,,p" $$patch`; \
134
test -x $$patch || chmod +x $$patch; \
135
if test -f $$stamp; then \
136
echo "$$patch already applied."; \
137
echo -e "\n$$patch ($$author):" >> $@T; \
138
sed -n 's/^#* *DP: */ /p' $$patch >> $@T; \
140
echo -n "applying patch $$patch..."; \
141
if $$patch -patch >$$stamp.new 2>&1; then \
142
mv $$stamp.new $$stamp; \
144
echo -e "\n$$patch ($$author):" >> $@T; \
145
sed -n 's/^#* *DP: */ /p' $$patch >> $@T; \
156
@for patch in ${UNPATCHLIST}; do \
157
stamp=debian/patched/$$patch.dpatch; \
158
patch=debian/patches/$$patch.dpatch; \
159
test -x $$patch || chmod +x $$patch; \
160
if test -f $$stamp; then \
161
echo -n "reverting patch $$patch..."; \
162
if $$patch -unpatch 2>&1 >/dev/null; then \
171
rm -rf patch-stamp debian/patched