File: rules

package info (click to toggle)
freebsd5-buildutils 5.3%2B2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 900 kB
  • ctags: 8
  • sloc: perl: 99; makefile: 65
file content (90 lines) | stat: -rwxr-xr-x 2,800 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
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

package 			= freebsd5-buildutils
DEB_TAR_SRCDIR			= src
DEB_AUTO_UPDATE_DEBIAN_CONTROL	= yes

CFLAGS=-O2 -g -Wall -DMACHINE_ARCH='\"$(DEB_BUILD_GNU_CPU)\"'
MAKE_BUILD_FLAGS= COPTS="$(CFLAGS)" NO_WERROR=1 NOGCCERROR=1 NOSHARED=NO
# NO_WERROR for freebsd-make, NOGCCERROR for pmake
PMAKE=pmake
YACC=`ls $(CURDIR)/$(DEB_SRCDIR)/usr.bin/yacc/yacc 2>/dev/null || which yacc`
SUBDIRS=$(BINDIRS) $(SBINDIRS)

makebuilddir/$(package)::
	find $(_cdbs_tarball_dir) -type d -name CVS | xargs rm -rf

build/$(package):: apply-patches
	cd $(DEB_SRCDIR)/usr.bin/yacc ; \
		$(PMAKE) $(MAKE_BUILD_FLAGS)

	cd $(DEB_SRCDIR)/contrib/one-true-awk ; \
		$(YACC) -d -o awkgram.c ../../contrib/one-true-awk/awkgram.y
	cd $(DEB_SRCDIR)/usr.bin/awk ; \
		ln -sf ../../contrib/one-true-awk/awkgram.h ytab.h ; \
		$(PMAKE) $(MAKE_BUILD_FLAGS)

	cd $(DEB_SRCDIR)/usr.bin/cksum ; $(PMAKE) $(MAKE_BUILD_FLAGS)

	cd $(DEB_SRCDIR)/usr.bin/lex ; \
		$(PMAKE) bootstrap ; \
		$(YACC) -d -o parse.c parse.y ; \
		$(PMAKE) $(MAKE_BUILD_FLAGS)

	cd $(DEB_SRCDIR)/usr.bin/make ; \
		$(PMAKE) $(MAKE_BUILD_FLAGS)

	cd $(DEB_SRCDIR)/usr.bin/mkdep ; $(PMAKE) $(MAKE_BUILD_FLAGS)

	cd $(DEB_SRCDIR)/usr.sbin/config ; \
		$(YACC) -d config.y ; \
		cp y.tab.c config.c ; \
		$(PMAKE) $(MAKE_BUILD_FLAGS)

	cd $(DEB_SRCDIR)/usr.sbin/mtree ; $(PMAKE) $(MAKE_BUILD_FLAGS)
	cd $(DEB_SRCDIR)/usr.bin/file2c ; $(PMAKE) $(MAKE_BUILD_FLAGS)
	cd $(DEB_SRCDIR)/usr.bin/brandelf ; $(PMAKE) $(MAKE_BUILD_FLAGS)

binary/$(package):: common-install-prehook-arch
	dh_installdirs
	for i in awk cksum lex make mkdep yacc file2c brandelf ; do \
		cd $(CURDIR)/$(DEB_SRCDIR)/usr.bin/$$i; \
		$(PMAKE) install DESTDIR=$(CURDIR)/debian/$(package) BINDIR=/usr/bin ; \
	done
	for i in mtree config ; do \
		cd $(CURDIR)/$(DEB_SRCDIR)/usr.sbin/$$i; \
		$(PMAKE) install DESTDIR=$(CURDIR)/debian/$(package) BINDIR=/usr/sbin ; \
	done
	cd $(DEB_SRCDIR)/share/mk ; \
		$(PMAKE) install \
		DESTDIR=$(CURDIR)/debian/$(package) BINDIR=/usr/share

	# remove trash
	rm -rf 	debian/$(package)/usr/include \
		debian/$(package)/usr/share/man \
		debian/$(package)/var

	# rename awk
	mv debian/$(package)/usr/bin/nawk \
		debian/$(package)/usr/bin/awk

	# relocate binaries
	mv \
		debian/$(package)/usr/bin/* \
		debian/$(package)/usr/sbin/* \
		debian/$(package)/usr/lib/freebsd/
	for i in `cd debian/$(package)/usr/lib/freebsd && ls` ; do \
		ln -s ../lib/freebsd/$$i \
		debian/$(package)/usr/bin/freebsd-$$i ; \
	done
	rmdir debian/$(package)/usr/sbin

	# make stuff
	mv debian/$(package)/usr/share/mk \
		debian/$(package)/usr/share/$(package)/mk

include /usr/share/cdbs/1/rules/tarball.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/debhelper.mk