File: rules

package info (click to toggle)
dcmtk 3.5.4-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 23,784 kB
  • ctags: 22,942
  • sloc: cpp: 165,761; ansic: 46,396; sh: 3,808; perl: 3,465; makefile: 3,097
file content (209 lines) | stat: -rwxr-xr-x 5,987 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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.

include /usr/share/quilt/quilt.make

# 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)

# See: http://forum.dcmtk.org/viewtopic.php?t=1237
ARCH=""

# Package installation directories
pkg=dcmtk
PKGDIR_DCMTK=$(CURDIR)/debian/$(pkg)
PKGDIR_DCMTK_LIB=$(CURDIR)/debian/libdcmtk1
PKGDIR_DCMTK_DEV=$(CURDIR)/debian/libdcmtk1-dev
PKGDIR_DCMTK_DOC=$(CURDIR)/debian/$(pkg)-doc
PKGDIR_DCMTK_WWW=$(CURDIR)/debian/$(pkg)-www

# Library version
LIB_VERSION=1.0.0

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

config/config.status: configure
	dh_testdir

	# keep ap copy of the original config files to be able to move
	# them back right into place in the clean target
	cd config && mkdir backup && cp -a config* confmod include backup
	cd config && ./autoall && cd .. && 			\
	./configure 	--host=$(DEB_HOST_GNU_TYPE)		\
			--build=$(DEB_BUILD_GNU_TYPE)		\
			--prefix=/usr				\
			--exec-prefix=/usr			\
			--mandir=\$${prefix}/share/man 		\
			--infodir=\$${prefix}/share/info 	\
			--includedir=\$${prefix}/include	\
			--libdir=\$${prefix}/lib		\
			--datadir=\$${prefix}/share		\
			--sysconfdir=/etc/$(pkg)		\
			--with-private-tags 			\
			--with-libxml                  	\
			--with-libtiff                  	\
			--with-zlib                     	\
			--with-libpng                   	\
			--with-libwrap 				\
			--with-openssl


build-arch: $(QUILT_STAMPFN) config/config.status build-arch-stamp
build-arch-stamp:
	dh_testdir

	# Add here commands to compile the package.

	# We have to perfom some magic here to have the dcmtk utilies 
	# linked against shared dcmtk libs without forcing the utilities 
	# themselves to be compiled with -fPIC as well. 
	# In a first step we adjust config/Makefile.def to
	# build shared libraries. In a second step we build
	# the shared libs only (i.e. without utilities). In a third step we 
	# restore the original state of config/Makefile.def. In a forth 
	# step we run `make clean' on the source tree. (This leaves the
	# *.so libs untouched but forces recompilation in the next step.) 
	# In the last step we run `make all'. This will build both the 
	# utilities and the static libraries without -fPIC but links the 
	# utilities dynamically against the shared library versions.

	# make sure dot wrapper for doxygen executable
	chmod 755 debian/dot

	mv config/Makefile.def config/Makefile.def.static && \
	sed -e '/^CFLAGS =/s/-O/-fPIC -O2/' -e '/^CXXFLAGS =/s/-O/-fPIC -O2/' \
	-e '/^AR =/s/ar/gcc/' -e '/^ARFLAGS =/s/cruv/-shared -Wl,-soname,\$$\@.1 -o/' \
	-e '/^LIBEXT =/s/a/so/' -e '/^RANLIB =/s/ranlib/:/' \
	<config/Makefile.def.static >config/Makefile.def && \
	$(MAKE) libsrc-all && \
	mv config/Makefile.def.static config/Makefile.def && \
	$(MAKE) clean && \
	$(MAKE) 

	touch build-arch-stamp

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

	$(MAKE) html

	touch build-indep-stamp


build: build-arch build-indep

clean: unpatch
	dh_testdir
	dh_testroot
	if [ -d config/backup ] ; then cd config; mv backup/* . ; rm -rf backup ; fi
	rm -f build-arch-stamp build-indep-stamp config/config.status

	[ ! -f config/Makefile.def ] || $(MAKE) distclean

	# Do not forget to remove shared libs as well
	find $(CURDIR) -name '*.so' -exec rm -f \{\} \;

	-test -r config/lzwtest.tif && \
		rm -f config/lzwtest.tif

ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config/config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config/config.guess
endif

	dh_clean 

install: install-indep install-arch
install-indep: build-indep
	dh_testdir
	dh_testroot
	dh_prep -i
	dh_installdirs -i

	$(MAKE) install-html DESTDIR=$(PKGDIR_DCMTK_DOC)

install-arch: build-arch
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -a

	$(MAKE) install DESTDIR=$(PKGDIR_DCMTK) && \
	$(MAKE) install-lib DESTDIR=$(PKGDIR_DCMTK_DEV)

	# Do not forget to install the shared libs as well
	# TODO: make use of d-shlibs (andreas tille)
	find $(CURDIR) -path $(CURDIR)/debian -prune -o \
		-name 'lib*.so' -exec install -s -m 644 \{\} $(PKGDIR_DCMTK_LIB)/usr/lib \;

	# Fix filenames / add symlinks for shared libs
	for i in $(PKGDIR_DCMTK_LIB)/usr/lib/*.so; do \
		mv $$i $$i.1.0.0 && \
		ln -sf `basename \$$i.1.0.0` \
			$(PKGDIR_DCMTK_DEV)/usr/lib/`basename $$i` && \
		ln -sf `basename \$$i.1.0.0` $$i.1; \
	done
	# cp -a debian/apache.conf $(PKGDIR_DCMTK_WWW)/etc/apache2/conf.d/$(pkg)

# Build architecture-independent files here.
binary-indep: build-indep install-indep
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i CHANGES.354
	dh_installdocs -i
	dh_installexamples -i
	dh_installman -i
	dh_install -i
	dh_link -i
	dh_lintian -i
	dh_strip -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-arch install-arch
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a CHANGES.354
	dh_installdocs -a
	dh_installexamples -a
	dh_installinit -a --name=dcmqrscp
	dh_installman -a
	dh_install -a
	chmod 755 $(PKGDIR_DCMTK_WWW)/usr/lib/dcmtk/cgi-bin/*.p[lh]
	dh_link -a
	dh_lintian -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_perl -a
	dh_makeshlibs -a -V
	dh_installdeb -a
	dh_shlibdeps -a -l debian/libdcmtk1/usr/lib
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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