~ubuntu-branches/ubuntu/intrepid/libirman/intrepid

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Loic Minier
  • Date: 2007-08-10 13:36:02 UTC
  • mfrom: (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20070810133602-v3h74emt89q84pe7
Tags: 0.4.4-2
* Add myself to uploaders for some QA work.
* Cleanup changelog.
* Wrap build-deps and uploaders.
* Add ${misc:Depends}.
* Set Debhelper compatibility level via debian/compat instead of DH_COMPAT.
* Cleanup rules.
* Pass -s to dh_* calls in binary-arch.
* Cleanup watch file.
* Drop useless debian/dirs, preinst, postinst, prerm, postrm,
  libirman-dev.dirs.
* Cleanup copyright, *.install files, *.links, and watch file.
* Only pass --host to configure if DEB_HOST_GNU_TYPE and DEB_BUILD_GNU_TYPE
  differ.
* Only pass CFLAGS to ./configure.
* Honor make clean errors.
* Fix configure-stamp logic.
* Add a patch system based on quilt; build-dep on quilt; backup config.guess
  and .sub after patching, overwrite with autotool-dev's versions, and
  restore before unpatching; cleanup rules, in particular frop install
  target.
* Drop useless debian/libirman-dev.install and .files.
* New patch, 60_sys-file, look for sys/file.h and include it in irio.c if
  possible; fixes build failure on hurd; thanks Samuel Thibault;
  closes: #436563.
* Avoid running autoheader on rebuilds.
  - New patch, 61_maintainer-mode, adds a kind of "AM_MAINTAINER_MODE" to
    the upstream Make.
  - Pass MAINT="" to the upstream Makefile when building.
  - Fixes build failure when built twice on a row where autoheader was being
    run but wasn't available; closes: #424526.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
 
# This file was originally written by Joey Hess and Craig Small.
3
 
 
4
 
# dpatch support
5
 
# include /usr/share/dpatch/dpatch.make
6
 
 
7
 
# Uncomment this to turn on verbose mode.
8
 
#export DH_VERBOSE=1
9
 
 
10
 
# This is the debhelper compatability version to use.
11
 
export DH_COMPAT=5
12
 
 
13
 
export DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14
 
export DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15
 
 
16
 
export CFLAGS = -Wall -g
17
 
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18
 
        CFLAGS += -O0
19
 
else
20
 
        CFLAGS += -O2
21
 
endif
22
 
 
23
 
config.status: configure
24
 
        dh_testdir
25
 
        # Add here commands to configure the package.
26
 
        ./configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
27
 
                --with-swtest --prefix=/usr --mandir=\$${prefix}/share/man \
28
 
                --infodir=\$${prefix}/share/info --sysconfdir=\$${prefix}/etc
29
 
        touch configure-stamp
30
 
 
31
 
build: build-stamp
32
 
build-stamp:  config.status
33
 
        dh_testdir
34
 
        # Add here commands to compile the package.
35
 
        $(MAKE)
36
 
 
37
 
        touch $@
38
 
 
39
 
clean: 
40
 
        dh_testdir
41
 
        dh_testroot
42
 
        rm -f build-stamp configure-stamp
43
 
        # Add here commands to clean up after the build process.
44
 
        -$(MAKE) distclean
45
 
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
46
 
        cp -f /usr/share/misc/config.sub config.sub
47
 
endif
48
 
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
49
 
        cp -f /usr/share/misc/config.guess config.guess
50
 
endif
51
 
        rm -f config.log config.status
52
 
        dh_clean 
53
 
 
54
 
install: build
55
 
        dh_testdir
56
 
        dh_testroot
57
 
        dh_clean -k 
58
 
        dh_installdirs
59
 
        # Add here commands to install the package into debian/libirman-dev
60
 
        $(MAKE) install prefix=$(CURDIR)/debian/libirman-dev/usr sysconfdir=$(CURDIR)/debian/libirman-dev/etc/
61
 
 
62
 
# Build architecture-independent files here.
63
 
binary-indep: build install
64
 
# We have nothing to do by default.
65
 
 
66
 
# Build architecture-dependent files here.
67
 
binary-arch: build install
68
 
        dh_testdir
69
 
        dh_testroot
70
 
        dh_installchangelogs 
71
 
        dh_installdocs
72
 
        dh_installexamples
73
 
        dh_installman
74
 
        dh_link
75
 
        dh_strip
76
 
        dh_compress
77
 
        dh_fixperms
78
 
#       dh_makeshlibs
79
 
        dh_installdeb
80
 
        dh_shlibdeps
81
 
        dh_gencontrol
82
 
        dh_md5sums
83
 
        dh_builddeb
 
2
 
 
3
STAMP_DIR := debian/stampdir
 
4
 
 
5
PATCH_DIR := debian/patches
 
6
 
 
7
# how to call quilt
 
8
QUILT := QUILT_PATCHES=$(PATCH_DIR) quilt --quiltrc /dev/null
 
9
 
 
10
CFLAGS += -Wall -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2)
 
11
 
 
12
MAKE_ENV += MAINT=""
 
13
 
 
14
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
15
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
16
 
 
17
configure_flags := \
 
18
                --with-swtest \
 
19
                --prefix=/usr \
 
20
                --mandir=\$${prefix}/share/man \
 
21
                --infodir=\$${prefix}/share/info \
 
22
                --sysconfdir=\$${prefix}/etc \
 
23
                --build=$(DEB_BUILD_GNU_TYPE)
 
24
 
 
25
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
 
26
        configure_flags += --host=$(DEB_HOST_GNU_TYPE)
 
27
endif
 
28
 
 
29
$(STAMP_DIR)/patch-stamp:
 
30
        dh_testdir
 
31
        # apply patches
 
32
        $(QUILT) push -a || test $$? = 2
 
33
        # backup the original (potentially patched) files to restore them in
 
34
        # the clean target
 
35
        -test -r config.sub && cp config.sub config.sub.orig
 
36
        -test -r config.guess && cp config.guess config.guess.orig
 
37
        -test -r /usr/share/misc/config.sub && \
 
38
                cp -f /usr/share/misc/config.sub config.sub
 
39
        -test -r /usr/share/misc/config.guess && \
 
40
                cp -f /usr/share/misc/config.guess config.guess
 
41
        -mkdir -p $(STAMP_DIR)
 
42
        touch $@
 
43
 
 
44
patch: $(STAMP_DIR)/patch-stamp
 
45
 
 
46
$(STAMP_DIR)/build-stamp: $(STAMP_DIR)/patch-stamp
 
47
        dh_testdir
 
48
        CFLAGS="$(CFLAGS)" ./configure $(configure_flags)
 
49
        $(MAKE) $(MAKE_ENV)
 
50
        touch $@
 
51
 
 
52
build: $(STAMP_DIR)/build-stamp
 
53
 
 
54
clean:
 
55
        dh_testdir
 
56
        dh_testroot
 
57
        [ ! -f Makefile ] || $(MAKE) $(MAKE_ENV) distclean
 
58
        # restore files from backup (before unpatching)
 
59
        -test -r config.sub.orig && mv -f config.sub.orig config.sub
 
60
        -test -r config.guess.orig && mv -f config.guess.orig config.guess
 
61
        # unapply patches, if any
 
62
        $(QUILT) pop -a -R || test $$? = 2
 
63
        -rm -rf $(STAMP_DIR)
 
64
        dh_clean
 
65
 
 
66
binary-indep: $(STAMP_DIR)/build-stamp
 
67
 
 
68
binary-arch: $(STAMP_DIR)/build-stamp
 
69
        dh_testdir
 
70
        dh_testroot
 
71
        dh_clean -k
 
72
        $(MAKE) $(MAKE_ENV) \
 
73
                prefix=$(CURDIR)/debian/libirman-dev/usr \
 
74
                sysconfdir=$(CURDIR)/debian/libirman-dev/etc/ \
 
75
                install
 
76
        dh_installchangelogs -s
 
77
        dh_installdocs -s
 
78
        dh_installexamples -s
 
79
        dh_installman -s
 
80
        dh_link -s
 
81
        dh_strip -s
 
82
        dh_compress -s
 
83
        dh_fixperms -s
 
84
        dh_installdeb -s
 
85
        dh_shlibdeps -s
 
86
        dh_gencontrol -s
 
87
        dh_md5sums -s
 
88
        dh_builddeb -s
84
89
 
85
90
binary: binary-indep binary-arch
86
 
.PHONY: build clean binary-indep binary-arch binary install 
 
91
.PHONY: patch build clean binary-indep binary-arch binary