| 1 |
#!/usr/bin/make -f |
| 2 |
# Sample debian/rules that uses debhelper. |
| 3 |
# GNU copyright 1997 to 1999 by Joey Hess. |
| 4 |
|
| 5 |
# Uncomment this to turn on verbose mode. |
| 6 |
#export DH_VERBOSE=1 |
| 7 |
|
| 8 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 9 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 10 |
include /usr/share/dpkg/buildflags.mk |
| 11 |
|
| 12 |
ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH) |
| 13 |
|
| 14 |
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) |
| 15 |
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) |
| 16 |
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) |
| 17 |
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) |
| 18 |
|
| 19 |
ifeq ($(ARCH),alpha) |
| 20 |
CFLAGS := $(patsubst -O%,-O0,$(CFLAGS)) |
| 21 |
CXXFLAGS := $(patsubst -O%,-O0,$(CXXFLAGS)) |
| 22 |
endif |
| 23 |
|
| 24 |
CFLAGS += -Wall -funroll-loops -fno-exceptions |
| 25 |
CXXFLAGS += -Wall -funroll-loops -fno-exceptions |
| 26 |
|
| 27 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 28 |
|
| 29 |
configure-stamp: |
| 30 |
dh_testdir |
| 31 |
dh_autoreconf |
| 32 |
rm -rf build |
| 33 |
mkdir -p build |
| 34 |
cd build && ../configure --prefix=/usr \ |
| 35 |
CPPFLAGS="$(CPPFLAGS)" \ |
| 36 |
CFLAGS="$(CFLAGS)" \ |
| 37 |
CXXFLAGS="$(CXXFLAGS)" \ |
| 38 |
LDFLAGS="$(LDFLAGS)" |
| 39 |
touch configure-stamp |
| 40 |
|
| 41 |
build: configure-stamp build-stamp build-arch build-indep |
| 42 |
build-arch: build-stamp |
| 43 |
build-indep: build-stamp |
| 44 |
build-stamp: configure-stamp |
| 45 |
dh_testdir |
| 46 |
$(MAKE) -C build |
| 47 |
touch build-stamp |
| 48 |
|
| 49 |
clean: |
| 50 |
dh_testdir |
| 51 |
rm -f build-stamp configure-stamp |
| 52 |
rm -rf build |
| 53 |
[ ! -f Makefile ] || $(MAKE) distclean || echo "ignored" |
| 54 |
dh_autoreconf_clean |
| 55 |
dh_clean |
| 56 |
|
| 57 |
install: build |
| 58 |
dh_testdir |
| 59 |
dh_testroot |
| 60 |
dh_prep |
| 61 |
|
| 62 |
mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig |
| 63 |
|
| 64 |
$(MAKE) -C build install \ |
| 65 |
DESTDIR=$(CURDIR)/debian/tmp |
| 66 |
|
| 67 |
#Multiarch fixes |
| 68 |
mv debian/tmp/usr/lib/libmng* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) |
| 69 |
mv $(CURDIR)/debian/tmp/usr/lib/pkgconfig/libmng.pc \ |
| 70 |
debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/ |
| 71 |
|
| 72 |
binary-indep: build install |
| 73 |
|
| 74 |
binary-arch: build install |
| 75 |
dh_testdir |
| 76 |
dh_testroot |
| 77 |
dh_install --sourcedir=debian/tmp -plibmng-dev -plibmng2 |
| 78 |
dh_installman |
| 79 |
dh_installdocs |
| 80 |
dh_installexamples |
| 81 |
dh_installinfo |
| 82 |
dh_installchangelogs CHANGES |
| 83 |
dh_link |
| 84 |
dh_strip |
| 85 |
dh_compress |
| 86 |
dh_fixperms |
| 87 |
dh_makeshlibs |
| 88 |
dh_installdeb |
| 89 |
dh_shlibdeps |
| 90 |
dh_gencontrol |
| 91 |
dh_md5sums |
| 92 |
dh_builddeb |
| 93 |
|
| 94 |
binary: binary-indep binary-arch |
| 95 |
.PHONY: build build-indep build-arch clean binary-indep binary-arch binary install |