File: rules

package info (click to toggle)
mksh 40.9.20120630-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,288 kB
  • sloc: ansic: 39,060; sh: 3,812; perl: 1,018; makefile: 158
file content (217 lines) | stat: -rwxr-xr-x 7,572 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#!/usr/bin/make -f
# $MirOS: contrib/hosted/tg/deb/mksh/debian/rules,v 1.103 2012/06/30 17:24:36 tg Exp $

LC_ALL:=C
export LC_ALL

# for "debian/rules get-orig-source"
ORIGTGZ_SOURCE:=	-D'2012/06/30 16:00'
ORIGTGZ_DESTINATION:=	40.9.20120630
# built from R40-stable branch: R40c+
#ORIGTGZ_SOURCE:=	-rmksh-R40stable -D'2011-11-26 18:30'
# built from R40e tag
#ORIGTGZ_SOURCE:=	-rmksh-R40e
ORIGTGZ_PRINTF:=	-rmksh-R40e
#ORIGTGZ_DESTINATION:=	40.5

# shut up build log checkers that don’t know what they are doing
# Debian #492377, #572252; as well *buntu
_shutup:= 2>&1 | sed \
	    -e 's!conftest.c:\([0-9]*\(:[0-9]*\)*\): error:!cE(\1) -!g' \
	    -e 's!conftest.c:\([0-9]*\(:[0-9]*\)*\): warning:!cW(\1) -!g' \

build-indep:

build-arch: debian/.build_stamp

debian/.build_stamp:
	# goodbye dh_testdir
	test -f sh.h
	test -x debian/rules
	-rm -f $@
	(sh debian/meat ${ORIGTGZ_SOURCE} && :>$@) ${_shutup}
	test -e $@

clean:
	# goodbye dh_testdir
	test -f sh.h
	test -x debian/rules
	-rm -rf builddir
	-rm -rf debian/.*_stamp debian/B debian/mksh debian/pdksh
	# goodbye dh_clean
	-rm -f debian/files debian/substvars

binary-indep: build-indep
	# goodbye dh_testdir
	test -f sh.h
	test -x debian/rules
	# goodbye dh_prep
	-rm -f debian/substvars
	# goodbye dh_installdirs
	-rm -rf debian/pdksh
	mkdir -p debian/pdksh/bin debian/pdksh/usr/share/doc \
	    debian/pdksh/usr/share/lintian/overrides \
	    debian/pdksh/usr/share/man/man1
	# goodbye dh_installchangelogs
	# goodbye dh_installdocs
	ln -s mksh debian/pdksh/usr/share/doc/pdksh
	# goodbye dh_lintian
	cp -a debian/pdksh.lintian \
	    debian/pdksh/usr/share/lintian/overrides/pdksh
	# goodbye dh_link
	ln -s lksh debian/pdksh/bin/pdksh
	ln -s lksh.1.gz debian/pdksh/usr/share/man/man1/pdksh.1.gz
	# goodbye dh_fixperms
	chmod 644 $$(find debian/pdksh -type f)
	chmod 755 $$(find debian/pdksh -type d)
	# goodbye dh_installdeb
	-rm -rf debian/B
	mkdir -p debian/pdksh/DEBIAN debian/B/c
	set -e; for f in postinst preinst; do \
		cp -a debian/pdksh.$$f debian/B/c/$$f; \
	done
	# goodbye dh_gencontrol
	dpkg-gencontrol -ppdksh -Pdebian/pdksh -isp
	mv debian/pdksh/DEBIAN/control debian/B/c/
	rm -rf debian/pdksh/DEBIAN
	# goodbye dh_md5sums
	(cd debian/pdksh && find . -type f | sed s,^./,, | sort | \
	    xargs md5sum) >debian/B/c/md5sums
	# goodbye dh_builddeb
	(cd debian/pdksh && find . | sort | paxcpio \
	    -oC512 -Hustar -Minodes -Mlinks -Muidgid -Mgslash) | \
	    gzip -n9 >debian/B/data.tar.gz
	cd debian/B/c && chmod 644 * && chmod 755 postinst preinst
	(cd debian/B/c && find . | sort | paxcpio \
	    -oC512 -Hustar -Minodes -Mlinks -Muidgid -Mgslash) | \
	    gzip -n9 >debian/B/control.tar.gz
	echo 2.0 >debian/B/debian-binary
	set -e; while read fn rest; do \
		case $$fn in \
		pdksh_*) ;; \
		*) continue ;; \
		esac; \
		cd debian/B && \
		    paxtar -A -M dist -cf "../../../$$fn" \
		    debian-binary control.tar.gz data.tar.gz; \
		break; \
	done <debian/files

binary-arch: build-arch
	# goodbye dh_testdir
	test -f sh.h
	test -x debian/rules
	# goodbye dh_prep
	-rm -f debian/substvars
	# goodbye dh_installdirs
	-rm -rf debian/mksh
	mkdir -p debian/mksh/bin debian/mksh/etc/skel \
	    debian/mksh/usr/share/doc/mksh/examples \
	    debian/mksh/usr/share/lintian/overrides \
	    debian/mksh/usr/share/man/man1 \
	    debian/mksh/usr/share/menu debian/mksh/usr/share/pixmaps
	# goodbye dh_installchangelogs
	cp -a debian/changelog debian/mksh/usr/share/doc/mksh/changelog.Debian
	gzip -n9 debian/mksh/usr/share/doc/mksh/changelog.Debian
	# goodbye dh_installdocs
	cp -a debian/copyright debian/mksh/usr/share/doc/mksh/copyright
	cp builddir/README.Debian.gz debian/mksh/usr/share/doc/mksh/
	cp -a debian/mtest.t check.pl check.t debian/mksh/usr/share/doc/mksh/
	gzip -n9 debian/mksh/usr/share/doc/mksh/mtest.t
	gzip -n9 debian/mksh/usr/share/doc/mksh/check.pl
	gzip -n9 debian/mksh/usr/share/doc/mksh/check.t
	# goodbye dh_installexamples
	cp -a dot.mkshrc debian/mksh/usr/share/doc/mksh/examples/
	gzip -n9 debian/mksh/usr/share/doc/mksh/examples/dot.mkshrc
	# goodbye dh_install
	cp builddir/full/mksh debian/mksh/bin/mksh
	cp builddir/static/mksh debian/mksh/bin/mksh-static
	cp builddir/legacy/lksh debian/mksh/bin/lksh
	cp -a dot.mkshrc debian/mksh/etc/mkshrc
	cp -a debian/.mkshrc debian/mksh/etc/skel/
	cp -a debian/mksh*.xpm debian/mksh/usr/share/pixmaps/
	# goodbye dh_installmenu
	cp -a debian/mksh.menu debian/mksh/usr/share/menu/mksh
	# goodbye dh_installman
	cp -a debian/lksh.1 mksh.1 debian/mksh/usr/share/man/man1/
	gzip -n9 debian/mksh/usr/share/man/man1/lksh.1
	gzip -n9 debian/mksh/usr/share/man/man1/mksh.1
	ln -sf mksh.1.gz debian/mksh/usr/share/man/man1/mksh-static.1.gz
	# goodbye dh_lintian
	cp -a debian/mksh.lintian \
	    debian/mksh/usr/share/lintian/overrides/mksh
	# goodbye dh_strip
ifeq (,$(findstring nostrip,${DEB_BUILD_OPTIONS}))
	strip -s -R .note -R .comment \
	    debian/mksh/bin/lksh debian/mksh/bin/mksh \
	    debian/mksh/bin/mksh-static
endif
	# goodbye dh_fixperms
	chmod 644 $$(find debian/mksh -type f)
	chmod 755 $$(find debian/mksh -type d) \
	    debian/mksh/bin/lksh debian/mksh/bin/mksh \
	    debian/mksh/bin/mksh-static
	# goodbye dh_installdeb
	-rm -rf debian/B
	mkdir -p debian/mksh/DEBIAN debian/B/c
	set -e; for f in conffiles postinst postrm preinst prerm; do \
		cp -a debian/mksh.$$f debian/B/c/$$f; \
	done
	# goodbye dh_shlibdeps
	dpkg-shlibdeps -edebian/mksh/bin/lksh -edebian/mksh/bin/mksh
	# goodbye dh_gencontrol
	dpkg-gencontrol -pmksh -Pdebian/mksh -isp
	mv debian/mksh/DEBIAN/control debian/B/c/
	rm -rf debian/mksh/DEBIAN
	# goodbye dh_md5sums
	cfcmd="grep -Fxv"; while read n; do \
		cfcmd="$$cfcmd -e .$$n"; \
	done <debian/B/c/conffiles; (cd debian/mksh && find . -type f | \
	    $$cfcmd | sed s,^./,, | sort | xargs md5sum) >debian/B/c/md5sums
	# goodbye dh_builddeb
	(cd debian/mksh && find . | sort | paxcpio \
	    -oC512 -Hustar -Minodes -Mlinks -Muidgid -Mgslash) | \
	    gzip -n9 >debian/B/data.tar.gz
	cd debian/B/c && chmod 644 * && chmod 755 postinst postrm preinst prerm
	(cd debian/B/c && find . | sort | paxcpio \
	    -oC512 -Hustar -Minodes -Mlinks -Muidgid -Mgslash) | \
	    gzip -n9 >debian/B/control.tar.gz
	echo 2.0 >debian/B/debian-binary
	set -e; while read fn rest; do \
		case $$fn in \
		mksh_*) ;; \
		*) continue ;; \
		esac; \
		cd debian/B && \
		    paxtar -A -M dist -cf "../../../$$fn" \
		    debian-binary control.tar.gz data.tar.gz; \
		break; \
	done <debian/files
	#-
	gzip -d <builddir/README.Debian.gz | sed \
	    -e '1,/^Details/d' -e '/^Actual/d' -e '/^]/d'

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

_ANONCVSROOT:=		_anoncvs@anoncvs.mirbsd.org:/cvs
_CVSEXPORT:=		env CVS_RSH=ssh TZ=UTC cvs -qd ${_ANONCVSROOT} export

get-orig-source:
	rm -rf $@.tmp
	mkdir $@.tmp
	# to get a Debian .orig.tar.gz we need to pull the source from CVS
	cd $@.tmp; ${_CVSEXPORT} ${ORIGTGZ_SOURCE} mksh
	rm -f $@.tmp/mksh/Makefile	# MirBSD only
	# and add an implementation of the printf shell builtin from UCB
	cd $@.tmp; ${_CVSEXPORT} ${ORIGTGZ_PRINTF} src/usr.bin/printf/printf.c
	# then mix those together, rename and pack it up
	mv $@.tmp/src/usr.bin/printf/printf.c $@.tmp/mksh/
	mv $@.tmp/mksh $@.tmp/mksh-${ORIGTGZ_DESTINATION}.orig
	cd $@.tmp; find mksh-${ORIGTGZ_DESTINATION}.orig -type f | sort | \
	    paxcpio -oC512 -Hustar -Mdist | gzip -n9 \
	    >../mksh_${ORIGTGZ_DESTINATION}.orig.tar.gz
	rm -rf $@.tmp
	# there we are...
	ls -l mksh_${ORIGTGZ_DESTINATION}.orig.tar.gz