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
|
#!/usr/bin/make -f
# debian/rules file - for Stalin
# Copyright 1994,1995 by Ian Jackson
# Copyright 1998-1999 by Rob Browning
SHELL := /bin/bash
pwd := $(shell pwd)
srcname := $(shell dpkg-parsechangelog | grep Source:)
srcname := $(shell echo ${srcname} | perl -pe 's/^Source:\s+//o')
version := $(shell dpkg-parsechangelog | grep Version:)
version := $(shell echo ${version} | perl -pe 's/^Version:\s+//o')
upstream := $(shell echo ${version} | perl -pe 's/-[^-]*$$//o')
deb_rev := $(shell echo ${version} | perl -pe 's/.*-//o')
# the architecture of the package
arch := $(shell dpkg --print-architecture)
# The Debian target name of the package
target := ${arch}-debian-linux-gnu
check-auto-parse:
@echo " srcname:" ${srcname}
@echo " version:" ${version}
@echo " upstream:" ${upstream}
@echo " deb_rev:" ${deb_rev}
build: debian/stamp-build
debian/stamp-build:
${checkdir}
./build
touch debian/stamp-build
.PHONY: build
clean:
${checkdir}
${MAKE} clean
rm -f debian/stamp-* debian/substvars
find -name '*~' -o -name core | xargs --no-run-if-empty rm -f
rm -rf debian/tmp debian/files*
.PHONY: clean
binary-indep: checkroot build
${checkdir}
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
.PHONY: binary-indep
binary-arch: checkroot build
${checkdir}
rm -rf debian/tmp
install -d debian/tmp
# Binaries
install -d debian/tmp/usr/bin
cp debian/stalin-wrapper debian/tmp/usr/bin/stalin
# libs (some of these should be in share, but stalin doesn't make the
# distinction ATM)
install -d debian/tmp/usr/lib/stalin
cp -r include/* debian/tmp/usr/lib/stalin
strip debian/tmp/usr/lib/stalin/stalin
strip debian/tmp/usr/lib/stalin/libstalin.a
# manpages
install -d debian/tmp/usr/man/man1
cp stalin.1 debian/tmp/usr/man/man1
find debian/tmp/usr/man -type f | xargs gzip -9v
# docs
install -d debian/tmp/usr/doc/${srcname}
install README ANNOUNCEMENT stalin.el debian/tmp/usr/doc/${srcname}
cp debian/changelog debian/tmp/usr/doc/${srcname}/changelog.Debian
cp -a benchmarks debian/tmp/usr/doc/${srcname}
find debian/tmp/usr/doc/${srcname} -type f | xargs gzip -9v
cp debian/copyright debian/tmp/usr/doc/${srcname}
# Mangle permissions to conform.
chown -R root.root debian/tmp
find debian/tmp -type d | xargs chmod 755
find debian/tmp -not -type d -a -not -type l | xargs chmod 644
chmod 755 debian/tmp/usr/bin/*
chmod 755 debian/tmp/usr/lib/stalin/stalin
# control scripts
install -d debian/tmp/DEBIAN
# Final steps...
dpkg-shlibdeps debian/tmp/usr/lib/stalin/stalin
dpkg-gencontrol -pstalin
dpkg --build debian/tmp ..
.PHONY: binary-arch
define checkdir
test -f debian/rules
endef
# Below here is fairly generic really
binary: binary-indep binary-arch
.PHONY: binary
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
checkroot:
${checkdir}
test root = "`whoami`"
.PHONY: checkroot
# Local variables:
# mode: makefile
# tab-width: 2
# End:
|