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
|
#! /usr/bin/make -f
# Debian rules for building gs.
# Originally written by Marco Pistore based on the sample debian/rules file
# for GNU Hello written by Ian Jackson.
#
# Rewritten from scratch by Torsten Landschoff <torsten@debian.org>
# ==== Setup ======================================================
# You might want to tweak some of the parameters below.
# Select which contributed drivers to include. Defaults to include
# all drivers which work and are allowed to be included in a binary
# package. You may change that for your local packages.
INCLUDE_GPL = yes
INCLUDE_LGPL = yes
hp8xx-support = $(INCLUDE_GPL)
kanji-support = $(INCLUDE_GPL)
jpdrivers-support = $(INCLUDE_GPL)
lexmark-support = $(INCLUDE_GPL)
hpdj-support = $(INCLUDE_LGPL)
# Uncomment following line for conflicted jpdrivers support.
# Be sure to disable hp8xx-support and enable jpdrivers support.
# Also make sure that you can not use original lips3 device.
# jpconflict-support = INCLUDE_GPL
# If your architecture has svgalib support, add it to this list
svgalib-archs = i386
# ==== Static stuff ===============================================
# ---- Macro section ----------------------------------------------
PACKAGE := gs
VERSION := 5.10
BINDIR := $(shell pwd)/debian/tmp/usr/bin
DOCDIR := $(shell pwd)/debian/tmp/usr/share/doc
MANDIR := $(shell pwd)/debian/tmp/usr/share/man
LIBDIR := $(shell pwd)/debian/tmp/usr/lib/ghostscript/$(VERSION)
GSDOCDIR := $(DOCDIR)/$(PACKAGE)
ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
# ---- Conditionals -----------------------------------------------
# Determine if the svgalib stuff should be build
ifneq (,$(findstring $(ARCH), $(svgalib-archs)))
svgalib-opt := -DSVGALIB_SUPPORT
svgalib-support = yes
endif
# ----- Debian patches --------------------------------------------
# Specify which patches to apply
APPLY_PATCHES :=
UNAPPLY_PATCHES :=
INSTALL_PATCHES :=
include debian/patches/svgalib
include debian/patches/hp8xx
include debian/patches/kanji
include debian/patches/jpdrivers
include debian/patches/lexmark
include debian/patches/hpdj
patch-contrib: $(APPLY_PATCHES)
unpatch-contrib: $(UNAPPLY_PATCHES)
install-contrib: $(INSTALL_PATCHES)
# ----- Building ---------------------------------------------------
build: build-stamp
build-stamp: checkdir checkjpeg patch-contrib
rm -f $@
chmod +x debian/addentry
sh < tar_cat
ln -sf unix-gcc.mak makefile
$(MAKE) DEBOPT="-DDEBIAN $(svgalib-opt)"
touch $@
# ----- Cleaning up -------------------------------------------------
clean: checkroot checkdir clean-build unpatch-contrib
clean-build:
chmod +x debian/addentry
-$(MAKE) distclean
rm -rf debian/tmp
rm -f dvx-gcc.mak unixansi.mak unix-cc.mak unix-gcc.mak makefile
rm -f *~ debian/*~ *.rej *.orig core
rm -f debian/files* debian/substvars
# ----- Package installation ----------------------------------------
binary-indep: # nothing architecture independent here
install-dirs:
rm -rf debian/tmp
install -d debian/tmp debian/tmp/DEBIAN $(GSDOCDIR) $(MANDIR)/man1
binary-arch: checkroot checkdir build install-dirs install-contrib
# Upstream installation
$(MAKE) prefix=debian/tmp/usr \
mandir=$(MANDIR) \
docdir=$(GSDOCDIR) install
# Move some stuff where if actually belongs
mv debian/tmp/usr/bin/font2c $(LIBDIR)
# Remove unwanted files
rm -f $(GSDOCDIR)/COPYING
rm -f $(LIBDIR)/Fontmap
# Install documentation
# this will be gzipped
install -m 0644 debian/setuid $(GSDOCDIR)/setuid.Debian
install -m 0644 debian/changelog $(GSDOCDIR)/changelog.Debian
install -m 0644 debian/README $(GSDOCDIR)/README.Debian
gzip -9rv $(GSDOCDIR)/*
# this will not
install -m 0644 debian/copyright $(GSDOCDIR)/copyright
# Strip the binary
strip $(BINDIR)/gs
# Compress the manpages
find $(MANDIR) -name '*.1'|xargs gzip -9
# Installation scripts
install -m 0755 debian/postinst debian/tmp/DEBIAN/
install -m 0755 debian/postrm debian/tmp/DEBIAN/
install -m 0755 debian/prerm debian/tmp/DEBIAN/
# Package information
dpkg-shlibdeps $(BINDIR)/*
dpkg-gencontrol -isp
chown -R root.root debian/tmp
chmod -R g-ws debian/tmp
dpkg --build debian/tmp ..
# ----- Standard targets --------------------------------------------
.PHONY: build binary binary-arch binary-indep clean checkroot checkjpeg \
checkdir
binary: binary-indep binary-arch
checkroot: checkdir
test root = "`whoami`"
checkdir:
test -f gs.c -a -f debian/rules
checkjpeg:
test -f ../libjpeg/jutils.c || \
(echo >&2 ">>> I am expecting the libjpeg sources in ../libjpeg."; \
echo >&2 ">>> Please read debian/jpeg!" ; false)
|