[DebianGIS-dev] r991 - packages/debian-gis

pere at alioth.debian.org pere at alioth.debian.org
Fri Aug 3 22:23:53 UTC 2007


Author: pere
Date: 2007-08-03 22:23:53 +0000 (Fri, 03 Aug 2007)
New Revision: 991

Added:
   packages/debian-gis/build-gis-live
   packages/debian-gis/packages-live
Log:
Start on script to build live CD.

Added: packages/debian-gis/build-gis-live
===================================================================
--- packages/debian-gis/build-gis-live	                        (rev 0)
+++ packages/debian-gis/build-gis-live	2007-08-03 22:23:53 UTC (rev 991)
@@ -0,0 +1,180 @@
+#!/bin/sh
+#
+# (c) 2006, 2007	Holger Levsen <debian at layer-acht.org>
+# (c) 2007 		Petter Reinholdtsen <pere at hungry.com>
+#
+# Licended under GPL2
+#
+# Build script for Debian Gis Live CD.
+# Based on build script for Debian Edu live CD.
+#
+# Build depends: live-helper
+#
+##############################################################################
+
+# Exit on errors
+set -e
+
+# CD boot image
+#SPLASHPNG=foo.png
+
+# Update scripts from svn during the build?
+UPDATESVN=false
+
+#SUDO=sudo
+
+# Where to fetch the base system
+mirror=ftp://ftp.no.debian.org/debian/
+
+BUILD_DIR="$(dirname $0)"
+
+msg_info() {
+  #echo info: $@
+  :
+}
+
+msg_error() {
+  echo error: $@
+}
+
+if cd $BUILD_DIR ; then
+	:
+else
+	msg_error "$BUILD_DIR doesn't exist, aborting."
+	echo
+	echo "svn co svn://svn.debian.org/svn/pkg-grass/packages/debian-gis"
+	exit 1
+fi
+
+PUBLISH_DIR=~ftp/debian-gis-live
+PUBLISH_DIR=$(pwd)/../debian-gis-live
+LOCKFILE="/var/lock/gislive-build"
+LOGFILE=`mktemp`
+TODAY="`date +%Y%m%d%H%M`"
+
+#
+# check lockfile
+#
+if [ -f "$LOCKFILE" ] ; then
+	echo $LOCKFILE exists, aborting
+	exit 1
+fi
+at_exit() {
+    rm $LOCKFILE
+    if [ -f $LOGFILE ] ; then
+	cp $LOGFILE $PUBLISH_DIR/gislive-${TODAY}.log
+	chmod 644 $PUBLISH_DIR/gislive-${TODAY}.log
+	rm $LOGFILE
+    fi
+}
+trap at_exit EXIT
+touch $LOCKFILE
+
+#
+# prepare
+#
+if [ true = "UPDATESVN" ] ; then
+    # display diffs from current local version to version in repository
+    svn diff --revision HEAD
+
+    # update to version in repository
+    svn up -q
+fi
+
+# cleanup
+if [ -d debian-live ] ; then
+    if $SUDO /bin/rm -rf $BUILD_DIR/debian-live > /dev/null ; then
+	msg_info "removed old build directory"
+    else
+	msg_error "problems removing old build"
+	exit 1
+    fi
+fi
+
+# Installing 'etch' to make this buildable with debootstrap from etch,
+# but adding a lenny archive below to get the packages from lenny.
+if /usr/bin/make-live config \
+    --initramfs live-initramfs \
+    --bootappend "quiet splash" \
+    --keyring-packages debian-archive-keyring \
+    --mirror-bootstrap $mirror \
+    --distribution etch \
+    --sections "main" \
+    --packages debian-edu-install \
+    --packages-lists packages-live \
+    --apt-recommends disabled \
+    --hooks /root/post-install-hook
+then
+  msg_info generating configuration succeeded
+else
+  msg_error generating configuration failed
+  exit 1
+fi
+
+# Generate host-install hook script
+mkdir -p debian-live/chroot/root
+cat <<EOF > debian-live/chroot/root/post-install-hook
+#!/bin/sh
+# Script executed in the build chroot after the packages are installed.
+
+EOF
+chmod a+rx debian-live/chroot/root/post-install-hook
+
+# Make the package list available
+(
+    cat packages-live 
+) | grep -v '#' > debian-live/config/chroot_local-packageslists/packages-live
+
+# Add an extra repository to use during package installation
+for file in live.bootstrap live.binary ; do
+    echo deb ftp://ftp.no.debian.org/debian/ lenny main \
+	>> debian-live/config/chroot_sources/$file
+done
+
+# Generate RLE from our boot splash image PNG in debian-edu-artwork
+# Color index 0 is background, and index 7 is foreground.  Set to
+# black and white respecively
+if [ -f "$SPLASHPNG" ] ; then
+    mkdir -p debian-live/config/binary_syslinux
+    pngtopnm < /usr/share/pixmaps/splash/debian-edu-splash.png | \
+	ppmquant 16 2>/dev/null | \
+	ppmtolss16 "#ffffff=7" "#000000=0"  2>/dev/null \
+	> debian-live/config/binary_syslinux/splash.rle
+fi
+
+#
+# build
+#
+if $SUDO /usr/bin/make-live > $LOGFILE 2>&1 ; then
+  msg_info "build succeeded."
+else
+  msg_error "build failed."
+  exit 1
+fi
+
+#
+# publish
+# 
+if [ -f debian-live/binary.iso ] ; then
+  cp debian-live/binary.iso $PUBLISH_DIR/gislive-${TODAY}.iso
+  md5sum $PUBLISH_DIR/gislive-${TODAY}.iso > $PUBLISH_DIR/gislive-${TODAY}.md5sum
+  msg_info successfully build live-cd, download at http://ftp.skolelinux.org/cd-etch-live/gislive-${TODAY}.iso
+else 
+  echo "#########################################################"
+  echo 
+  echo "An error occured, .iso was not created :-("
+  echo 
+  echo "30 last lines of the make-live output:"
+  echo
+  tail -30 $LOGFILE
+fi 
+
+#
+# cleanup old images and logs
+#
+cd $PUBLISH_DIR
+find . -mtime +1 !  -name "gislive-*00.???" -exec rm {} \;
+find . -mtime +2 !  -name "gislive-1600.???" -exec rm {} \;
+find . -mtime +14 ! -name "gislive-0400.???" -exec rm {} \;
+
+# The lockfile is removed by the at_exit function

Added: packages/debian-gis/packages-live
===================================================================
--- packages/debian-gis/packages-live	                        (rev 0)
+++ packages/debian-gis/packages-live	2007-08-03 22:23:53 UTC (rev 991)
@@ -0,0 +1,29 @@
+# This file should be automatically generated from the tasks files.
+xorg
+#kde
+xserver-xorg
+avce00
+e00compr
+earth3d
+geoip
+gmt
+gpsbabel
+gpsd
+gpsd-clients
+gpsdrive
+gpsman,
+gpsmanshp
+gpstrans
+gpx2shp
+grace6
+grass-doc
+kflog,
+mapserver
+openev
+openjump
+openscenegraph
+php4-mapscript,
+phppgadmin
+postgis
+proj
+thuban




More information about the Pkg-grass-devel mailing list