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
|
#! /usr/bin/make -f
#
# To make the binary distribution package, the ``Debianized'' source package
# and the context diff to the original package, type `./debian.rules dist'.
# Make sure that `debian.rules' is executable before the final distribution
# is made.
#
# Invoke each target with `./debian.rules <target>'. All targets should be
# invoked with the package root as the current directory.
#
# The `binary' target must be run as root, as it needs to install files with
# specific ownerships. The `diff' target assumes that you have the original
# source package available, unpacked, in ../$(p)-$(v).orig, or that you have
# the previous revision of the ``Debianized'' source package and context diff
# in the parent directory.
CC = gcc
# CFLAGS = -O2 -g # doesn't do much good with Imakefile etc...
# The name of the package
p = pixmap
package=$(p)
build:
# Builds the binary package.
rm -rf X11
xmkmf
rm -f clean
make Makefiles
perl -i -pe 's/ ..SMLIB. ..ICELIB.//' Makefile # don't link with -lSM -lICE
make
touch stamp-build
clean:
# Undoes the effect of `make -f debian.rules build'.
[ ! -f Makefile ] || $(MAKE) distclean || $(MAKE) clean
touch clean
rm -f Makefile Makefile.bak SelFile/Makefile dotpixmap .#pixmap
rm -f stamp-build
rm -rf debian/tmp debian/files debian/substvars
binary-arch: checkroot build
# Makes a binary package.
test -f stamp-build || make -f debian.rules build
install -d -g root -m 755 -o root debian/tmp
chmod g-s debian/tmp
install -d -g root -m 755 -o root \
debian/tmp/DEBIAN \
debian/tmp/usr/bin \
debian/tmp/usr/lib/X11 \
debian/tmp/usr/lib/X11/Pixmap \
debian/tmp/usr/share/doc/$(p) \
debian/tmp/usr/share/menu \
debian/tmp/usr/share/man/man1 \
debian/tmp/etc/X11/app-defaults
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
install -g root -m 755 -o root pixmap debian/tmp/usr/bin/pixmap
else
# see changelog entry for 2.6pl4-13 about the strip here
strip pixmap
install -g root -m 755 -o root -s pixmap debian/tmp/usr/bin/pixmap
endif
install -g root -m 644 -o root Pixmap.ad \
debian/tmp/etc/X11/app-defaults/Pixmap
install -g root -m 644 -o root Pixmap-color \
debian/tmp/etc/X11/app-defaults/Pixmap-color
for file in Down Excl FlipHoriz FlipVert Fold Left Right RotateLeft \
RotateRight Stipple Term Up; do \
install -g root -m 644 -o root $$file \
debian/tmp/usr/lib/X11/Pixmap/$$file; \
done
install -g root -m 644 -o root pixmap.man \
debian/tmp/usr/share/man/man1/pixmap.1
-gzip -f -9 debian/tmp/usr/share/man/man1/pixmap.1
install -g root -m 644 -o root debian/menu \
debian/tmp/usr/share/menu/$(p)
install -g root -m 644 -o root debian/changelog \
debian/tmp/usr/share/doc/$(p)/changelog.Debian
install -g root -m 644 -o root CHANGES \
debian/tmp/usr/share/doc/$(p)/changelog
-gzip -f -9 debian/tmp/usr/share/doc/$(p)/*
install -g root -m 644 -o root debian/copyright \
debian/tmp/usr/share/doc/$(p)/copyright
install -g root -m 644 -o root debian/conffiles debian/tmp/DEBIAN/.
install -g root -m 755 -o root debian/post* debian/tmp/DEBIAN/.
install -g root -m 755 -o root debian/prerm debian/tmp/DEBIAN/.
dpkg-shlibdeps pixmap
dpkg-gencontrol -isp
chown -R root.root debian/tmp
chmod -R g-ws debian/tmp
dpkg --build debian/tmp ..
rm -f clean
define checkdir
test -f debian/rules
endef
binary-indep: checkroot build
# nothing to do
# Below here is fairly generic really
binary: binary-indep binary-arch
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|