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 165
|
#!/usr/bin/make -f
# -*- mode: makefile; -*-
#
# Debian rules for building xaw95 (by Yves Arrouye), based on:
#
# Sample debian.rules file - for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself. (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
DEBDIR=debian/tmp/DEBIAN
DOCDIR=debian/tmp/usr/doc/xaw95g
LIBDIR=debian/tmp/usr/X11R6/lib
XAWDIR=debian/tmp/usr/lib/xaw-wrappers/conf
DEBDIR5=debian/xaw95/DEBIAN
DOCDIR5=debian/xaw95/usr/doc/xaw95
LIBDIR5=debian/xaw95/usr/lib/libc5-compat
XAWDIR5=debian/xaw95/usr/lib/xaw-wrappers/conf
COMPAT=debian/buildcompat
ARCH = $(shell dpkg --print-gnu-build-architecture)
#If your architecture needs libc1 compat support build, add it to this list
COMPAT_ARCHS=i486 m68k sparc
ifneq (,$(findstring $(ARCH), $(COMPAT_ARCHS)))
DOBUILDCOMPAT := build-libc5libs
DOBINARYCOMPAT := binary-libc5libs
endif
build-libc5libs:
$(checkdir)
xmkmf
# make libc5 compat lib.
rm -rf $(COMPAT)/X11
install -d $(COMPAT)/X11
ln -sf ../ $(COMPAT)/X11/Xaw3d && \
cp -a *.c *.h *.y *.l Makefile $(COMPAT) && \
cd $(COMPAT) && \
$(MAKE) EXTRA_DEFINES=-D_REENTRANT CXXEXTRA_DEFINES=-D_REENTRANT \
CC=`dpkg --print-gnu-build-architecture`-linuxlibc1-gcc \
LDPRELIB=
build: $(DOBUILDCOMPAT)
$(checkdir)
xmkmf
rm -rf X11
mkdir X11
ln -s ../ X11/Xaw3d
$(MAKE) EXTRA_DEFINES=-D_REENTRANT CXXEXTRA_DEFINES=-D_REENTRANT
#
touch build
clean:
$(checkdir)
-rm -f build
rm -rf X11 $(COMPAT)
-$(MAKE) clean
-rm -rf debian/tmp debian/xaw95
-rm Makefile debian/files debian/*.substvars debian/substvars
rm -f source *~ debian/*~
binary-indep: build
$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-xaw95g: build
$(checkdir)
# NOTE: The libc5 version of this library can not be built correctly
# if you are using a 0.0 version of fakeroot. (And the 0.1 version
# does not exist yet at the time of this writing).
# See the thread "Dpkg-shlibdeps and libc5/6" in the debian-devel
# archives for more information.
-rm -rf debian/tmp
install -d ${DEBDIR}
install -m 755 debian/postinst ${DEBDIR}
install -m 755 debian/postrm ${DEBDIR}
install -m 644 debian/shlibs ${DEBDIR}
# xaw-wrappers entry
install -d ${XAWDIR}
install -m 644 debian/xaw-wrappers ${XAWDIR}/xaw95g
# documentation
install -d ${DOCDIR}
install -m 644 debian/copyright ${DOCDIR}
install -m 644 README.XAW3D ${DOCDIR}
install -m 644 debian/changelog ${DOCDIR}/changelog.Debian
gzip -9v ${DOCDIR}/changelog.Debian
# library
install -d ${LIBDIR}
install -s -m 644 libXaw95.so.*.* ${LIBDIR}
install -m 644 libXaw95.a ${LIBDIR}
ln -s libXaw95.so.6.1 ${LIBDIR}/libXaw95.so.6
ln -s libXaw95.so.6.1 ${LIBDIR}/libXaw95.so
install -d ${LIBDIR}/Xaw95
ln -s ../libXaw95.so.6.1 ${LIBDIR}/Xaw95/libXaw.so.6
#
dpkg-shlibdeps ${LIBDIR}/libXaw95.so.6.1
dpkg-gencontrol -pxaw95g
dpkg --build debian/tmp ..
# Make libc5 compat package.
binary-libc5libs: build
$(checkdir)
-rm -rf debian/xaw95
install -d ${DEBDIR5}
install -m 755 debian/xaw95.postinst ${DEBDIR5}/postinst
install -m 755 debian/xaw95.postrm ${DEBDIR5}/postrm
install -m 644 debian/xaw95.shlibs ${DEBDIR5}/shlibs
# xaw-wrappers entry
install -d ${XAWDIR5}
install -m 644 debian/xaw95.xaw-wrappers ${XAWDIR5}/xaw95
# documentation
install -d ${DOCDIR5}
install -m 644 debian/copyright ${DOCDIR5}
install -m 644 README.XAW3D ${DOCDIR5}
install -m 644 debian/changelog ${DOCDIR5}/changelog.Debian
gzip -9v ${DOCDIR5}/changelog.Debian
# library
install -d ${LIBDIR5}
install -s -m 644 ${COMPAT}/libXaw95.so.6.1 ${LIBDIR5}
install -m 644 ${COMPAT}/libXaw95.a ${LIBDIR5}
ln -s libXaw95.so.6.1 ${LIBDIR5}/libXaw95.so.6
ln -s libXaw95.so.6.1 ${LIBDIR5}/libXaw95.so
install -d ${LIBDIR5}/Xaw95
ln -s ../libXaw95.so.6.1 ${LIBDIR5}/Xaw95/libXaw.so.6
# use absolute path here to work around bug in ldd that caused it
# to list the library as being linked to itself.
dpkg-shlibdeps `pwd`/${LIBDIR5}/libXaw95.so.6.1 -Tdebian/xaw95.substvars
dpkg-gencontrol -pxaw95 -Tdebian/xaw95.substvars -Pdebian/xaw95
dpkg --build debian/xaw95 ..
binary-arch: build binary-xaw95g $(DOBINARYCOMPAT)
define checkdir
test -f README.Xaw95.Install -a -f debian/rules
endef
# Below here is fairly generic really
binary:
@if [ "`whoami`" = root ]; then \
$(MAKE) -f debian/rules binary-root; \
else \
if [ -x /usr/bin/ssh ]; \
then \
echo "Building the .deb file as root..."; \
ssh -l root localhost "cd `pwd`; exec $(MAKE) -f debian/rules binary-root"; \
else \
echo "Enter the root password to build the .deb file..."; \
su -c "exec $(MAKE) -f debian/rules binary-root"; \
fi; \
fi
binary-root: binary-indep binary-arch
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
.PHONY: binary binary-arch binary-indep clean
|