File: rules

package info (click to toggle)
afio 2.5-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 612 kB
  • ctags: 469
  • sloc: ansic: 4,678; sh: 526; makefile: 112; awk: 19
file content (91 lines) | stat: -rwxr-xr-x 2,669 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
#!/usr/bin/make -f
# 							-*- makefile -*-
# debian/rules file for the Debian/GNU Linux afio package
# Copyright 1995-2003 by Dirk Eddelbuettel <edd@debian.org>

include /usr/share/dpatch/dpatch.make

package	:= $(shell grep Package debian/control | sed 's/^Package: //')
version	:= $(shell head -1 debian/changelog | \
			perl -nle 'm/\S+\s+\((\S+)\)/ && print $$1')
debtmp	:= $(shell pwd)/debian/afio
debman	:= $(debtmp)/usr/share/man/

arch	:= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# afiofile = debian/afio.test
# trickfile = ./tricked_yah

build: patch-stamp build-stamp test
build-stamp:
	dh_testdir
	# save original exten_default.h
	cp exten_default.h exten_default_orig.h
	# that doesn't work here ... $(MAKE) CC=gcc CFLAGS=-O2 LDFLAGS=-s
	$(MAKE) 
	touch build-stamp

clean: do-clean unpatch
do-clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp test-stamp $(afiofile)
	# restore original exten_default.h
	if test -e exten_default_orig.h; then \
	    mv exten_default_orig.h exten_default.h; \
	fi
	-$(MAKE) clean 
	dh_clean

test: test-stamp
test-stamp:
	dh_testdir
        #dh_testroot
        ## edd 28 Jul 2002 Creating afio archive 
        ## edd 28 Jul 2002 Uncommenting $(trickfile) blows up, as it should
        ##echo 1 > $(trickfile)
        ##find . -path './debian' -prune -o -print | ./afio -v -o $(afiofile)
        ## edd 28 Jul 2002 Verifying afio archive
        ##echo 2 > $(trickfile)
        # find . -path './debian' -prune -o -print | ./afio -v -r $(afiofile)
        # md5sum $(afiofile)
        # rm -vf $(afiofile) $(trickfile)
        # Calling tests provided by upstream
	@echo "*** Calling make regtest ***"
	-$(MAKE) regtest 	
ifneq "$(findstring $(arch), i386-linux ia64-linux powerpc-linux)" ""
	@echo "*** Calling make regtest2gb ***" 	
	-$(MAKE) regtest2gb
endif
	touch test-stamp

binary-indep: build test

# Build architecture-dependent files here.
binary-arch: build test
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	#$(MAKE) prefix=`pwd`/debian/afio install
	install -s -m 0755 -s afio 		$(debtmp)/bin/.
	install -p -m 0644 -c afio.1 		$(debman)/man1/afio.1
	dh_installdocs				README HISTORY SCRIPTS 
	dh_link			usr/share/doc/$(package)/HISTORY \
				usr/share/doc/$(package)/changelog 
	dh_installexamples			script?
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary test patch unpatch