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
|
#!/usr/bin/make -f
# ssystem debian build rules
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
package=dstool
INSTALL=/usr/bin/install
# keep other-arch guys happy
CC := $(shell if [ -x /usr/bin/egcc ]; then echo egcc; else echo cc; fi)
build:
$(checkdir)
mkdir install/src/bin
cd install/src; export DSTOOL=`pwd`; export OPENWINHOME=/usr/lib; \
cd src; \
make CC=$(CC) dstool; \
make CC=$(CC) dslibs; \
make CC=$(CC) dstool_nowin
clean:
$(checkdir)
-rm -f build
-rm -rf install/src/bin
-cd install/src; export DSTOOL=`pwd`; make clean
-rm -f install/src/bin/* install/src/libraries/*
-rm -f install/src/src/main/stubs.o install/src/src/main/mainlib_nowin.a
-rm -f `find . -name "*~"`
-rm -rf debian/tmp debian/files* core debian/substvars
binary-indep: checkroot
$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: checkroot
$(checkdir)
-rm -rf debian/tmp
# Install directories
$(INSTALL) -d debian/tmp/usr/bin
$(INSTALL) -d debian/tmp/usr/man/man1
$(INSTALL) -d debian/tmp/usr/doc/$(package)
$(INSTALL) -d debian/tmp/usr/lib/$(package)
$(INSTALL) -d debian/tmp/usr/lib/$(package)/libraries
$(INSTALL) -d debian/tmp/usr/lib/$(package)/bin
$(INSTALL) -d debian/tmp/DEBIAN
# Strip
# don't strip-unneeded libs or we get a segfault from strip
strip --strip-debug install/src/libraries/*
strip --strip-unneeded install/src/bin/*
# Install
cp debian/dstool.sh debian/tmp/usr/bin/dstool
cp debian/dstool_nowin.sh debian/tmp/usr/bin/dstool_nowin
chmod 755 debian/tmp/usr/bin/*
$(INSTALL) -m 755 install/src/bin/* debian/tmp/usr/lib/$(package)/bin/.
$(INSTALL) -m 644 install/src/libraries/* debian/tmp/usr/lib/$(package)/libraries
cp debian/dstool.1.debian debian/tmp/usr/man/man1/dstool.1
-gzip -9fv debian/tmp/usr/man/man1/*
cd debian/tmp/usr/man/man1; ln -s dstool.1.gz dstool_nowin.1.gz
cp -r install/src/colormaps debian/tmp/usr/lib/$(package)/.
chmod 644 debian/tmp/usr/lib/$(package)/colormaps/*
# Install supplied docs
$(INSTALL) -m 644 install/src/doc/* debian/tmp/usr/doc/$(package)
$(INSTALL) -d debian/tmp/usr/doc/$(package)/examples
$(INSTALL) -m 644 install/src/scripts/close_selected_window \
install/src/scripts/sample_nowin_session \
install/src/scripts/simple_tcl \
debian/tmp/usr/doc/$(package)/examples
# Install docs in proper directory and gzip them
#
$(INSTALL) -m 644 debian/README.debian debian/tmp/usr/doc/$(package)
$(INSTALL) -m 644 install/src/README install/src/README.new_release \
debian/tmp/usr/doc/$(package)/.
cp debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
-gzip -9fv debian/tmp/usr/doc/$(package)/*
# don't gzip these
#
cp debian/copyright debian/tmp/usr/doc/$(package)/copyright
dpkg-shlibdeps debian/tmp/usr/lib/$(package)/bin/*
dpkg-gencontrol
chown -R root.root debian/tmp
chmod -R go=rX debian/tmp
dpkg --build debian/tmp ..
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
|