Author: ks156
Date: 2009-03-18 12:59:35 +0100 (Wed, 18 Mar 2009)
New Revision: 4129

Added:
   
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/create_debian.sh
Log:
* Added a script to make a debian package (not fully tested yet)


Added: 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/create_debian.sh
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/create_debian.sh
                          (rev 0)
+++ 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/create_debian.sh
  2009-03-18 11:59:35 UTC (rev 4129)
@@ -0,0 +1,160 @@
+#!/bin/bash
+
+ARCH=$1
+VERSION=$2
+
+PREFIX=/usr
+MIRROR=./mirror
+DEBIAN_DIR=./DEBIAN
+PREINST=$DEBIAN_DIR/preinst
+POSTINST=$DEBIAN_DIR/postinst
+CONTROL=$DEBIAN_DIR/control
+CONF_FILE=$DEBIAN_DIR/conffiles
+
+DEPS="libc6(>=2.3), python, libasound2, python-ctypes, libstdc++5, \
+python-xml, libportaudio2, openjdk-6-jre, python-dev, python-setuptools, sox, \
+lame"
+
+[[ -z $ARCH ]] && echo "Bad arch" && exit 1
+
+[[ -d $MIRROR ]] && rm -rf $MIRROR
+
+if [ $ARCH == "x86" ]; then
+    ARCH_DEB="i386"
+elif [ $ARCH == "x86_64" ]; then
+    ARCH_DEB="amd64"
+fi
+
+python ../software_updater/tux_software_updater.py \
+--install=$PWD/$MIRROR \
+--prefix=$PREFIX
+
+# Create dirs
+[[ -d $MIRROR/usr ]] || mkdir -p $MIRROR/usr
+[[ -d $MIRROR/etc/udev/rules.d ]] || mkdir -p $MIRROR/etc/udev/rules.d
+[[ -d $MIRROR/etc/init.d ]] || mkdir -p $MIRROR/etc/init.d
+[[ -d $MIRROR/etc/tuxdroid ]] || mkdir -p $MIRROR/etc/tuxdroid
+
+# Create the udev rules
+echo "# Rules for kernel version >= 2.6.24
+SUBSYSTEM==\"usb\", ENV{DEVTYPE}==\"usb_device\", ATTRS{idVendor}==\"03eb\", 
ATTRS{idProduct}==\"ff07\", MODE:=\"0666\" 
+SUBSYSTEM==\"usb\", ENV{DEVTYPE}==\"usb_device\", ATTRS{idVendor}==\"03eb\", 
ATTRS{idProduct}==\"2ffd\", MODE:=\"0666\" 
+# Rules for kernel version < 2.6.26
+SUBSYSTEM==\"usb_device\", ATTRS{idVendor}==\"03eb\", 
ATTRS{idProduct}==\"ff07\", MODE:=\"0666\" 
+SUBSYSTEM==\"usb_device\", ATTRS{idVendor}==\"03eb\", 
ATTRS{idProduct}==\"2ffd\", MODE:=\"0666\" 
+# Change the hiddev mode
+KERNEL==\"hiddev*\", MODE=\"0666\" " >> \
+$MIRROR/etc/udev/rules.d/45-tuxdroid.rules
+chmod +x $MIRROR/etc/udev/rules.d/45-tuxdroid.rules
+
+# Create the init script
+echo '#!/bin/bash
+
+### BEGIN INIT INFO
+# Provides:          tuxhttpserver
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0
+# Short-Description: Tux Droid server
+### END INIT INFO
+# /etc/init.d/tuxhttpserver: start tuxhttpserver
+#
+
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+DESC="HTTP server for Tuxdroid" 
+NAME=tuxhttpserver 
+DAEMON=tuxhttpserver 
+case "$1" in 
+    start) 
+        echo Starting $DESC 
+            $DAEMON --start 
+            if [ $? -gt 0 ]; then 
+                echo Failed to start $NAME 
+            fi 
+    ;; 
+    stop) 
+        echo "Stopping $DESC" 
+            $DAEMON --stop 
+            if [ $? -gt 0 ]; then 
+                 echo Failed to stop $NAME 
+            fi 
+    ;;
+    restart|force-reload)
+         $DAEMON --restart
+    ;; 
+esac 
+exit 0' >> $MIRROR/etc/init.d/tuxhttpserver
+chmod +x $MIRROR/etc/init.d/tuxhttpserver
+
+# Create the configuration file
+echo "# Tux Droid Configuration
+# Please don't modify manually this file. Your changes will be overwritted 
during
+# the installation process.
+
+# Installation prefix
+# This prefix indicate where the software has been installed
+PREFIX=$PREFIX
+
+# Architecture
+# This value specify the target architecure (x86 or x86_64)
+ARCH=$ARCH
+
+# IUUID
+# Thix identifier let the software know when an update has been done
+IUUID=`uuidgen`
+
+" >> $MIRROR/etc/tuxdroid/tuxdroid.conf
+
+# Create the debian directory
+[[ -d $DEBIAN_DIR ]] || mkdir -p $DEBIAN_DIR
+
+# Create the the conffile
+echo "/etc/tuxdroid/tuxdroid.conf" >> $CONF_FILE
+
+# Create the Control file
+echo "Package: Tuxsetup
+Priority: extra
+Section: Application
+Installed-Size: $(du -s $MIRROR |awk '{print $1}')
+Maintainer: KySoH <[email protected]>
+Architecture: $ARCH_DEB
+Version: $VERSION
+Depends: $DEPS
+Description: Software for Tux Droid
+ This package contains all the software required for Tux Droid
+ - Tux HTTP Server 
+ - Python API
+ - USB Driver
+ - Libraries for the Acapela Text-to-speach
+ - Control Center : Connfiguration software
+ - Several gadgets
+ - Several attitunes
+ - Several tools" >> $CONTROL
+
+# Create Post Installation file
+echo "#!/bin/bash
+cd $PREFIX/lib/tuxdroid/python-api
+python setup.py install >/dev/null
+cd - > /dev/null
+update-rc.d tuxhttpserver defaults > /dev/null
+/etc/init.d/tuxhttpserver start
+chmod +x $PREFIX/share/tuxdroid/tuxhttpserver/tuxhttpserver.py
+chmod +x $PREFIX/share/tuxdroid/tux_updater/tux_software_updater.py 
+exit 0" >> $POSTINST
+
+# Create Pre Install file
+echo "#!/bin/bash
+[[ -e /etc/init.d/tuxhttpserver ]] && /etc/init.d/tuxhttpserver stop
+exit 0" >> $PREINST
+
+chmod +x $DEBIAN_DIR/*
+
+# Create the debian file
+mkdir -p tuxsetup-$VERSION-$ARCH_DEB
+mv $MIRROR/* tuxsetup-$VERSION-$ARCH_DEB
+rm -rf $MIRROR
+mv $DEBIAN_DIR tuxsetup-$VERSION-$ARCH_DEB
+sudo chown -R root:root tuxsetup-$VERSION-$ARCH_DEB
+dpkg-deb --build tuxsetup-$VERSION-$ARCH_DEB
+sudo rm -rf tuxsetup-$VERSION-$ARCH_DEB


Property changes on: 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/create_debian.sh
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/x-sh
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to