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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
#!/usr/bin/make -f
# -*- makefile -*-
# 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
export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
gm_confflags += --build $(DEB_HOST_GNU_TYPE)
else
gm_confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
CFLAGS = -Wall -g -fno-strict-aliasing
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
PACKAGENAME=graphicsmagick
configure: configure-stamp
configure-stamp:
dh_testdir
if test -f config.sub; then \
mv config.sub config.sub.debsave; \
fi
if test -f config.guess; then \
mv config.guess config.guess.debsave; \
fi
ln -sf /usr/share/misc/config.sub .
ln -sf /usr/share/misc/config.guess .
CFLAGS="$(CFLAGS)" ./configure $(gm_confflags) \
--enable-shared \
--enable-static \
--enable-libtool-verbose \
--prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--with-gs-font-dir=/usr/share/fonts/type1/gsfonts \
--with-x \
--x-includes=/usr/include/X11 \
--x-libraries=/usr/lib/X11 \
--without-dps \
--without-modules \
--without-frozenpaths \
--with-perl \
--with-perl-options="INSTALLDIRS=vendor"
touch configure-stamp
build: build-arch build-indep
build-arch: build-arch-stamp
build-arch-stamp: configure-stamp
dh_testdir
# Teach Perl binding to build without an installed library.
test -e PerlMagick/Makefile.PL.debsave || sed -i.debsave -e \
"/LIBS/s|\(-L[[:space:]]*\)[^[:space:]]\+|\1$(CURDIR)/magick/.libs|" \
PerlMagick/Makefile.PL
ifeq ($(DEB_HOST_ARCH),arm)
# Calling variadic functions can lead to stack corruption on arm
# with -O2 due to what I believe to be a compiler bug. Verfied for
# DrawRoundRectangle() in magick/draw.c and wand/drawing_wand.c.
# The following workaround prevents crashes of the drawtest runs
# during make check until the compiler issue is fully understood.
$(MAKE) CFLAGS="-Wall -g -O0" -C magick draw.lo
$(MAKE) CFLAGS="-Wall -g -O0" -C wand drawing_wand.lo
endif
$(MAKE)
# It seems that PerlMagick was forgotten in all in the main
# Makefile. Call it directly, and make sure to override the stupid
# rpath picked up from the LIBS hack above.
cd PerlMagick && perl Makefile.PL && $(MAKE) LD_RUN_PATH=
touch build-arch-stamp
build-indep: build-indep-stamp
build-indep-stamp: configure-stamp
dh_testdir
pod2man debian/Magick.pm > 'debian/Image::Magick.3pm'
touch build-indep-stamp
check: check-stamp
check-stamp: build-arch-stamp
dh_testdir
# Cannot patch a binary file, so do take a detour via uudecode...
if test -e "$(CURDIR)"/PerlMagick/t/reference/wmf/ski.miff; then \
mv "$(CURDIR)"/PerlMagick/t/reference/wmf/ski.miff \
"$(CURDIR)"/debian/ski.orig.miff; \
fi
uudecode -o "$(CURDIR)"/PerlMagick/t/reference/wmf/ski.miff \
"$(CURDIR)"/debian/ski.miff.uu
# FIXME Something's confusing libtool, so its wrappers don't do the
# library path magic they are supposed to do. I haven't found
# out what's wrong yet, so let's work around the problem here
# with a manual override to LD_LIBRARY_PATH.
# XXX make check insists on rebuilding the Perl plugin, so we have
# to override LD_RUN_PATH once more. (NB: We cannot just build
# the plugin once here because make check is not called when
# cross-compiling.)
# XXX Unset DISPLAY to make sure the PerlMagick X regression test
# does not pick up a stray and possibly unauthenticated entry.
@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= ; \
else \
echo "Skipping regression tests because we appear to be cross-compiling"; \
fi
touch check-stamp
clean:
dh_testdir
dh_testroot
rm -f configure-stamp build-arch-stamp build-indep-stamp check-stamp
-$(MAKE) distclean
-rm -f 'debian/Image::Magick.3pm'
if test -L config.sub; then \
$(RM) config.sub; \
if test -e config.sub.debsave; then \
mv config.sub.debsave config.sub; \
fi; \
fi
if test -L config.guess; then \
$(RM) config.guess; \
if test -e config.guess.debsave; then \
mv config.guess.debsave config.guess; \
fi; \
fi
if test -e PerlMagick/Makefile.PL.debsave; then \
mv PerlMagick/Makefile.PL.debsave PerlMagick/Makefile.PL; \
fi
# Clean up after 'patching' a miff binary.
if test -e "$(CURDIR)"/debian/ski.orig.miff; then \
mv "$(CURDIR)"/debian/ski.orig.miff \
"$(CURDIR)"/PerlMagick/t/reference/wmf/; \
fi
dh_clean
install: build install-indep install-arch
install-indep:
dh_testdir
dh_testroot
dh_clean -k -i
dh_install -i
install-arch:
dh_testdir
dh_testroot
dh_clean -k -s
# pkgdocdir is hardwired in configure.ac and can only be overridden
# here.
$(MAKE) install \
DESTDIR=$(CURDIR)/debian/tmp \
pkgdocdir=/usr/share/doc/$(PACKAGENAME)
# Push dependency libs to new .private entry.
grep -q '^Libs.private:' \
debian/tmp/usr/lib/pkgconfig/GraphicsMagick.pc || \
sed -e '/^Libs:/s|-L/usr/lib\(/X11\)\? ||g' \
-e '/^Libs:/s|\(-lGraphicsMagick\) \(.*\)|\1\nLibs.private: -L/usr/lib/X11 \2|' \
-i debian/tmp/usr/lib/pkgconfig/GraphicsMagick.pc
binary-indep: build-indep install-indep
dh_testdir
dh_testroot
dh_installchangelogs -i
dh_installdocs -i
dh_installman -i
dh_link -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build-arch check install-arch
dh_testdir
dh_testroot
dh_installdirs -a
mv debian/tmp/usr/share/doc/graphicsmagick/www/api* \
debian/libgraphicsmagick1-dev/usr/share/doc/libgraphicsmagick1-dev/www
mv debian/tmp/usr/share/doc/graphicsmagick/www/Magick++/ \
debian/libgraphicsmagick++1-dev/usr/share/doc/libgraphicsmagick++1-dev/www
sed -e 's|\(HREF="\)\(Magick++/\)|\1../../libgraphicsmagick++1-dev/www/\2|' \
-e 's|\(HREF="\)\(api.html\)|\1../../libgraphicsmagick1-dev/www/\2|' \
-i debian/tmp/usr/share/doc/graphicsmagick/www/programming.html
dh_install -a --list-missing --sourcedir=debian/tmp
dh_installchangelogs -a ChangeLog
dh_installdocs -a
dh_installman -a
dh_installexamples -a
dh_installmenu -p graphicsmagick
dh_installmime -p graphicsmagick
dh_link -a
dh_strip -a --dbg-package=graphicsmagick-dbg
dh_compress -a
dh_fixperms -a
dh_makeshlibs -a
dh_installdeb -a
dh_perl -p libgraphics-magick-perl
dh_shlibdeps -a -L libgraphicsmagick1 \
-l debian/libgraphicsmagick1/usr/lib
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch
|