File: rules

package info (click to toggle)
xcircuit 2.5.3rev0-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,292 kB
  • ctags: 3,497
  • sloc: ansic: 41,848; sh: 2,741; python: 473; makefile: 165
file content (139 lines) | stat: -rwxr-xr-x 3,454 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#! /usr/bin/make -f
#
# Invoke each target with `./debian/rules <target>'.  All targets should be
# invoked with the package root as the current directory.
#
# The `binary' target must be run as root, as it needs to install files with
# specific ownership.

P=xcircuit

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

build:
	$(checkdir)
#
# Don't let automake try to rebuild things, the upstream versions are fine.
#
	touch configure.in && \
	touch aclocal.m4 && \
	touch configure && \
	touch Makefile.in && \
	touch Xw/Makefile.in
#
# Build the binary package.
#
	./configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
		--prefix=/usr --mandir=/usr/share/man \
		--with-python=/usr/bin/python2.1
	make librarydir=/usr/share/xcircuit \
		appdefaultdir=/etc/X11/app-defaults
	touch build

clean:
#
# Undo the effect of `make -f debian/rules build'.
#
	$(checkdir)
	rm -f build stamp-build
	if [ -f Makefile ] ; then make distclean; fi
	# Things not cleaned by 'make distclean'...
	rm -f xcircuit.1 menudep.h
	rm -f *.o $(P) core
	rm -rf *~ debian/tmp debian/*~ debian/substvars* debian/files*

binary-indep:
#
# None--
#
	@echo >&2 'No architecture independent portions'

binary binary-arch:	checkroot build
#
# Clean up
#
	rm -rf debian/tmp
#
# Create new temporary directories
#
	install -d debian/tmp debian/tmp/DEBIAN
#
#  Install maintainer scripts
#
	cp debian/preinst debian/tmp/DEBIAN/.
	chmod +x debian/tmp/DEBIAN/preinst
	cp debian/postinst debian/tmp/DEBIAN/.
	chmod +x debian/tmp/DEBIAN/postinst
	cp debian/prerm debian/tmp/DEBIAN/.
	chmod +x debian/tmp/DEBIAN/prerm
	cp debian/postrm debian/tmp/DEBIAN/.
	chmod +x debian/tmp/DEBIAN/postrm
	cp debian/conffiles debian/tmp/DEBIAN/.
#
# Create and populate documentation directory for this package
#
	install -d debian/tmp/usr/share/doc/$(P)
	cp debian/changelog debian/tmp/usr/share/doc/$(P)/changelog.Debian
	cp README* debian/tmp/usr/share/doc/$(P)/.
	cp Manifest debian/tmp/usr/share/doc/$(P)/.
	gzip -9f debian/tmp/usr/share/doc/$(P)/*
#
# Create and populate example directory
#
	install -d debian/tmp/usr/share/doc/$(P)/examples
	cp -R examples/* debian/tmp/usr/share/doc/$(P)/examples
	rm -rf debian/tmp/usr/share/doc/$(P)/examples/CVS
#
# Don't compress the copyright
#
	cp debian/copyright debian/tmp/usr/share/doc/$(P)
#
# Install package binaries
#
	make install prefix=`pwd`/debian/tmp/usr \
		mandir=`pwd`/debian/tmp/usr/share/man \
		appdefaultsdir=`pwd`/debian/tmp/etc/X11/app-defaults \
		librarydir=`pwd`/debian/tmp/usr/share/xcircuit
	strip -R .comment -R .note debian/tmp/usr/bin/xcircuit
#
#  Install menu file
#
	install -d debian/tmp/usr/lib/menu
	install -m 644 debian/menu debian/tmp/usr/lib/menu/$(P)
	install -d debian/tmp/usr/X11R6/include/X11/pixmaps
	install -m 644 debian/xcircuit-icon.xpm \
		debian/tmp/usr/X11R6/include/X11/pixmaps
#
# compress the man page
#
	gzip -9f debian/tmp/usr/share/man/man1/$(P).1
#
# Declare dependencies
#
	dpkg-shlibdeps $(P)
#
# Generate control structures
#
	dpkg-gencontrol -isp
#
# Asure proper permissions and ownership
#
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
#
# Build the binary
#
	dpkg --build debian/tmp ..

#
# Bookkeeping
#
define checkdir:
	test -f $(P).man -a -f debian/rules
endef

checkroot:
	test root = "`whoami`"

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