From 259860a61b949c136719c61a1f6c0d0b89dfc681 Mon Sep 17 00:00:00 2001 From: Trent Buck Date: Thu, 19 Jan 2006 20:14:36 +0000 Subject: [PATCH] Refactored debian package structure. --- debian/dirs | 1 + debian/docs | 3 -- debian/rules | 36 +++++++++++------- debian/scripts/factor-export | 38 +++++++++++++++++++ debian/scripts/factor-import | 38 +++++++++++++++++++ debian/scripts/factor-init | 47 +++++++++++++++++++++++ debian/scripts/factor-run | 72 ++++++++++++++++++++++++++++++++++++ 7 files changed, 218 insertions(+), 17 deletions(-) create mode 100644 debian/scripts/factor-export create mode 100644 debian/scripts/factor-import create mode 100644 debian/scripts/factor-init create mode 100644 debian/scripts/factor-run diff --git a/debian/dirs b/debian/dirs index 5da8268f4a..9a22bace1c 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,2 +1,3 @@ usr/bin +usr/lib/factor usr/share/factor diff --git a/debian/docs b/debian/docs index 531a735f5c..b873b8cdfe 100644 --- a/debian/docs +++ b/debian/docs @@ -6,6 +6,3 @@ doc/handbook.pdf doc/internals.txt doc/theory.pdf doc/handbook -examples -library -version.factor diff --git a/debian/rules b/debian/rules index 80295290e5..41de1acb98 100644 --- a/debian/rules +++ b/debian/rules @@ -4,6 +4,9 @@ # SITE_CFLAGS=-fPIC -ffast-math -funsigned-char -mpowerpc -mpowerpc-gpopt -mpowerpc-gfxopt -maltivec -mabi=altivec -mtune=G4 -mcpu=G4 -pipe # SITE_CFLAGS=-march=pentium4 +VERSION=0.80 +FARCH=$(shell sh debian/architecture.sh) + configure: configure-stamp configure-stamp: @@ -14,18 +17,19 @@ build: build-stamp build-stamp: configure-stamp dh_testdir - $(MAKE) linux-`sh debian/architecture.sh` -####### Build the bootstrap image - echo "USE: image \"`sh debian/architecture.sh`\" make-image 0 exit" | factor-vm debian/make-bootstrap-images.factor -# wget http://factorcode.org/boot.image.`sh debian/architecture.sh` -####### Build the factor image - ./f boot.image.`sh debian/architecture.sh` -libraries:sdl:name=libSDL.so -libraries:freetype:name=libfreetype.so -# cp /usr/share/factor/f /usr/share/factor/factor.image . -####### Build the extended image + $(MAKE) linux-$(FARCH) + mv f runtime + # Build the bootstrap image + echo "USE: image \"$(FARCH)\" make-image" | factor-run --basic debian/make-bootstrap-images.factor # || wget http://factorcode.org/boot.image.$(FARCH) + mv boot.image.$(FARCH) boot.image + # Build the factor image + ./runtime boot.image -libraries:sdl:name=libSDL.so -libraries:freetype:name=libfreetype.so + mv factor.image basic.image + # Build the extended image sqlite3 contrib/sqlite/test.db < contrib/sqlite/test.txt -# $(CC) $(CFLAGS) -L /usr/X11R6/lib -shared -o contrib/factory/simple-error-handler.so contrib/factory/simple-error-handler.c -lX11 - echo 'USING: image kernel ; "extended.image" save-image 0 exit' | ./f factor.image contrib/load.factor -####### Build the documentation + $(CC) $(CFLAGS) -L /usr/X11R6/lib -shared -o contrib/factory/simple-error-handler.so contrib/factory/simple-error-handler.c -lX11 + echo 'USING: image kernel ; "extended.image" save-image 0 exit' | ./runtime basic.image contrib/load.factor + # Build the documentation cd doc && for i in *.eps; do epstopdf $$i; done cd doc && rubber --pdf theory cd doc && sh makedoc @@ -36,7 +40,7 @@ clean: dh_testroot rm -f build-stamp configure-stamp -$(MAKE) clean - -rm -f f factor.image extended.image + -rm -f f runtime factor.image boot.image boot.image.$(FARCH) basic.image extended.image dh_clean install: build @@ -44,8 +48,12 @@ install: build dh_testroot dh_clean -k dh_installdirs - install f factor.image extended.image $(CURDIR)/debian/factor/usr/share/factor - install -m 755 debian/factor-vm $(CURDIR)/debian/factor/usr/bin + # Install binary files + install runtime boot.image basic.image extended.image $(CURDIR)/debian/factor/usr/lib/factor + # Install source files + install contrib examples fonts library version.factor $(CURDIR)/debian/factor/usr/share/factor + # Install wrapper scripts + install -m 755 debian/scripts/factor-* $(CURDIR)/debian/factor/usr/bin binary-indep: build install diff --git a/debian/scripts/factor-export b/debian/scripts/factor-export new file mode 100644 index 0000000000..a1af34b075 --- /dev/null +++ b/debian/scripts/factor-export @@ -0,0 +1,38 @@ +#!/bin/sh +# Help function +############### +help () { + cat <= 2 + +Yn Size of n-1 youngest generations, megabytes + +An Size of tenured and semi-spaces, megabytes + +Xn Code heap size, megabytes +EOF + exit 0 +} + +# Default values +################ +BINARY_PATH='/usr/lib/factor' +RESOURCE_PATH='/usr/share/factor' +IMAGE="$BINARY_PATH/basic.image" +RUNTIME="$BINARY_PATH/runtime" + +# Logic +####### +if test 0 -eq $# +then + # As a 'quick start' behaviour, so that new users can + # get something to play with immediately. + echo "Launching the Factor runtime with a read-only basic image." + echo "Use \`\"filename\" save-image' to write an editable image." + exec "$RUNTIME" "$IMAGE" -resource-path="$RESOURCE_PATH" +else + case "$1" in + -h|--help) + help + ;; + -b|--basic) + IMAGE="$BINARY_PATH/basic.image" + ;; + -e|--extended) + IMAGE="$BINARY_PATH/extended.image" + ;; + *) + IMAGE="$1" + ;; + esac + shift + exec "$RUNTIME" "$IMAGE" -resource-path="$RESOURCE_PATH" "$@" +fi