[go: up one dir, main page]

File: rules

package info (click to toggle)
irda-utils 0.9.16-9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,136 kB
  • ctags: 1,140
  • sloc: sh: 10,088; ansic: 7,251; makefile: 327; perl: 83
file content (128 lines) | stat: -rwxr-xr-x 3,941 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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS = "-g -O0 -Wall"
else
	CFLAGS = "-g -O2 -Wall"
endif

INSTALLDIR=`pwd`/debian/irda-utils
INSTALLDOCDIR=$(INSTALLDIR)/usr/share/doc/irda-utils

build: build-stamp
build-stamp:
	dh_testdir

	(cd irdadump; ./autogen.sh --prefix=/usr CFLAGS=$(CFLAGS); $(MAKE) RPM_OPT_FLAGS=$(CFLAGS))
	(cd irattach;$(MAKE) RPM_OPT_FLAGS=$(CFLAGS))
	(cd irdaping; $(MAKE) SYS_INCLUDES=-I/usr/include RPM_OPT_FLAGS=$(CFLAGS))
	(cd irnetd; $(MAKE) RPM_OPT_FLAGS=$(CFLAGS))
	(cd psion; $(MAKE) RPM_OPT_FLAGS=$(CFLAGS))
	if [ "$(DEB_BUILD_GNU_TYPE)" = "i386-linux" ]; then \
		(cd findchip; $(MAKE) RPM_OPT_FLAGS=$(CFLAGS)); \
	fi

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp ChangeLog

	# install new config.{sub,guess}
	-[ -e irdadump/config.sub ] && mv irdadump/config.sub irdadump/config.sub.old
	-[ -e irdadump/config.guess ] && mv irdadump/config.guess irdadump/config.guess.old
	cp /usr/share/misc/config.guess irdadump/
	cp /usr/share/misc/config.sub irdadump/


	# cover ChangeLog issues
	rm -f ChangeLog irdadump/ChangeLog.irdadump irattach/ChangeLog.irdadump

	# put back old config.{sub,guess}
	-[ -e irdadump/config.sub.old ]   && mv -f irdadump/config.sub.old irdadump/config.sub
	-[ -e irdadump/config.guess.old ] && mv -f irdadump/config.guess.old irdadump/config.guess

	# Add here commands to clean up after the build process.
	-$(MAKE) clean
	-(cd irattach; $(MAKE) distclean)
	-(cd irdadump; $(MAKE) distclean; rm -rf depcomp missing mkinstalldirs install-sh autom4te.cache)
	-(cd irdaping; $(MAKE) distclean)
	-(cd irnetd; $(MAKE) distclean)
	-(cd psion; $(MAKE) distclean)
	-(cd findchip; $(MAKE) distclean)

	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/tmp.
	install irattach/irattach $(INSTALLDIR)/usr/sbin
	mkdir -p $(INSTALLDIR)/etc/devfs/conf.d
	cp `pwd`/debian/devfs-conf.d-irda $(INSTALLDIR)/etc/devfs/conf.d/irda
	if [ "$(DEB_BUILD_GNU_TYPE)" = "i386-linux" ]; then \
		install findchip/findchip $(INSTALLDIR)/usr/sbin; \
	fi

	install irdadump/shell/irdadump $(INSTALLDIR)/usr/sbin
	install irdaping/irdaping $(INSTALLDIR)/usr/sbin
	install irnetd/irnetd $(INSTALLDIR)/usr/sbin
	install psion/irpsion5 $(INSTALLDIR)/usr/sbin

	# some ChangeLog and README issues
	mkdir -p $(INSTALLDOCDIR)
	echo "There is no ChangeLog for the whole package. Check the invidual ChangeLogs." > $(INSTALLDOCDIR)/changelog
	gzip -9 $(INSTALLDOCDIR)/changelog
	cp irdadump/ChangeLog $(INSTALLDOCDIR)/ChangeLog.irdadump
	cp irdadump/README $(INSTALLDOCDIR)/README.irdadump
	cp irattach/ChangeLog $(INSTALLDOCDIR)/ChangeLog.irattach

	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
#	dh_installexamples
#	dh_installmenu
#	dh_installemacsen
	dh_installinit
#	dh_installcron
	dh_installdebconf
	if [ "$(DEB_BUILD_GNU_TYPE)" = "i386-linux" ]; then \
		dh_installman man/findchip.8.gz; \
	fi
	dh_installman man/irattach.8.gz man/irdadump.8.gz man/irdaping.8.gz man/irpsion5.8.gz man/irnet.4.gz man/irnetd.8.gz man/irda.7.gz
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
#	dh_suidregister
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
#	dh_makeshlibs
	dh_md5sums
	dh_builddeb


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