Fabianx
03-30-2003, 10:49 PM
Hi,
I now made a one to do all script.
this is just v.0.1 so it has not everythingI want to have it, but one ahve to make backups and this is a public one :-)
As there are dirs, this time its a diff.
Syntax is easy ...
Just do a:
./knx-live-inst.sh l
to see modules availabe ...
then do:
./knx-live-inst.sh sim-0.8.1
to install it.
sim-0.8.1 is for KDE 3.1.0-woody, sim-0.8.2 for KDE 3.1.1-unstable.
Easy isn't it ?
Files are for the moment downloaded from the net or you have to put them into:
modules/<name>/<yourfile.deb>
So one could also do a install-mirror-tgz with all binaries already in there. :D
Also note that for now programs are installed into $HOME/.dist so it'll be kept if configuration is saved!
I'm working hard to get alsa working with the new installer (I myself already have it, nice sound :-)) )
Stay tuned! There are great things to come!
cu
Fabian
diff -Nur knx-live-inst/knx-live-inst.sh knx-live-inst-0.1/knx-live-inst.sh
--- knx-live-inst/knx-live-inst.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/knx-live-inst.sh 2003-03-30 23:12:50.000000000 +0200
@@ -0,0 +1,138 @@
+#!/bin/bash
+#
+# Install software while it is runnin from CD into home directory - useful in combination with persistant home
+#
+# GPL
+#
+# Author: Fabian Franz <knx-live-inst@fabian-franz.de>
+#
+
+# Constants
+
+DESTDIR="$HOME/.dist"
+export DESTDIR
+TMPDIR="/tmp/knx-live-inst.$$"
+MODPATH=$(pwd)
+MODULES=$MODPATH/modules/
+FILES="files"
+INSTALL="install.sh"
+mkdir -p $TMPDIR
+cd $TMPDIR
+
+function clean_exit
+{
+ cd ~
+ rm -rf $TMPDIR
+}
+
+trap "clean_exit" EXIT
+
+# Functions needed
+
+function deb-unpack()
+{
+ ar p $1 data.tar.gz | tar xz
+}
+
+function rpm-unpack()
+{
+ rpm2cpio $1 | cpio --extract --make-directories
+}
+
+function tgz-unpack()
+{
+ tar xzf $1
+}
+
+function tbz-unpack()
+{
+ tar xzj $1
+}
+
+# knx-unpack filename location type md5sum
+function knx-unpack()
+{
+ [ ! -f $1 ] && return 2
+ case "$3" in
+ deb) deb-unpack $1 ;;
+ rpm) rpm-unpack $1 ;;
+ tgz) tgz-unpack $1 ;;
+ tbz) tbz-unpack $1 ;;
+ *)
+ echo "Unknown Package format"
+ false
+ ;;
+ esac
+}
+
+function setup_destdir()
+{
+ # setup $HOME/.bashrc
+
+ mkdir -p $DESTDIR/bin
+ mkdir -p $DESTDIR/lib
+ mkdir -p $DESTDIR/man
+
+ cp $HOME/.bashrc $HOME/.bashrc.templ.$$
+ cat $HOME/.bashrc.templ.$$ | grep -v "DESTDIR=" | grep -v "export MANPATH=\$DESTDIR/man" | grep -v "export PATH=\$DESTDIR/bin/" | grep -v "export LD_LIBRARY_PATH=\$DESTDIR/lib" > $HOME/.bashrc
+ echo "DESTDIR=$DESTDIR" >> $HOME/.bashrc
+ echo "export MANPATH=\$DESTDIR/man/:\$MANPATH" >> $HOME/.bashrc
+ echo "export PATH=\$DESTDIR/bin/:\$PATH" >> $HOME/.bashrc
+ echo "export LD_LIBRARY_PATH=\$DESTDIR/lib:\$LD_LIBRARY_PATH" >> $HOME/.bashrc
+ rm -f $HOME/.bashrc.templ.$$
+
+}
+
+function abort
+{
+ echo $1
+ exit $2
+}
+
+# Format of Files order + package_name
+# So package basename location type md5sum
+function get_file()
+{
+ [ -f $MODULES/$1/$2 ] && cp $MODULES/$1/$2 $TMPDIR
+ [ -f $MODULES/$1/$2 ] || wget $3
+}
+
+if [ "$#" -lt "1" ]; then
+ echo Usage: $(basename $0) "<module-name>"
+ exit 1
+fi
+
+if [ ! -f "$MODULES/$1/$FILES" ];
+then
+ echo "Fatal: Package not found"
+ echo "Availabe are:"
+ ls $MODULES | tr ' ' \n
+ exit 1
+fi
+
+echo "OK, Installing $1..."
+setup_destdir
+
+NUM=$(cat $MODULES/$1/files | egrep -v "^#" | wc -l | sed 's/ //g')
+echo "Getting $NUM files..."
+I="1"
+while [ "$I" -le "$NUM" ];
+do
+ file=$(cat $MODULES/$1/files | egrep -v "^#" | tail +$I | head -n 1)
+ get_file $1 $file
+ I=$(($I+1))
+done
+
+echo "Unpacking $NUM files..."
+I="1"
+while [ "$I" -le "$NUM" ];
+do
+ file=$(cat $MODULES/$1/files | egrep -v "^#" | tail +$I | head -n 1)
+ knx-unpack $file
+ [ $? -eq 2 ] && abort "Fatal file not found!" 1
+ I=$(($I+1))
+done
+
+echo "Installing program..."
+sh $MODULES/$1/install.sh
+echo "All done"
Binärdateien knx-live-inst/.knx-live-inst.sh.swp and knx-live-inst-0.1/.knx-live-inst.sh.swp sind verschieden.
diff -Nur knx-live-inst/modules/f-prot/files knx-live-inst-0.1/modules/f-prot/files
--- knx-live-inst/modules/f-prot/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/f-prot/files 2003-03-30 23:06:18.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+fp-linux-sb.tar.gz ftp://ftp.f-prot.com/pub/linux/fp-linux-sb.tar.gz tgz
diff -Nur knx-live-inst/modules/f-prot/install.sh knx-live-inst-0.1/modules/f-prot/install.sh
--- knx-live-inst/modules/f-prot/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/f-prot/install.sh 2003-03-30 23:22:53.000000000 +0200
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+
+mkdir -p $DESTDIR/man/man8
+
+cp -a f-prot $DESTDIR/f-prot
+
+# Make starter links
+ln -fs $DESTDIR/f-prot/f-prot.sh $DESTDIR/bin/f-prot
+ln -fs $DESTDIR/f-prot/check-updates.sh $DESTDIR/bin/check-updates.sh
+ln -fs $DESTDIR/f-prot/man8/f-prot.8 $DESTDIR/man/man8/
+ln -fs $DESTDIR/f-prot/man8/check-updates.sh.8 $DESTDIR/man/man8/
+
+# Fix pathes
+sed 's%/usr/local/f-prot/%'$DESTDIR'/f-prot/%g' f-prot/f-prot.sh > $DESTDIR/f-prot/f-prot.sh
+
+sed 's%/usr/local/f-prot/%'$DESTDIR'/f-prot/%g' f-prot/check-updates.sh > $DESTDIR/f-prot/check-updates.sh
+
+
diff -Nur knx-live-inst/modules/libdvdcss2-1.2.6/files knx-live-inst-0.1/modules/libdvdcss2-1.2.6/files
--- knx-live-inst/modules/libdvdcss2-1.2.6/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/libdvdcss2-1.2.6/files 2003-03-30 23:01:00.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+libdvdcss2_1.2.6-1_i386.deb http://www.videolan.org/pub/libdvdcss/1.2.6/deb/libdvdcss2_1.2.6-1_i386.deb deb 729eaab91589061eedb087bbf5eeab87
diff -Nur knx-live-inst/modules/libdvdcss2-1.2.6/install.sh knx-live-inst-0.1/modules/libdvdcss2-1.2.6/install.sh
--- knx-live-inst/modules/libdvdcss2-1.2.6/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/libdvdcss2-1.2.6/install.sh 2003-03-30 23:01:41.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+
+cp -a usr/lib/* $DESTDIR/lib/
+
diff -Nur knx-live-inst/modules/sim-0.8.1/files knx-live-inst-0.1/modules/sim-0.8.1/files
--- knx-live-inst/modules/sim-0.8.1/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.1/files 2003-03-30 22:50:30.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+sim_0.8.1-1_i386.deb http://telia.dl.sourceforge.net/sourceforge/sim-icq/sim_0.8.1-1_i386.deb deb 2e27a48d8ddf5d11b9b1271fc014bda6
diff -Nur knx-live-inst/modules/sim-0.8.1/install.sh knx-live-inst-0.1/modules/sim-0.8.1/install.sh
--- knx-live-inst/modules/sim-0.8.1/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.1/install.sh 2003-03-30 22:04:08.000000000 +0200
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+cp -a usr/bin/* $DESTDIR/bin
+# copy menu-items & co
+cp -a usr/share/ $HOME/.kde/
+# change menu-item to fit our needs
+sed 's$Exec=sim$Exec='$DESTDIR'/bin/sim$g' usr/share/applnk/Internet/sim.desktop >$HOME/.kde/share/applnk/Internet/sim.desktop
+
diff -Nur knx-live-inst/modules/sim-0.8.2/files knx-live-inst-0.1/modules/sim-0.8.2/files
--- knx-live-inst/modules/sim-0.8.2/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.2/files 2003-03-30 22:25:42.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+sim_0.8.2cvs22022003-1_i386.deb http://sim-icq.sourceforge.net/sim_0.8.2cvs22022003-1_i386.deb deb 8ddefa3887508c12febc2c3804de82ea
diff -Nur knx-live-inst/modules/sim-0.8.2/install.sh knx-live-inst-0.1/modules/sim-0.8.2/install.sh
--- knx-live-inst/modules/sim-0.8.2/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.2/install.sh 2003-03-30 22:08:26.000000000 +0200
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+cp -a usr/bin/* $DESTDIR/bin
+# copy menu-items & co
+cp -a usr/share/ $HOME/.kde/
+# change menu-item to fit our needs
+sed 's$Exec=sim$Exec='$DESTDIR'/bin/sim$g' usr/share/applnk/Internet/sim.desktop >$HOME/.kde/share/applnk/Internet/sim.desktop
+
I now made a one to do all script.
this is just v.0.1 so it has not everythingI want to have it, but one ahve to make backups and this is a public one :-)
As there are dirs, this time its a diff.
Syntax is easy ...
Just do a:
./knx-live-inst.sh l
to see modules availabe ...
then do:
./knx-live-inst.sh sim-0.8.1
to install it.
sim-0.8.1 is for KDE 3.1.0-woody, sim-0.8.2 for KDE 3.1.1-unstable.
Easy isn't it ?
Files are for the moment downloaded from the net or you have to put them into:
modules/<name>/<yourfile.deb>
So one could also do a install-mirror-tgz with all binaries already in there. :D
Also note that for now programs are installed into $HOME/.dist so it'll be kept if configuration is saved!
I'm working hard to get alsa working with the new installer (I myself already have it, nice sound :-)) )
Stay tuned! There are great things to come!
cu
Fabian
diff -Nur knx-live-inst/knx-live-inst.sh knx-live-inst-0.1/knx-live-inst.sh
--- knx-live-inst/knx-live-inst.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/knx-live-inst.sh 2003-03-30 23:12:50.000000000 +0200
@@ -0,0 +1,138 @@
+#!/bin/bash
+#
+# Install software while it is runnin from CD into home directory - useful in combination with persistant home
+#
+# GPL
+#
+# Author: Fabian Franz <knx-live-inst@fabian-franz.de>
+#
+
+# Constants
+
+DESTDIR="$HOME/.dist"
+export DESTDIR
+TMPDIR="/tmp/knx-live-inst.$$"
+MODPATH=$(pwd)
+MODULES=$MODPATH/modules/
+FILES="files"
+INSTALL="install.sh"
+mkdir -p $TMPDIR
+cd $TMPDIR
+
+function clean_exit
+{
+ cd ~
+ rm -rf $TMPDIR
+}
+
+trap "clean_exit" EXIT
+
+# Functions needed
+
+function deb-unpack()
+{
+ ar p $1 data.tar.gz | tar xz
+}
+
+function rpm-unpack()
+{
+ rpm2cpio $1 | cpio --extract --make-directories
+}
+
+function tgz-unpack()
+{
+ tar xzf $1
+}
+
+function tbz-unpack()
+{
+ tar xzj $1
+}
+
+# knx-unpack filename location type md5sum
+function knx-unpack()
+{
+ [ ! -f $1 ] && return 2
+ case "$3" in
+ deb) deb-unpack $1 ;;
+ rpm) rpm-unpack $1 ;;
+ tgz) tgz-unpack $1 ;;
+ tbz) tbz-unpack $1 ;;
+ *)
+ echo "Unknown Package format"
+ false
+ ;;
+ esac
+}
+
+function setup_destdir()
+{
+ # setup $HOME/.bashrc
+
+ mkdir -p $DESTDIR/bin
+ mkdir -p $DESTDIR/lib
+ mkdir -p $DESTDIR/man
+
+ cp $HOME/.bashrc $HOME/.bashrc.templ.$$
+ cat $HOME/.bashrc.templ.$$ | grep -v "DESTDIR=" | grep -v "export MANPATH=\$DESTDIR/man" | grep -v "export PATH=\$DESTDIR/bin/" | grep -v "export LD_LIBRARY_PATH=\$DESTDIR/lib" > $HOME/.bashrc
+ echo "DESTDIR=$DESTDIR" >> $HOME/.bashrc
+ echo "export MANPATH=\$DESTDIR/man/:\$MANPATH" >> $HOME/.bashrc
+ echo "export PATH=\$DESTDIR/bin/:\$PATH" >> $HOME/.bashrc
+ echo "export LD_LIBRARY_PATH=\$DESTDIR/lib:\$LD_LIBRARY_PATH" >> $HOME/.bashrc
+ rm -f $HOME/.bashrc.templ.$$
+
+}
+
+function abort
+{
+ echo $1
+ exit $2
+}
+
+# Format of Files order + package_name
+# So package basename location type md5sum
+function get_file()
+{
+ [ -f $MODULES/$1/$2 ] && cp $MODULES/$1/$2 $TMPDIR
+ [ -f $MODULES/$1/$2 ] || wget $3
+}
+
+if [ "$#" -lt "1" ]; then
+ echo Usage: $(basename $0) "<module-name>"
+ exit 1
+fi
+
+if [ ! -f "$MODULES/$1/$FILES" ];
+then
+ echo "Fatal: Package not found"
+ echo "Availabe are:"
+ ls $MODULES | tr ' ' \n
+ exit 1
+fi
+
+echo "OK, Installing $1..."
+setup_destdir
+
+NUM=$(cat $MODULES/$1/files | egrep -v "^#" | wc -l | sed 's/ //g')
+echo "Getting $NUM files..."
+I="1"
+while [ "$I" -le "$NUM" ];
+do
+ file=$(cat $MODULES/$1/files | egrep -v "^#" | tail +$I | head -n 1)
+ get_file $1 $file
+ I=$(($I+1))
+done
+
+echo "Unpacking $NUM files..."
+I="1"
+while [ "$I" -le "$NUM" ];
+do
+ file=$(cat $MODULES/$1/files | egrep -v "^#" | tail +$I | head -n 1)
+ knx-unpack $file
+ [ $? -eq 2 ] && abort "Fatal file not found!" 1
+ I=$(($I+1))
+done
+
+echo "Installing program..."
+sh $MODULES/$1/install.sh
+echo "All done"
Binärdateien knx-live-inst/.knx-live-inst.sh.swp and knx-live-inst-0.1/.knx-live-inst.sh.swp sind verschieden.
diff -Nur knx-live-inst/modules/f-prot/files knx-live-inst-0.1/modules/f-prot/files
--- knx-live-inst/modules/f-prot/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/f-prot/files 2003-03-30 23:06:18.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+fp-linux-sb.tar.gz ftp://ftp.f-prot.com/pub/linux/fp-linux-sb.tar.gz tgz
diff -Nur knx-live-inst/modules/f-prot/install.sh knx-live-inst-0.1/modules/f-prot/install.sh
--- knx-live-inst/modules/f-prot/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/f-prot/install.sh 2003-03-30 23:22:53.000000000 +0200
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+
+mkdir -p $DESTDIR/man/man8
+
+cp -a f-prot $DESTDIR/f-prot
+
+# Make starter links
+ln -fs $DESTDIR/f-prot/f-prot.sh $DESTDIR/bin/f-prot
+ln -fs $DESTDIR/f-prot/check-updates.sh $DESTDIR/bin/check-updates.sh
+ln -fs $DESTDIR/f-prot/man8/f-prot.8 $DESTDIR/man/man8/
+ln -fs $DESTDIR/f-prot/man8/check-updates.sh.8 $DESTDIR/man/man8/
+
+# Fix pathes
+sed 's%/usr/local/f-prot/%'$DESTDIR'/f-prot/%g' f-prot/f-prot.sh > $DESTDIR/f-prot/f-prot.sh
+
+sed 's%/usr/local/f-prot/%'$DESTDIR'/f-prot/%g' f-prot/check-updates.sh > $DESTDIR/f-prot/check-updates.sh
+
+
diff -Nur knx-live-inst/modules/libdvdcss2-1.2.6/files knx-live-inst-0.1/modules/libdvdcss2-1.2.6/files
--- knx-live-inst/modules/libdvdcss2-1.2.6/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/libdvdcss2-1.2.6/files 2003-03-30 23:01:00.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+libdvdcss2_1.2.6-1_i386.deb http://www.videolan.org/pub/libdvdcss/1.2.6/deb/libdvdcss2_1.2.6-1_i386.deb deb 729eaab91589061eedb087bbf5eeab87
diff -Nur knx-live-inst/modules/libdvdcss2-1.2.6/install.sh knx-live-inst-0.1/modules/libdvdcss2-1.2.6/install.sh
--- knx-live-inst/modules/libdvdcss2-1.2.6/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/libdvdcss2-1.2.6/install.sh 2003-03-30 23:01:41.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+
+cp -a usr/lib/* $DESTDIR/lib/
+
diff -Nur knx-live-inst/modules/sim-0.8.1/files knx-live-inst-0.1/modules/sim-0.8.1/files
--- knx-live-inst/modules/sim-0.8.1/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.1/files 2003-03-30 22:50:30.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+sim_0.8.1-1_i386.deb http://telia.dl.sourceforge.net/sourceforge/sim-icq/sim_0.8.1-1_i386.deb deb 2e27a48d8ddf5d11b9b1271fc014bda6
diff -Nur knx-live-inst/modules/sim-0.8.1/install.sh knx-live-inst-0.1/modules/sim-0.8.1/install.sh
--- knx-live-inst/modules/sim-0.8.1/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.1/install.sh 2003-03-30 22:04:08.000000000 +0200
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+cp -a usr/bin/* $DESTDIR/bin
+# copy menu-items & co
+cp -a usr/share/ $HOME/.kde/
+# change menu-item to fit our needs
+sed 's$Exec=sim$Exec='$DESTDIR'/bin/sim$g' usr/share/applnk/Internet/sim.desktop >$HOME/.kde/share/applnk/Internet/sim.desktop
+
diff -Nur knx-live-inst/modules/sim-0.8.2/files knx-live-inst-0.1/modules/sim-0.8.2/files
--- knx-live-inst/modules/sim-0.8.2/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.2/files 2003-03-30 22:25:42.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+sim_0.8.2cvs22022003-1_i386.deb http://sim-icq.sourceforge.net/sim_0.8.2cvs22022003-1_i386.deb deb 8ddefa3887508c12febc2c3804de82ea
diff -Nur knx-live-inst/modules/sim-0.8.2/install.sh knx-live-inst-0.1/modules/sim-0.8.2/install.sh
--- knx-live-inst/modules/sim-0.8.2/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.2/install.sh 2003-03-30 22:08:26.000000000 +0200
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+cp -a usr/bin/* $DESTDIR/bin
+# copy menu-items & co
+cp -a usr/share/ $HOME/.kde/
+# change menu-item to fit our needs
+sed 's$Exec=sim$Exec='$DESTDIR'/bin/sim$g' usr/share/applnk/Internet/sim.desktop >$HOME/.kde/share/applnk/Internet/sim.desktop
+