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
|
#!/usr/bin/make -f
SHELL=/bin/bash
DESTDIR=$(shell pwd)/debian/tmp
debversion=$(shell head -n1 debian/changelog | \
cut -d" " -f2 | \
sed -e "s/(//g" \
-e "s/)//g" )
version=$(shell echo $(debversion) | cut -d"-" -f1)
soname=3
soversion=3.3
changelog=README.33
package=regina$(soname)
rexxpackage=regina-rexx
export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
export DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
confflags=--prefix=/usr
# Enable Regina GCI only on supported platforms.
ifneq ($(filter alpha amd64 i386,$(DEB_HOST_ARCH)), )
confflags+=--enable-gci
endif
ifeq ($(DEB_BUILD_ARCH), ia64)
CCOPTS=-g
else
CCOPTS=-O2 -g
endif
build: stamp-configure stamp-build
stamp-build:
$(checkdir)
$(MAKE)
touch stamp-build
configure: stamp-configure
stamp-configure:
$(checkdir)
./configure $(confflags)
touch stamp-configure
clean:
$(checkdir)
-rm -f stamp-build stamp-configure
-$(MAKE) distclean
-chmod 644 debian/md5_sums
-rm -f `find . \( -name '*~' -o -name '*.bak' \) -print`
-rm -rf core debian/tmp* debian/files* debian/*substvars debian/shlibs.local
binary-indep: checkroot build
$(checkdir)
binary-arch: checkroot build
$(checkdir)
rm -rf debian/tmp{-lib,-dev,-rexx}
install -d -m 755 debian/tmp{-lib,-dev,-rexx}/DEBIAN
install -d -m 755 debian/tmp-lib/usr/share/doc/$(package)
install -d -m 755 debian/tmp-rexx/usr/share/doc/$(rexxpackage)
install -d -m 755 debian/tmp-dev/usr/share/doc/$(package)-dev
#
install -m 755 debian/postinst debian/tmp-lib/DEBIAN/postinst
install -m 755 debian/postrm debian/tmp-lib/DEBIAN/postrm
echo "libregina $(soname) $(package) (>= $(debversion))" > debian/shlibs.local
install -m 644 debian/shlibs.local debian/tmp-lib/DEBIAN/shlibs
#
$(MAKE) install-lib prefix=debian/tmp-lib/usr
$(MAKE) install-dev prefix=debian/tmp-dev/usr
$(MAKE) install-rexx prefix=debian/tmp-rexx/usr rexx_examples=share/doc/$(rexxpackage)/examples
#
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
strip --strip-unneeded --remove-section=.comment --remove-section=.note debian/tmp-lib/usr/lib/libregina.so.$(version)
strip --strip-debug debian/tmp-dev/usr/lib/libregina.a
strip --strip-all --remove-section=.comment --remove-section=.note debian/tmp-rexx/usr/bin/*
endif
#
cp README.[0-9]* debian/tmp-lib/usr/share/doc/$(package)
cp $(changelog) debian/tmp-lib/usr/share/doc/$(package)/changelog
cp debian/changelog debian/tmp-lib/usr/share/doc/$(package)/changelog.Debian
gzip -9f debian/tmp-lib/usr/share/doc/$(package)/*
cp debian/copyright debian/tmp-lib/usr/share/doc/$(package)
#
gzip -9f debian/tmp-rexx/usr/share/man/man1/*.1
ln -sf regina.1.gz debian/tmp-rexx/usr/share/man/man1/rexx.1.gz
cp $(changelog) debian/tmp-rexx/usr/share/doc/$(rexxpackage)/changelog
cp debian/changelog debian/tmp-rexx/usr/share/doc/$(rexxpackage)/changelog.Debian
gzip -9f debian/tmp-rexx/usr/share/doc/$(rexxpackage)/changelog*
cp debian/copyright debian/tmp-rexx/usr/share/doc/$(rexxpackage)
#
cp $(changelog) debian/tmp-dev/usr/share/doc/$(package)-dev/changelog
cp debian/changelog debian/tmp-dev/usr/share/doc/$(package)-dev/changelog.Debian
gzip -9f debian/tmp-dev/usr/share/doc/$(package)-dev/changelog*
cp debian/copyright debian/tmp-dev/usr/share/doc/$(package)-dev
#
LD_LIBRARY_PATH=/usr/lib/libfakeroot:$(DESTDIR)-lib/usr/lib dpkg-shlibdeps debian/tmp-lib/usr/lib/libregina.so.$(soversion)
dpkg-gencontrol -isp -p$(package) -Pdebian/tmp-lib
echo "regver:Depends=$(package) (= $(debversion))" > debian/substvars
dpkg-gencontrol -isp -p$(package)-dev -Pdebian/tmp-dev
#
LD_LIBRARY_PATH=/usr/lib/libfakeroot:$(DESTDIR)-lib/usr/lib dpkg-shlibdeps debian/tmp-rexx/usr/bin/*
dpkg-gencontrol -isp -p$(rexxpackage) -Pdebian/tmp-rexx
#
chown -R root.root debian/tmp-{lib,dev,rexx}
chmod -R go=rX,u+w debian/tmp-{lib,dev,rexx}
chmod 755 debian/md5_sums
debian/md5_sums tmp-{lib,dev,rexx}
dpkg --build debian/tmp-lib ..
dpkg --build debian/tmp-dev ..
dpkg --build debian/tmp-rexx ..
define checkdir
test -f debian/rules
endef
binary: binary-indep binary-arch
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|