File: rules

package info (click to toggle)
imagemagick 7%3A6.2.4.5.dfsg1-0.15%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 29,972 kB
  • ctags: 13,707
  • sloc: ansic: 202,656; cpp: 17,315; sh: 10,363; xml: 5,523; perl: 4,486; makefile: 3,148; tcl: 459
file content (182 lines) | stat: -rwxr-xr-x 5,826 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
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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

# This is the debhelper compatability version o t2use.
export DH_COMPAT=3

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

IMAGEMAGICKVERSION=6.2.4

ifndef PERL
PERL = /usr/bin/perl
endif



build: build-stamp
build-stamp:
	dh_testdir

	MagickDocumentPath="/usr/share/doc/imagemagick" ./configure \
	--prefix=/usr \
	--mandir=\$${prefix}/share/man \
	--infodir=\$${prefix}/share/info \
	--with-gs-font-dir=/usr/share/fonts/type1/gsfonts \
	--with-magick-plus-plus \
	--enable-shared \
	--enable-lzw \
	--without-dps \
	--without-fpx \
	--without-perl \
	--with-perl-options='INSTALLDIRS=vendor' \
	--x-includes=/usr/include/X11 \
	--x-libraries=/usr/lib/X11

	# Patch the generated libtool to avoid passing -rpath when linking,
	# and to explicitly link libraries against the libraries they
	# depend on.

	sed < libtool > libtool-2 \
	-e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \
	-e '/^archive_cmds="/s/"$$/ \\$$deplibs"/' 
	mv libtool-2 libtool
	chmod 755 libtool

	# Add here commands to compile the package.

	$(MAKE) 
	cd $(CURDIR)/PerlMagick && perl Makefile.PL
	cd $(CURDIR)/PerlMagick && make \
		LD_RUN_PATH= \
		EXTRALIBS='-L../magick/.libs -L/usr/lib -lMagick -L/usr/X11R6/lib -L/usr/lib -L/usr/lib -llcms -ltiff -lfreetype -ljpeg -lpng -lXext -lSM -lICE -lX11 -lbz2 -lxml2 -lz' \
		LDLOADLIBS='-L../magick/.libs -L/usr/lib -lMagick -L/usr/X11R6/lib -L/usr/lib -L/usr/lib -llcms -ltiff -lfreetype -ljpeg -lpng -lXext -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lpthread -lm -lpthread'

	# Remove duplicate lib entries that ended up in --ldflags by mistake.	
	sed -ie '/--ldflags/,+1s/[[:space:]]-l[^[:space:]]\+//g' \
		"$(CURDIR)/magick/Magick-config"

	touch build-stamp

check: check-stamp
check-stamp: build-stamp
	dh_testdir

	# Only run the testsuite to get more info in the build logs for now,
	# but don't make a failing testsuite fail the whole build. Change it
	# to a fatal error only once we've got an estimate on how harmful
	# that would be.
	@if test "$(DEB_HOST_GNU_TYPE)" = "$(DEB_BUILD_GNU_TYPE)"; then \
		unset DISPLAY; \
		LD_LIBRARY_PATH="$(CURDIR)/magick/.libs:$(CURDIR)/wand/.libs:$(CURDIR)/Magick++/lib/.libs:$$LD_LIBRARY_PATH" \
		$(MAKE) check LD_RUN_PATH= && echo "*** Testsuite succeeded ***" || echo "*** Testsuite failed ***"; \
	else \
		echo "Skipping regression tests because we appear to be cross-compiling"; \
	fi

	touch check-stamp
clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	# Add here commands to clean up after the build process.
	-cd PerlMagick && $(MAKE) distclean
	-$(MAKE) distclean
	-cd Magick++ && $(MAKE) distclean
	-rm $(CURDIR)/utilities/.libs/*

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/imagemagick.
	$(MAKE) install \
		DESTDIR=$(CURDIR)/debian/imagemagick  \
		pkgdocdir=/usr/share/doc/imagemagick 
#		pkgdatadir=/usr/share/doc/imagemagick 

	cd $(CURDIR)/PerlMagick && \
	$(MAKE) install_vendor  \
		PREFIX=$(CURDIR)/debian/imagemagick/usr \
		SITEPREFIX=$(CURDIR)/debian/imagemagick/usr \
		INSTALLMAN3DIR=$(CURDIR)/debian/imagemagick/usr/share/man/man3 \
		INSTALLSITEMAN3DIR=$(CURDIR)/debian/imagemagick/usr/share/man/man3 
	cp `pwd`/magick/*.h $(CURDIR)/debian/imagemagick/usr/include/magick
	-cp `pwd`/magick/Magick-config.1 $(CURDIR)/debian/imagemagick/usr/share/man/man1/
	-find $(CURDIR)/debian -type f -name .packlist | xargs rm -f

	# Duplicate. License file is already included in the doc dir.
	-rm "$(CURDIR)"/debian/imagemagick/usr/share/ImageMagick-$(IMAGEMAGICKVERSION)/LICENSE

# Use x-terninal emulator for editing (Bug #132947)	
#
	rm $(CURDIR)/debian/imagemagick/usr/lib/ImageMagick-$(IMAGEMAGICKVERSION)/config/delegates.xml
	sed -e s!xterm!/etc/alternatives/x-terminal-emulator!  \
		$(CURDIR)/config/delegates.xml > \
		$(CURDIR)/debian/imagemagick/usr/lib/ImageMagick-$(IMAGEMAGICKVERSION)/config/delegates.xml
	dh_movefiles --sourcedir=debian/imagemagick
	-rm $(CURDIR)/debian/imagemagick/usr/lib/libltdl*
# add write permission for dh_strip
	chmod +w $(CURDIR)/debian/perlmagick/usr/lib/perl5/auto/Image/Magick/Magick.so
#	
# Remove empty directories in debian/imagemagick and debian/libmagick9
# 	
	-find $(CURDIR)/debian/imagemagick -type d -empty | xargs rmdir -p
	-find $(CURDIR)/debian/libmagick9 -type d -empty | xargs rmdir -p
#
# 	-while find $(CURDIR)/debian/imagemagick -empty |xargs rmdir ; do \
# 	 find $(CURDIR)/debian/imagemagick -empty | xargs rmdir; \
# 	done
# 	-while find $(CURDIR)/debian/libmagick9 -empty | xargs rmdir ; do \
# 	 find $(CURDIR)/debian/libmagick9 -empty | xargs rmdir; \
# 	done

clean-tarball: 
	# Nuke logo binaries
	rm -f images/configure.jpg images/logo.jpg images/logo.eps images/examples.jpg \
		www/Magick++/ImageMagick.png
	# Nuke the LogoImage define
	perl -pi -e 'BEGIN{undef $$/;} s/LogoImage\[\]\s+=\s+\{[^\}]+\}/LogoImage[] = {}/s' \
		coders/magick.c


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


# Build architecture-dependent files here.
binary-arch: build check install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installmime -pimagemagick
	dh_installinfo
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_perl
	dh_shlibdeps -L libmagick9 -ldebian/libmagick9/usr/lib
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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