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
|
#!/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
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.6.0
DESTDIR="$(CURDIR)/debian/tmp"
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
build: build-stamp
build-stamp: $(QUILT_STAMPFN)
dh_testdir
MagickDocumentPath="/usr/share/doc/imagemagick" ./configure \
--prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--with-modules \
--with-gs-font-dir=/usr/share/fonts/type1/gsfonts \
--with-magick-plus-plus \
--with-djvu \
--enable-shared \
--without-dps \
--without-fpx \
--with-perl-options='INSTALLDIRS=vendor' \
--x-includes=/usr/include/X11 \
--x-libraries=/usr/lib/X11
cd "$(CURDIR)/PerlMagick" && \
perl Makefile.PL
# Patch the generated libtool to avoid passing -rpath when linking,
# and to explicitly link libraries against the libraries they
# depend on.
sed -i libtool \
-e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \
-e '/^archive_cmds="/s/"$$/ \\$$deplibs"/'
$(MAKE)
cd "$(CURDIR)/PerlMagick" && \
$(MAKE)
touch build-stamp
check: check-stamp
check-stamp: build-stamp
dh_testdir
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# 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 ***"; \
cat test-suite.log; \
else \
echo "Skipping regression tests because we appear to be cross-compiling"; \
fi
endif
touch check-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Commands to clean up after the build process
[ ! -f PerlMagick/Makefile ] || (cd PerlMagick && $(MAKE) distclean)
[ ! -f Makefile ] || $(MAKE) distclean
[ ! -f Magick++/Makefile ] || (cd Magick++ && $(MAKE) distclean)
rm -f "$(CURDIR)/utilities/.libs/*" "$(CURDIR)/_configs.sed" \
"$(CURDIR)/magick/magick-config.h"
dh_clean build-stamp
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
$(MAKE) install \
DESTDIR="$(CURDIR)/debian/tmp" \
pkgdocdir=/usr/share/doc/imagemagick
mkdir -p $(DESTDIR)/usr/share/pixmaps/
install -m 644 "$(CURDIR)/debian/display.xpm" \
$(DESTDIR)/usr/share/pixmaps/
-find "$(CURDIR)/debian" -type f -name .packlist | xargs rm -f
# Fix HTML location inside manpages
sed -i 's/doc\/ImageMagick-$(IMAGEMAGICKVERSION)/doc\/imagemagick/' \
$(DESTDIR)/usr/share/man/man*/*
sed -i 's/doc\/ImageMagick\\-$(IMAGEMAGICKVERSION)/doc\/imagemagick/' \
$(DESTDIR)/usr/share/man/man*/*
# Use x-terminal emulator for editing (Bug #132947)
sed -i 's/xterm/\/etc\/alternatives\/x-terminal-emulator/' \
$(DESTDIR)/usr/lib/ImageMagick-$(IMAGEMAGICKVERSION)/config/delegates.xml
# Remove empty directories in debian/tmp
-find $(DESTDIR) -type d -empty | xargs rmdir -p
# Remove RPATH from Magick.so
chrpath -d $(DESTDIR)/usr/lib/perl5/auto/Image/Magick/Magick.so
# empties dependency_libs from .la files
# http://lists.debian.org/debian-devel/2009/08/msg00783.html
find $(DESTDIR)/usr/lib -name '*.la' -exec \
sed -i "s,^dependency_libs=.*,dependency_libs=''," {} \;
# 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_install
# Remove extra coders
while read FILE; do \
rm -f debian/libmagickcore3/$$FILE; \
done < debian/libmagickcore3-extra.install
dh_installmenu
dh_installman
dh_installmime
dh_installinfo
dh_installchangelogs
dh_link
dh_strip --dbg-package=imagemagick-dbg
dh_compress
dh_fixperms
dh_perl
dh_makeshlibs -V
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
|