~ubuntu-branches/ubuntu/warty/debianutils/warty

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2004-06-18 21:18:51 UTC
  • Revision ID: james.westby@ubuntu.com-20040618211851-nzleek0ip1zo5rp9
Tags: 2.8.3
Apply patch from Robert Millan to not ship installkernel and
mkboot on non-linux platforms.  closes: #254478.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/make -f
 
2
 
 
3
package = debianutils
 
4
 
 
5
CFLAGS = -Wall -g
 
6
INSTALL = install
 
7
INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
 
8
INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
 
9
INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
 
10
INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
 
11
 
 
12
DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
 
13
          
 
14
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
15
CFLAGS += -O0
 
16
else
 
17
CFLAGS += -O2
 
18
endif
 
19
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 
20
INSTALL_PROGRAM += -s
 
21
endif
 
22
 
 
23
build:
 
24
        $(checkdir)
 
25
        CFLAGS="$(CFLAGS)" ./configure --prefix=/usr \
 
26
                                       --mandir=/usr/share/man
 
27
        $(MAKE)
 
28
 
 
29
clean:
 
30
        $(checkdir)
 
31
        -$(MAKE) clean
 
32
        $(RM) -r debian/tmp* debian/files* debian/substvars debianutils*
 
33
        find . -name '*~' -print0 | xargs -0 rm -f
 
34
 
 
35
binary-indep:   checkroot build
 
36
        $(checkdir)
 
37
 
 
38
binary-arch:    checkroot build
 
39
        $(checkdir)
 
40
        -rm -rf debian/tmp
 
41
        $(INSTALL_DIR) debian/tmp/DEBIAN \
 
42
                       debian/tmp/bin \
 
43
                       debian/tmp/sbin \
 
44
                       debian/tmp/usr/bin \
 
45
                       debian/tmp/usr/sbin \
 
46
                       debian/tmp/usr/share/man/man1 \
 
47
                       debian/tmp/usr/share/man/man8 \
 
48
                       debian/tmp/usr/share/man/fr/man8 \
 
49
                       debian/tmp/usr/lib/mime/packages \
 
50
                       debian/tmp/usr/share/doc/$(package)
 
51
        $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp INSTALL_PROGRAM="$(INSTALL_PROGRAM)"
 
52
        mv debian/tmp/usr/bin/run-parts \
 
53
           debian/tmp/usr/bin/tempfile \
 
54
           debian/tmp/usr/bin/mktemp debian/tmp/bin/
 
55
ifeq ($(DEB_BUILD_GNU_SYSTEM),linux)
 
56
        mv debian/tmp/usr/sbin/installkernel debian/tmp/sbin/
 
57
else
 
58
        rm debian/tmp/usr/sbin/installkernel \
 
59
           debian/tmp/usr/sbin/mkboot \
 
60
           debian/tmp/usr/share/man/man8/installkernel.8 \
 
61
           debian/tmp/usr/share/man/man8/mkboot.8
 
62
endif
 
63
        ln -s sensible-editor.1.gz debian/tmp/usr/share/man/man1/sensible-pager.1.gz
 
64
        ln -s sensible-editor.1.gz debian/tmp/usr/share/man/man1/sensible-browser.1.gz
 
65
        $(INSTALL_FILE) debian/changelog debian/tmp/usr/share/doc/$(package)
 
66
        find debian/tmp/usr/share/man/man[18] \
 
67
             debian/tmp/usr/share/doc/$(package) -type f | xargs gzip -9
 
68
        gzip -9f debian/tmp/usr/share/man/fr/man1/which.1 \
 
69
                 debian/tmp/usr/share/man/fr/man8/savelog.8
 
70
        $(INSTALL_FILE) debian/copyright debian/tmp/usr/share/doc/$(package)
 
71
        $(INSTALL_SCRIPT) debian/preinst debian/tmp/DEBIAN/
 
72
        $(INSTALL_SCRIPT) debian/prerm debian/tmp/DEBIAN/
 
73
        $(INSTALL_SCRIPT) debian/postinst debian/tmp/DEBIAN/
 
74
        $(INSTALL_SCRIPT) debian/postrm debian/tmp/DEBIAN/
 
75
        $(INSTALL_FILE) debian/mime debian/tmp/usr/lib/mime/packages/debianutils
 
76
        dpkg-shlibdeps run-parts tempfile mktemp
 
77
        dpkg-gencontrol -isp
 
78
        dpkg --build debian/tmp ..
 
79
 
 
80
define checkdir
 
81
        test -f run-parts.c && test -f debian/rules
 
82
endef
 
83
 
 
84
binary: binary-indep binary-arch
 
85
 
 
86
checkroot:
 
87
        $(checkdir)
 
88
        test 0 = `id -u`
 
89
 
 
90
.PHONY: binary binary-arch binary-indep clean checkroot build
 
91
 
 
92
# Local Variables:
 
93
# mode:Makefile
 
94
# End: