#!/usr/bin/make -f # -*-makefile-*- # Sample debian/rules file - for RScheme. # Copyright (c) 1998, 1999 Rob Browning # Copied from the hello package rules file, (c) 1994,1995 Ian Jackson. SHELL := /bin/bash PWD := $(shell pwd) TMP_ROOT := "$(shell pwd)/debian/tmp-root" INSTALL_ENV := INSTALL_DIR=${TMP_ROOT} RS_INSTALL_DIR=${TMP_ROOT} FINAL_INSTALL_DIR := /usr/lib/rscheme FINAL_MOD_DIR := ${FINAL_INSTALL_DIR}/resource/modules TMP_MOD_DIR := ${TMP_ROOT}/resource/modules # DEBDEBUG := t debian/stamp-configure: $(checkdir) find -name config.cache -print0 | xargs -0 --no-run-if-empty rm ${MAKE} stage1 (cd src && \ CFLAGS=-I${PWD}/debian/include \ ./configure --enable-pstore-unmapper --enable-full-numeric-tower --prefix=${FINAL_INSTALL_DIR}) touch debian/stamp-configure build debian/stamp-build: debian/stamp-configure $(checkdir) # Is this true, or does rscheme-modules just have to be purged before # building rscheme-modules? if ! dpkg --status rscheme-modules | grep 'not-installed$$' > /dev/null; \ then \ echo "You must purge rscheme-modules before building rscheme."; \ false; \ fi # For some reason, if rscheme is not installed, then the rscheme you build # will have embedded paths from the build tree. if dpkg --status rscheme | grep 'not-installed$$' > /dev/null; \ then \ echo "The previous version of rscheme must be installed to build rscheme."; \ false; \ fi install -d debian/tmp-root (cd src && ${MAKE} LD_LIBRARY_PATH=${TMP_ROOT}/lib/ ${INSTALL_ENV} all) # Build local version of rsc to build the other modules. (cd src && ${MAKE} ${INSTALL_ENV} rsc) (cd src && ${MAKE} ${INSTALL_ENV} packages) # (cd src && ${MAKE} ${INSTALL_ENV} PACKAGE=x11 package) (cd src && ${MAKE} ${INSTALL_ENV} fasl_shell) # Re-build rsc with the right *dist-path* # This one doesn't work right... (cd src && \ ${MAKE} ${INSTALL_ENV} "FINAL_INSTALL_DIR=${FINAL_INSTALL_DIR}" \ RS=${TMP_ROOT}/bin/rs rsc) touch debian/stamp-build clean: debian/stamp-configure $(checkdir) -rm -f debian/stamp-configure debian/stamp-build -rm -rf src ${MAKE} distclean -rm -rf debian/tmp-root -rm -rf debian/tmp debian/files* debian/substvars -find -name "*~" -not -path ./handc/cfg/gc/rtgc/rtgc/gcserver.h~ \ -not -path ./stage0/cfg/gc/rtgc/rtgc/gcserver.h~ \ -print0 | xargs --no-run-if-empty --null rm binary-indep: checkroot debian/stamp-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-arch: checkroot debian/stamp-build $(checkdir) -rm -rf debian/tmp install -d debian/tmp debian/tmp/DEBIAN install -d debian/tmp/usr/doc/rscheme install -d debian/tmp/usr/lib/rscheme cp -r debian/tmp-root/resource debian/tmp/usr/lib/rscheme cp -r debian/tmp-root/lib debian/tmp/usr/lib/rscheme ifdef DEBDEBUG cd debian/tmp/usr/lib/rscheme/lib/ && strip *.[ao] endif cp -r debian/tmp-root/include debian/tmp/usr/include # do we still need this? cd debian/tmp/usr/lib/rscheme && ln -s ../../include . install -d debian/tmp/usr/bin ifdef DEBDEBUG (cd debian/tmp-root/bin && \ install `ls | grep -v rsc` ../../tmp/usr/bin/) else (cd debian/tmp-root/bin && \ install --strip `ls | egrep -v "rsc|gcmain"` ../../tmp/usr/bin/) endif perl -i -p \ -e 's|\S+debian/tmp-root/bin|/usr/bin|go;' \ -e 's|\S+debian/tmp-root/resource|/usr/lib/rscheme/resource|go;' \ debian/tmp-root/bin/rsc cd debian/tmp-root/bin && install rsc ../../tmp/usr/bin cp debian/copyright debian/tmp/usr/doc/rscheme/. cp debian/changelog debian/tmp/usr/doc/rscheme/changelog.Debian cp debian/README.Debian debian/tmp/usr/doc/rscheme/ cp COPYING README debian/tmp/usr/doc/rscheme/ gzip -9v debian/tmp/usr/doc/rscheme/changelog.Debian gzip -9v debian/tmp/usr/doc/rscheme/README.Debian gzip -9v debian/tmp/usr/doc/rscheme/COPYING gzip -9v debian/tmp/usr/doc/rscheme/README # gzip -9v debian/tmp/usr/doc/rscheme/*.ps (dpkg-shlibdeps `find debian/tmp/usr/bin/ -type f | grep -v rsc`) dpkg-gencontrol -prscheme chown -R root.root debian/tmp find debian/tmp -type f | xargs chmod 644 find debian/tmp -type d | xargs chmod 755 cd debian/tmp/usr/bin && chmod 755 * chmod -R g-ws debian/tmp dpkg --build debian/tmp .. define checkdir test -f handc/install/include/rscheme.h -a -f debian/rules endef # 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 build # Local Variables: # tab-width: 2 # End