File: rules

package info (click to toggle)
mush 7.2.5unoff2-6
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 1,664 kB
  • ctags: 1,329
  • sloc: ansic: 21,901; sh: 796; csh: 87; makefile: 72
file content (105 lines) | stat: -rwxr-xr-x 3,418 bytes parent folder | download | duplicates (2)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#! /usr/bin/make -f
#
# Debian rules for building mush (by Yves Arrouye), based on:
#
# 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=mush

build:
	$(checkdir)
	$(MAKE) -f makefile.linux OPT_CFLAGS=-O2 LDFLAGS= OTHER_CFLAGS=-DDEBIAN
	touch build

clean:
	$(checkdir)
	-rm -f build
	-$(MAKE) -f makefile.linux -i distclean
	@if [ -d debian/tmp ]; then \
	  if [ "`whoami`" = root ]; then \
	    rm -rf *~ debian/tmp debian/*~ debian/files*; \
	  else \
	    if [ -x /usr/bin/ssh ]; \
	    then \
	      echo "Cleaning up the debian/tmp directory as root..."; \
	      ssh -l root localhost "cd `pwd`; 2>/dev/null set -o no_nomatch; rm -rf *~ debian/tmp debian/*~ debian/files*"; \
	    else \
	      echo "Enter the root password to clean up the debian/tmp dir..."; \
	      su -c "rm -rf *~ debian/tmp debian/*~ debian/files*"; \
	    fi; \
	  fi; \
	fi

binary-indep: build
	$(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: build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp debian/tmp/DEBIAN
	install -d debian/tmp/usr/doc/$(package)
	cp debian/postinst debian/tmp/DEBIAN/.
	chmod +x debian/tmp/DEBIAN/postinst
	$(MAKE) -f makefile.linux CFLAGS=-O2 LDFLAGS=-s \
	    MRCDIR=debian/tmp/etc MUSHRC=mush.rc \
	    BINDIR=debian/tmp/usr/bin SBINDIR=debian/tmp/usr/sbin \
	    LIBDIR=debian/tmp/usr/lib/mush \
	    MANDIR=debian/tmp/usr/man/man1 MANEXT=1 \
	    OTHER_CFLAGS=-DDEBIAN install
	install -m 644 debian/copyright debian/tmp/usr/doc/$(package)/.
	install -m 644 README README-7.2.5 README*unoff* CHANGES.MIME \
	    debian/tmp/usr/doc/$(package)
	install -m 644 debian/changelog \
	    debian/tmp/usr/doc/$(package)/changelog.Debian
	gzip -9v debian/tmp/usr/doc/$(package)/changelog.Debian
	gzip -9v debian/tmp/usr/doc/$(package)/README
	gzip -9f debian/tmp/usr/man/man*/*.[0-9]*
	ln -s ../man7/undocumented.7.gz debian/tmp/usr/man/man1/maillock.1.gz
	dpkg-shlibdeps mush
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..

define checkdir
	test -f mush.h -a -f debian/rules
endef

# Below here is fairly generic really

binary:
	@if [ "`whoami`" = root ]; then \
	    $(MAKE) -f debian/rules binary-root; \
	else \
	    if [ -x /usr/bin/ssh ]; \
	    then \
		echo "Building the .deb file as root..."; \
		ssh -l root localhost "cd `pwd`; exec $(MAKE) -f debian/rules binary-root"; \
	    else \
	  	echo "Enter the root password to build the .deb file..."; \
	  	su -c "exec $(MAKE) -f debian/rules binary-root"; \
	    fi; \
	fi

binary-root: binary-indep binary-arch

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

.PHONY: binary binary-arch binary-indep clean