File: rules

package info (click to toggle)
nvi 1.79-5
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 5,380 kB
  • ctags: 3,767
  • sloc: ansic: 42,482; sh: 1,497; tcl: 1,124; makefile: 776; perl: 240; awk: 24; csh: 13
file content (89 lines) | stat: -rwxr-xr-x 2,809 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/make -f
# Sample debian.rules file - for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified

# There used to be `source' and `diff' targets in this file, and many
# packages also had `changes' and `dist' targets.  These functions
# have been taken over by dpkg-source, dpkg-genchanges and
# dpkg-buildpackage in a package-independent way, and so these targets
# are obsolete.

package=nvi

# This is needed for the install target
curdir=$(shell pwd)

# This bit with build.deb is because the nvi package has a
# 'build' directory, and the normal use of 'touch build' won't
# work.

build: build.deb

build.deb:
	$(checkdir)
	(cd ./build && CC=gcc ADDCPPFLAGS="-O2 -g" ./configure --prefix=/usr --disable-curses --datadir=/usr/lib --program-prefix=n)
	(cd ./build && make)
	touch build.deb


clean:
	$(checkdir)
	-rm -f build.deb
	(cd ./build && make distclean || /bin/true )
	-rm -rf *~ debian/tmp debian/*~ debian/files*

binary-indep:	checkroot build.deb
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch:	checkroot build.deb
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp/usr/bin debian/tmp/etc
	(cd build && make install prefix=$(curdir)/debian/tmp/usr)
	-rmdir debian/tmp/usr/man/cat1
	chmod u+w debian/tmp/usr/bin/* debian/tmp/usr/man/man1/nvi.*
	cp LICENSE debian/copyright
	# Compress the man pages -- debstd can't do this because they
        # are all links. Also, make them soft links instead of hard links
	(cd debian/tmp/usr/man/man1 && \
	        rm {nex,nview}.1 && gzip -9 nvi.1 && \
		ln -s nvi.1.gz nex.1.gz && ln -s nvi.1.gz nview.1.gz)
# Must have debmake installed for this to work. Otherwise please copy
# /usr/bin/debstd into the debian directory and change debstd to debian/debstd
	debstd -m  docs/changelog README FAQ
	#
	# Compress the changelogs if debstd didn't
	#
	( set -e && cd debian/tmp/usr/doc/nvi && \
	   if [ -f changelog ] ; then gzip -9 changelog ; fi &&\
	   if [ -f changelog.Debian ] ; then gzip -9 changelog.Debian;fi)
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..


define checkdir
	test -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot