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 131 132 133 134 135
|
#!/usr/bin/make -f
DISABLE_UPDATE_UPLOADERS := 1
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
STAMP_DIR := debian/stampdir
PATCH_DIR := debian/patches
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS += -Wall -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2)
DEBVERSION := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
VERSION := $(shell echo $(DEBVERSION) | sed -e 's/-[^-]*$$//')
SONAME := 0
configure_flags := \
--prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--sysconfdir=/etc
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
configure_flags += --build=$(DEB_BUILD_GNU_TYPE)
else
configure_flags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif
patch: $(STAMP_DIR)/patch-stamp
$(STAMP_DIR)/patch-stamp:
dh_testdir
mkdir $(STAMP_DIR)
# apply patches
QUILT_PATCHES=$(PATCH_DIR) quilt --quiltrc /dev/null push -a || test $$? = 2
# backup the original files to restore them in the clean target
-test -r config.sub && cp config.sub config.sub.orig
-test -r config.guess && cp config.guess config.guess.orig
-test -r /usr/share/misc/config.sub && \
cp -f /usr/share/misc/config.sub config.sub
-test -r /usr/share/misc/config.guess && \
cp -f /usr/share/misc/config.guess config.guess
touch $@
$(STAMP_DIR)/configure-stamp: $(STAMP_DIR)/patch-stamp
dh_testdir
CFLAGS="$(CFLAGS)" ./configure $(configure_flags)
touch $@
configure: $(STAMP_DIR)/configure-stamp
$(STAMP_DIR)/build-stamp: $(STAMP_DIR)/configure-stamp
dh_testdir
$(MAKE)
touch $@
build: $(STAMP_DIR)/build-stamp
$(STAMP_DIR)/check-stamp: $(STAMP_DIR)/build-stamp
dh_testdir
# testsuite failures are ignored
-$(MAKE) check
touch $@
check: $(STAMP_DIR)/check-stamp
$(STAMP_DIR)/install-stamp: $(STAMP_DIR)/build-stamp
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
touch $@
install: $(STAMP_DIR)/install-stamp
# gross kludge to force control generation with the %.in target
clean::
touch debian/control.in
debian/%: debian/%.in
dh_testdir
sed \
-e "s#@SONAME@#$(SONAME)#g" \
-e "s#@VERSION@#$(VERSION)#g" \
-e "s#@GNOME_TEAM@#$(UPLOADERS)#g" \
$@.in > $@
clean:: debian/control
dh_testdir
dh_testroot
-$(MAKE) distclean
# restore files from backup (before unpatching)
-test -r config.sub.orig && mv -f config.sub.orig config.sub
-test -r config.guess.orig && mv -f config.guess.orig config.guess
# unapply patches, if any
QUILT_PATCHES=$(PATCH_DIR) quilt --quiltrc /dev/null pop -a -R || test $$? = 2
-rm -rf .pc
-rm -rf $(STAMP_DIR)
-rm -f debian/libgail-gnome-module.docs
dh_clean
maybe_check = $(if $(findstring nocheck,$(DEB_BUILD_OPTIONS)),,check)
binary-indep:
binary-arch: build $(maybe_check) install debian/libgail-gnome-module.docs
dh_testdir
dh_testroot
dh_install -a
dh_installchangelogs -plibgail-gnome-module ChangeLog
dh_installdocs -plibgail-gnome-module
dh_link -a
dh_strip -a --dbg-package=libgail-gnome-dbg
dh_compress -a
dh_fixperms -a
dh_makeshlibs -plibgail-gnome-module \
-V "libgail-gnome-module (>= $(VERSION))"
dh_installdeb -a
# override shlibs for libraries from this source before computing
# dependencies of packages generated from this source; we already have
# inter-dependencies expressed manually in the control file, we do not
# need the shlibs to add duplicates
cat debian/*/DEBIAN/shlibs | \
sed -n -r -e 's/(([^ ]+: )?([^ ]+) ([^ ]+)) .*/\1/p' \
>debian/shlibs.local
dh_shlibdeps -a
-rm -f debian/shlibs.local
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: patch configure build check install clean binary-indep binary-arch binary
|