~ubuntu-branches/ubuntu/oneiric/rng-tools/oneiric

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2010-11-05 17:23:05 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101105172305-339i3psmdqbd2x8u
Tags: 2-unofficial-mt.13-3ubuntu1
* Merge from debian unstable. Remaining changes:
  - debian/patches/tpm-engine.patch: implement TPM entropy source
    (Debian bug 542599).
  - debian/control: add build-deps for TPM interface.
  - debian/rng-tools.default: add example for TPM devices.
  - debian/{rules,rng-tools.postinst}: adjust rc start/stop location to
    start later then trousers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
2
# debian/rules for rng-tools
3
3
# GNU copyright 1997 to 1999 by Joey Hess.
4
 
# Copyright (c) 2003,2004 by Henrique de Moraes Holschuh
5
 
# Published under the GNU GPL license
 
4
# Copyright (c) 2003-2010 by Henrique de Moraes Holschuh
 
5
# Published under the GNU GPL license version 2 or any later versions
6
6
# Based on previous work by Viral Shah <viral@debian.org>.
7
 
#
8
 
# $Id: rules,v 1.3.2.15 2008-06-19 03:02:21 hmh Exp $
9
7
 
10
8
PACKAGE:=rng-tools
11
9
PKGDIR:=$(CURDIR)/debian/$(PACKAGE)
12
10
 
13
11
# DebHelper control
14
 
export DH_ALWAYS_EXCLUDE=CVS
15
 
 
16
 
export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
17
 
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
18
 
 
19
 
DEBUGFLAGS=-g
20
 
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21
 
        DEBUGFLAGS += -O0
22
 
else
23
 
        DEBUGFLAGS += -O2
24
 
endif
 
12
export DH_ALWAYS_EXCLUDE=CVS:.svn:.git
 
13
 
 
14
DEB_BUILD_ARCH     ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 
15
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
16
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
17
 
25
18
ifneq (,$(findstring strict,$(DEB_BUILD_OPTIONS)))
26
 
        DEBUGFLAGS += -Werror
 
19
        CFLAGS += -Werror
27
20
endif
28
21
 
29
22
confflags=
34
27
        confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
35
28
endif
36
29
 
37
 
# Detect ix86 and enable VIA PadLock support
38
 
# Debian uses i386. i586 and i686 are handled upstream
39
 
ifneq (,$(findstring i386,$(DEB_BUILD_GNU_TYPE)))
 
30
# Detect i386/i486 and force-enable VIA PadLock support
 
31
ifneq (,$(findstring i386,$(DEB_BUILD_ARCH)))
40
32
        confflags += --enable-viapadlock
41
33
endif
42
34
 
43
 
configure:
 
35
build-prepare: build-prepare-stamp
 
36
build-prepare-stamp:
 
37
        @dh_testdir
44
38
        ./autogen.sh
 
39
        touch build-prepare-stamp
45
40
 
46
 
configure-stamp:
 
41
configure-stamp: | build-prepare
47
42
        dh_testdir
48
43
 
49
 
        rm -rf autom4te.cache
50
 
        rm -f config.sub config.guess
51
 
        ln -s /usr/share/misc/config.sub config.sub
52
 
        ln -s /usr/share/misc/config.guess config.guess
53
 
 
54
 
        rm -rf config.log config.cache
55
 
        ./configure CFLAGS="-Wall -pipe $(DEBUGFLAGS)" \
 
44
        ./configure CFLAGS="$(CFLAGS) -Wall -pipe" $(confflags)\
56
45
          --prefix=/usr \
57
46
          --mandir=\$${prefix}/share/man \
58
47
          --infodir=\$${prefix}/share/info
59
48
 
60
49
        touch configure-stamp
61
50
 
62
 
build: configure-stamp build-stamp
63
 
build-stamp:
 
51
build: build-stamp
 
52
build-stamp: configure-stamp
64
53
        dh_testdir
65
54
 
66
55
        $(MAKE)
67
56
 
68
57
        touch build-stamp
69
58
 
70
 
clean:  configure
 
59
clean:
71
60
        dh_testdir
72
61
        dh_testroot
73
62
        rm -f build-stamp configure-stamp
74
63
        rm -rf autom4te.cache
75
64
 
76
 
        rm -f config.sub config.guess
77
 
        ln -s /usr/share/misc/config.sub config.sub
78
 
        ln -s /usr/share/misc/config.guess config.guess
79
 
 
80
 
        [ ! -f Makefile ] || $(MAKE) clean
81
65
        [ ! -f Makefile ] || $(MAKE) distclean
82
66
 
83
 
        rm -f config.sub config.guess
84
 
        rm -rf config.log config.cache
 
67
        rm -f config.sub config.guess configure config.log
 
68
        rm -fr autom4te.cache
 
69
 
 
70
        rm -f Makefile.in aclocal.m4 contrib/Makefile.in 
 
71
        rm -f Makefile contrib/Makefile
 
72
        rm -f depcomp install-sh missing rng-tools-config.h.in
85
73
 
86
74
        dh_clean
87
75
 
88
76
install: build
89
77
        dh_testdir
90
78
        dh_testroot
91
 
        dh_clean -k
 
79
        dh_prep
92
80
        dh_installdirs
93
81
 
94
82
        $(MAKE) install DESTDIR=$(PKGDIR)
101
89
        install -m 644 debian/logcheck.ignore \
102
90
          $(PKGDIR)/etc/logcheck/violations.ignore.d/rng-tools
103
91
 
104
 
        # Install lintian overrides, if any
105
 
        cd debian ; \
106
 
        for i in *.lintian ; do \
107
 
            [ -r "$$i" ] && { \
108
 
                mkdir -p "$${i%%.lintian}/usr/share/lintian/overrides" ;\
109
 
                install  -m 644 "$$i" "$${i%%.lintian}/usr/share/lintian/overrides/$${i%%.lintian}" ;\
110
 
            } ;\
111
 
        done
112
92
 
113
93
# Build architecture-independent files here.
114
94
binary-indep: build install
133
113
#       dh_installinfo
134
114
#       dh_undocumented
135
115
        dh_installchangelogs ChangeLog
 
116
        dh_lintian
136
117
        dh_link
137
118
        dh_strip
138
119
        dh_compress
146
127
        dh_builddeb
147
128
 
148
129
binary: binary-indep binary-arch
149
 
.PHONY: build clean binary-indep binary-arch binary install
 
130
.PHONY: build clean binary-indep binary-arch binary install build-prepare