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
11
## Status : Unknown, Use with caution!
15
###############################################################################
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)
33
# VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | \
34
# sed 's/^Version: *//')
39
# The name of the package (for example, `emacs').
42
# The maintainer information.
43
maintainer = Manoj Srivastava
44
email= srivasta@debian.org
52
# Configuration variables (these should be pretty generic)
54
archlib =`$(PERL) -MConfig -e 'print $$Config{installarchlib}'`
56
# Package specific stuff. The idea is to try to make the rules
57
# generic (gradually).
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 \
63
DIRS_TO_CLEAN = debian/tmp debian/Config
64
PAT_EXEC = patcil patdiff patbase patlog patmake patsend \
65
patnotify patpost patftp patname patsnap patcol \
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
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
84
# Builds the binary package.
85
# .config is kept so people are not startled by a spurious mail message.
87
-test ! -f stamp-configure && $(MAKE) -f debian/rules configure
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 )
99
-test ! -d debian/Config && (cd debian && uudecode debian.uue \
100
&& tar zfx debian.tar.gz && rm -f debian.tar.gz )
102
configure: stamp-configure
105
# Builds the binary package.
106
# .config is kept so people are not startled by a spurious mail message.
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 && \
114
-D prefix=$(PREFIX) \
115
-D orgname=/etc/news/organization \
116
-D cf_email='$(email)' \
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
125
# Undoes the effect of `make -f debian/rules build'.
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
136
binary: binary-arch binary-indep
139
# builds the architecture dependent part
141
binary-indep: build stamp-binary
144
# Makes a binary package.
145
@test $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
146
(echo need root priviledges; exit 1)
148
test -f stamp-build || $(MAKE) -f debian/rules build
150
$(make_directory) $(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
178
# Make sure the copyright file is not compressed
179
$(install_file) debian/copyright $(DOCDIR)/copyright
182
mv $(MAN1DIR)/dist.1 $(MAN7DIR)/dist.7
185
for file in $(PAT_EXEC) ; do \
186
ln -s pat.1.gz $$file.1.gz ; \
188
chmod -R u+w debian/tmp/usr/
190
dpkg --build debian/tmp ..
194
test $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
195
(echo need root priviledges; exit 1)
198
test -f mcon/mconfig.SH -a -f debian/rules
202
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
205
.PHONY: binary binary-arch binary-indep clean