#! /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 '. 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) export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s) 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 -9n 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 -9n 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 debian/tmp/usr/bin/pixmap dpkg-gencontrol chown -R root.root debian/tmp chmod -R g-ws debian/tmp find debian/tmp -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \ xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH" 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