File: rules

package info (click to toggle)
gom 0.29.103-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 564 kB
  • ctags: 321
  • sloc: ansic: 3,206; sh: 896; makefile: 77
file content (143 lines) | stat: -rwxr-xr-x 3,628 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
140
141
142
143
#!/usr/bin/make -f
#
# debian/rules file for gom.
#
# Copyright 1997-1999 Stephan Alexander Suerken <absurd@debian.org>.
#

SHELL=/bin/bash

#
# CONFIGURATION
#
export DH_VERBOSE=0

#
# GENERIC PART
#
# build should always be the default target
default: build
build: build-stamp

binary:	binary-clean 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 binary-clean

#
# PACKAGE PART
#
# Note 0.29.99: The upstream source is planning to skip the xview interactive
#       interface and with it, the compile-option to create different binary
#       flavors for gom -- but use one standard gom binary with the
#       mandatory command line interface and the ncurses interactive
#       interface. With 0.29.99, the default is to compile that standard
#       version; support for the xview interface is still there.
#       Conclusion: For now, I stay with the old naming convention and
#       alternatives, leaving out the (now unavailable) command line only
#       "gom-c" binary.

# Binaries are named gom-{c|t|x}
# c: with command line interface (mandatory)
# t: with build-in interactive terminal interface (ncurses)
# x: with build-in interactive X interface (xview)
binaries_gom=gom-ct
binaries_gom-x=gom-ctx
binaries=${binaries_gom} ${binaries_gom-x}

# these are the options (needed for the implicit rule)
configure_options_ct=
configure_options_ctx=--enable-x-gomii

gom-%:
	dh_testdir
	./configure ${configure_options_$*} && make clean && make
	cp src/gom $@

build-stamp: ${binaries}
	touch $@

binary-indep: build
	dh_testdir
	dh_testroot
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.


#
# Hack for slink (debhelper). Only needed once.
#
std_man_dir=$(shell if grep --quiet "2.1" /etc/debian_version; then echo -n "man" ; else echo -n "share/man"; fi)

binary-arch: build
	dh_testdir
	dh_testroot

# Install the binaries
	install -d debian/tmp/usr/bin
	install ${binaries_gom} debian/tmp/usr/bin
	install -d debian/gom-x/usr/X11R6/bin
	install ${binaries_gom-x} debian/gom-x/usr/X11R6/bin

# Install gomconfig
	install -d debian/tmp/usr/sbin
	install src/gomconfig debian/tmp/usr/sbin

# Install the init file
	dh_installinit --no-restart-on-upgrade --update-rcd-params="start 99 S ."

# Install the modultils file
	install -d debian/tmp/etc/modutils
	install -m644 debian/modutils debian/tmp/etc/modutils/gom

# auto: debian/copyright debian/README.Debian debian/TODO
	dh_installdocs AUTHORS NEWS README
# auto: %
	dh_installexamples examples/*

# auto: %; menu menu-method --or-- package.menu package.menu-method
	dh_installmenu
#	dh_installcron
# auto: all found man pages; exclude args
	dh_installmanpages -pgom gom-ctx.1x
	dh_installmanpages -pgom-x gom.1 gom-ct.1 gomconfig.8

# auto: debian/changelog
	dh_installchangelogs ChangeLog

# no need for movefiles
#	dh_movefiles
	dh_strip
	dh_compress --all
# HACK: dh_compress' symlink gom-ctx.1 -> gom.1 in gom-x/usr/X11R6/man/man1/
# is relative && not using .gz appendix. Fixing this.
	cd debian/gom-x/usr/X11R6/man/man1/ && rm gom-ctx.1x && ln -s ../../../${std_man_dir}/man1/gom.1.gz gom-ctx.1x.gz

#	dh_compress -pgom-x

	dh_fixperms

#	dh_suidregister

	dh_installdeb
# dependencies for binaries
	dh_shlibdeps
	dh_gencontrol
#	dh_makeshlibs
	dh_md5sums
	dh_builddeb

binary-clean:
	dh_testdir
	dh_clean

clean: binary-clean
	dh_testdir
	rm -f build-stamp

#### upstream cleanup ####
	-make distclean
	-rm -f build ${binaries} core `find . -type f -name "*~"`