~ubuntu-branches/ubuntu/natty/dist/natty

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Manoj Srivastava
  • Date: 2002-01-26 00:18:01 UTC
  • Revision ID: james.westby@ubuntu.com-20020126001801-zdk4rbv70dzj8shf
Tags: 3.70-13
Fix lintian warnings. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/make -f
 
2
############################ -*- Mode: Makefile -*- ###########################
 
3
## rules|dist-3.60/debian ---
 
4
## Author           : Manoj Srivastava ( srivasta@tiamat.datasync.com )
 
5
## Created On       : Thu Nov 14 10:54:16 1996
 
6
## Created On Node  : tiamat.datasync.com
 
7
## Last Modified By : Manoj Srivastava
 
8
## Last Modified On : Wed Sep  6 09:37:32 2000
 
9
## Last Machine Used: glaurung.green-gryphon.com
 
10
## Update Count     : 24
 
11
## Status           : Unknown, Use with caution!
 
12
## HISTORY          :
 
13
## Description      :
 
14
##
 
15
###############################################################################
 
16
 
 
17
ifdef ARCH
 
18
  ha:=-a$(ARCH)
 
19
endif
 
20
 
 
21
# set the dpkg-architecture vars
 
22
export DEB_BUILD_ARCH      := $(shell dpkg-architecture $(ha) -qDEB_BUILD_ARCH)
 
23
export DEB_BUILD_GNU_CPU   := $(shell dpkg-architecture $(ha) -qDEB_BUILD_GNU_CPU)
 
24
export DEB_BUILD_GNU_SYSTEM:= $(shell dpkg-architecture $(ha) -qDEB_BUILD_GNU_SYSTEM)
 
25
export DEB_BUILD_GNU_TYPE  := $(shell dpkg-architecture $(ha) -qDEB_BUILD_GNU_TYPE)
 
26
export DEB_HOST_ARCH       := $(shell dpkg-architecture $(ha) -qDEB_HOST_ARCH)
 
27
export DEB_HOST_GNU_CPU    := $(shell dpkg-architecture $(ha) -qDEB_HOST_GNU_CPU)
 
28
export DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture $(ha) -qDEB_HOST_GNU_SYSTEM)
 
29
export DEB_HOST_GNU_TYPE   := $(shell dpkg-architecture $(ha) -qDEB_HOST_GNU_TYPE)
 
30
 
 
31
 
 
32
#
 
33
# VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | \
 
34
#                          sed 's/^Version: *//')
 
35
#
 
36
 
 
37
 
 
38
 
 
39
# The name of the package (for example, `emacs').
 
40
package = dist
 
41
 
 
42
# The maintainer information.
 
43
maintainer = Manoj Srivastava
 
44
email= srivasta@debian.org
 
45
 
 
46
 
 
47
ifndef PERL
 
48
PERL = /usr/bin/perl
 
49
endif
 
50
 
 
51
 
 
52
# Configuration variables (these should be pretty generic)
 
53
PREFIX = /usr
 
54
archlib =`$(PERL) -MConfig -e 'print $$Config{installarchlib}'`
 
55
 
 
56
#  Package specific stuff.  The idea is to try to make the rules
 
57
#  generic (gradually).
 
58
 
 
59
FILES_TO_CLEAN = stamp-configure stamp-build config.over mkdep \
 
60
                 bin/Makefile.bak jmake/Makefile.bak kit/Makefile.bak \
 
61
                 mcon/Makefile.bak pat/Makefile.bak debian/files \
 
62
                 debian/debian.tar.gz
 
63
DIRS_TO_CLEAN  = debian/tmp debian/Config
 
64
PAT_EXEC       = patcil patdiff patbase patlog patmake patsend \
 
65
                 patnotify patpost patftp patname patsnap patcol \
 
66
                 patclean patindex
 
67
 
 
68
TMPTOP=debian/tmp
 
69
BINDIR=$(TMPTOP)/usr/bin
 
70
MANDIR=$(TMPTOP)/usr/share/man
 
71
MAN1DIR=$(MANDIR)/man1
 
72
MAN7DIR=$(MANDIR)/man7
 
73
LIBDIR=$(TMPTOP)/usr/lib/$(package)
 
74
PRIVLIB=$(TMPTOP)/usr/share/$(package)/U
 
75
DOCDIR=$(TMPTOP)/usr/share/doc/$(package)
 
76
LINTIANDIR:= $(TMPTOP)/usr/share/lintian/overrides
 
77
 
 
78
install_file= /usr/bin/install -p -o root -g root -m 644
 
79
install_program= /usr/bin/install -p -o root -g root -m 755
 
80
make_directory= /usr/bin/install -p -d -o root -g root -m 755
 
81
 
 
82
 
 
83
all build:
 
84
# Builds the binary package.
 
85
# .config is kept so people are not startled by a spurious mail message.
 
86
        $(checkdir)
 
87
        -test ! -f stamp-configure && $(MAKE) -f debian/rules configure
 
88
        $(MAKE)
 
89
        touch stamp-build
 
90
 
 
91
implode:
 
92
        $(checkdir)
 
93
        -test -d debian/Config && (cd debian && \
 
94
           tar zfc debian.tar.gz Config && \
 
95
             uuencode debian.tar.gz debian.tar.gz > debian.uue \
 
96
               && rm -f debian.tar.gz )
 
97
explode:
 
98
        $(checkdir)
 
99
        -test ! -d debian/Config && (cd debian && uudecode debian.uue \
 
100
           && tar zfx debian.tar.gz && rm -f debian.tar.gz )
 
101
 
 
102
configure: stamp-configure
 
103
 
 
104
stamp-configure:
 
105
# Builds the binary package.
 
106
# .config is kept so people are not startled by a spurious mail message.
 
107
        $(checkdir)
 
108
        -test ! -d debian/Config && $(MAKE) -f debian/rules explode
 
109
        -test ! -f stamp-configure && \
 
110
            cp -rpf debian/Config .config && \
 
111
            cp -pf debian/config.over config.over && \
 
112
                sh ./Configure \
 
113
                -de \
 
114
                -D prefix=$(PREFIX) \
 
115
                -D orgname=/etc/news/organization \
 
116
                -D cf_email='$(email)' \
 
117
                -D pager=/bin/more \
 
118
                -D defeditor=/usr/bin/ae \
 
119
                -D privlib=/usr/share/$(package) \
 
120
                -D mansrc=/usr/share/man/
 
121
                -D d_berknames='define' \
 
122
                && touch stamp-configure
 
123
 
 
124
clean:
 
125
# Undoes the effect of `make -f debian/rules build'.
 
126
        $(checkdir)
 
127
        rm -f $(FILES_TO_CLEAN)
 
128
        rm -rf $(DIRS_TO_CLEAN)
 
129
        -test -f Makefile && $(MAKE) clobber
 
130
        rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o \
 
131
          -name '*~' -o -name '*.bak' -o -name '#*#' -o \
 
132
          -name '.*.orig' -o -name '.*.rej' -o -name '.SUMS' -o \
 
133
          -size 0 \) -print` TAGS
 
134
 
 
135
 
 
136
binary: binary-arch binary-indep
 
137
 
 
138
binary-arch: build
 
139
# builds the architecture dependent part
 
140
 
 
141
binary-indep: build stamp-binary
 
142
 
 
143
stamp-binary:
 
144
# Makes a binary package.
 
145
        @test $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
 
146
                (echo need root priviledges; exit 1)
 
147
        $(checkdir)
 
148
        test -f stamp-build || $(MAKE) -f debian/rules build
 
149
        rm -rf              $(TMPTOP)
 
150
        $(make_directory)   $(TMPTOP)
 
151
        chmod g-s           $(TMPTOP)
 
152
        $(make_directory)   $(TMPTOP)/DEBIAN
 
153
        $(make_directory)   $(BINDIR)
 
154
        $(make_directory)   $(MAN1DIR)
 
155
        $(make_directory)   $(MAN7DIR)
 
156
        $(make_directory)   $(DOCDIR)
 
157
        $(make_directory)   $(LIBDIR)
 
158
        $(make_directory)   $(PRIVLIB)
 
159
        $(make_directory)    $(LINTIANDIR)
 
160
        echo                "dist: postinst-does-not-set-usr-doc-link" \
 
161
                                >> $(LINTIANDIR)/dist
 
162
        $(install_program)  debian/postinst   $(TMPTOP)/DEBIAN/postinst
 
163
        $(install_program)  debian/prerm      $(TMPTOP)/DEBIAN/prerm
 
164
        $(install_file)     debian/changelog  $(DOCDIR)/changelog.Debian
 
165
        $(install_file)     ChangeLog         $(DOCDIR)/changelog
 
166
        $(install_file)     README            $(DOCDIR)/README
 
167
        $(install_file)     debian/README     $(DOCDIR)/README.Debian
 
168
        $(install_file)     Credits           $(DOCDIR)/Credits
 
169
        $(install_file)     Known_bugs        $(DOCDIR)/Known_bugs
 
170
        $(install_file)     jmake/README      $(DOCDIR)/README.jmake
 
171
        $(install_file)     jmake/NOTES       $(DOCDIR)/NOTES.jmake
 
172
        $(install_file)     kit/README        $(DOCDIR)/README.kit
 
173
        $(install_file)     pat/README        $(DOCDIR)/README.pat
 
174
        $(install_file)     mcon/INTRO        $(DOCDIR)/INTRO.mcon
 
175
        $(install_file)     mcon/README       $(DOCDIR)/README.mcon
 
176
        $(install_file)     mcon/NOTES        $(DOCDIR)/NOTES.mcon
 
177
        gzip -9fqr          $(DOCDIR)
 
178
# Make sure the copyright file is not compressed
 
179
        $(install_file)     debian/copyright  $(DOCDIR)/copyright
 
180
        $(MAKE)             install
 
181
        $(MAKE)             install.man
 
182
        mv                  $(MAN1DIR)/dist.1 $(MAN7DIR)/dist.7
 
183
        gzip -9fqr          $(MANDIR)
 
184
        (cd                 $(MAN1DIR); \
 
185
                            for file in $(PAT_EXEC) ; do \
 
186
                                ln -s pat.1.gz $$file.1.gz ; \
 
187
                            done )
 
188
        chmod -R u+w        debian/tmp/usr/
 
189
        dpkg-gencontrol -isp
 
190
        dpkg --build        debian/tmp ..
 
191
 
 
192
 
 
193
checkroot:
 
194
        test $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
 
195
                (echo need root priviledges; exit 1)
 
196
 
 
197
define checkdir
 
198
        test -f  mcon/mconfig.SH -a -f debian/rules
 
199
endef
 
200
 
 
201
source diff:
 
202
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
203
 
 
204
 
 
205
.PHONY: binary binary-arch binary-indep clean
 
206