File: rules

package info (click to toggle)
libchipcard 0.9.1-7sarge0
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,100 kB
  • ctags: 3,331
  • sloc: ansic: 21,004; cpp: 14,526; sh: 10,639; makefile: 1,588; sed: 300
file content (219 lines) | stat: -rwxr-xr-x 6,984 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
218
219
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

LIBCHIPCARD_BASENAME=libchipcard20
LIBCHIPCARD_PKGNAME=$(LIBCHIPCARD_BASENAME)
LIBCHIPCARD_DEV_PKGNAME=$(LIBCHIPCARD_PKGNAME)-dev
LIBCHIPCARD_TOOLS_PKGNAME=chipcard-tools
LIBCHIPCARD_COMMON_PKGNAME=libchipcard-common
LIBCHIPCARD_DOC_PKGNAME=libchipcard-doc

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

# This is the debhelper compatibility version to use.
export DH_COMPAT=4

# 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)
DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)

## tv-added still needed here?
export DESTDIR=$(CURDIR)/debian/tmp

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

#### libc detection taken from Junichi Uekawa's newt package. Thanks.
#target specific configurations come here:
LIBCDEV=libc-dev
GPMSUPPORT=

ifeq ($(DEB_BUILD_GNU_SYSTEM),linux)
LIBCDEV=libc6-dev
ifeq ($(DEB_BUILD_GNU_CPU),alpha)
LIBCDEV=libc6.1-dev
endif
ifeq ($(DEB_BUILD_GNU_CPU),ia64)
LIBCDEV=libc6.1-dev
endif
endif
ifeq ($(DEB_BUILD_GNU_SYSTEM),gnu)
LIBCDEV=libc0.3-dev
endif

# shared library versions, option 1
version=20.0.0
major=20
# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
#version=`ls src/.libs/lib*.so.* | \
# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
#major=`ls src/.libs/lib*.so.* | \
# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`

configure:
	# if were building from CVS
	# was:	make -f Makefile.dist dist, but we don't want the rm's
	if [ -e Makefile.dist ] ; then \
	  echo ********************* && \
	  echo * Building from CVS * && \
	  echo ********************* && \
	  cat acinclude.m4.in m4/*.m4 >acinclude.m4 ; \
	  cat acconfig.h.in m4/*.h >acconfig.h ; \
	  aclocal ; \
	  autoheader ; \
	  automake --include-deps ; \
	  autoconf2.50 ; \
	  touch stamp-h.in ; \
	fi

config.status: configure
	dh_testdir
	# Add here commands to configure the package.
	./configure --host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc/libchipcard \
--datadir=\$${prefix}/share --enable-full-doc --localstatedir=/var \
--enable-syslog-logging --with-pcsc-includes=/usr/include/PCSC


build-arch: config.status build-arch-stamp
build-arch-stamp:
	dh_testdir

	# Add here command to compile/build the package.
	$(MAKE)

	touch build-arch-stamp

build-indep: config.status build-indep-stamp
build-indep-stamp:
	dh_testdir

	# Add here command to compile/build the arch indep package.
	# It's ok not to do anything here, if you don't need to build
	#  anything for this package.
	#/usr/bin/docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1

	touch build-indep-stamp

build: build-arch build-indep

amfiles := $(shell find $(CURDIR) -type f -and -name \*.am)

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp 

	# Add here commands to clean up after the build process.
	-$(MAKE) clean distclean

	# Martin seems to have forgotten those in 0.8.0
	-rm -f src/tools/pam/Makefile \
	       src/tools/rsacard/Makefile \
	       src/tools/hbcicard/po/de.mo

	-test -r /usr/share/misc/config.sub && \
	  cp -f /usr/share/misc/config.sub config.sub
	-test -r /usr/share/misc/config.guess && \
	  cp -f /usr/share/misc/config.guess config.guess

	# If were building from CVS (this might be too much...)
	if [ -e Makefile.dist ] ; then \
	  rm -f configure config.h.in aclocal.m4 acconfig.h acinclude.m4 ; \
	  rm -f $(patsubst %.am,%.in,$(amfiles)) ; \
	  rm -f $(patsubst %.am,%,$(amfiles)) ; \
	fi
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/tmp
	# install -d -m 755 $(CURDIR)/debian/tmp/usr/bin
	# install -d -m 755 $(CURDIR)/debian/tmp/usr/sbin
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	# Use our own configs instead of examples
	-cp debian/debian-configuration/chipcardd.conf debian/$(LIBCHIPCARD_TOOLS_PKGNAME)/etc/libchipcard/chipcardd.conf
	-cp debian/debian-configuration/chipcardc.conf debian/$(LIBCHIPCARD_COMMON_PKGNAME)/etc/libchipcard/chipcardc.conf
	# prefix=$(CURDIR)/debian/tmp/usr sysconfdir=$(CURDIR)/debian/tmp/etc/libchipcard
	HTML_OUTPUT="debian/$(LIBCHIPCARD_DOC_PKGNAME)/usr/share/doc/$(LIBCHIPCARD_PKGNAME)/html"; \
	mkdir -p $$HTML_OUTPUT ; \
	echo -e HAVE_DOT=NO\\nGENERATE_MAN=NO\\nHTML_OUTPUT=$$HTML_OUTPUT\\nGENERATE_TAGFILE=$$HTML_OUTPUT/libchipcard.tag | cat Doxyfile -  | doxygen -


# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_movefiles -i

#	dh_installdebconf
	dh_installdocs -i
	find debian/*/usr/share/doc/ -type f -size 0 -and -exec rm '{}' ';'
#	dh_installman -i
	dh_installman -p$(LIBCHIPCARD_COMMON_PKGNAME) $(CURDIR)/doc/man/chipcardc.conf.5 $(CURDIR)/doc/man/libchipcard.conf.5

	dh_installchangelogs -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_movefiles -a

#	dh_installdebconf
	dh_installdocs -p$(LIBCHIPCARD_PKGNAME) -X chipcardd.conf debian/debian-configuration/example
	dh_installdocs -p$(LIBCHIPCARD_DEV_PKGNAME) -X Makefile doc/html/*.html doc/html/pics doc/*.txt
	dh_installdocs -p$(LIBCHIPCARD_TOOLS_PKGNAME) -X chipcardc.conf debian/debian-configuration/example
	find debian/*/usr/share/doc/ -type f -size 0 -and -exec rm '{}' ';'
#	dh_installexamples -i
#	dh_installmenu -i
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
	dh_installinit -p$(LIBCHIPCARD_TOOLS_PKGNAME) -- defaults 55 45
#	dh_installcron

	dh_installman -p$(LIBCHIPCARD_TOOLS_PKGNAME) \
	$(CURDIR)/doc/man/chipcardd.conf.5 $(CURDIR)/doc/man/ctfstool.1 \
	$(CURDIR)/doc/man/chipcardd.1 $(CURDIR)/doc/man/geldkarte.1 \
	$(CURDIR)/doc/man/kvkd.1 $(CURDIR)/doc/man/hbcicard.1 \
	$(CURDIR)/doc/man/readertest.1 $(CURDIR)/doc/man/cardcommander.1 \
	$(CURDIR)/doc/man/memcard.1
	dh_installman -p$(LIBCHIPCARD_DEV_PKGNAME) $(CURDIR)/doc/man/libchipcard-config.1
#	dh_installinfo -a
	dh_installchangelogs -a ChangeLog
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a
	dh_installdeb -a
#	dh_perl
	dh_shlibdeps -a -ldebian/$(LIBCHIPCARD_PKGNAME)/usr/lib
	dh_gencontrol -a -- -Vlibcdev=$(LIBCDEV)
	dh_md5sums -a
	dh_builddeb -a

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