#!/bin/sh #(c)2004 Barry Kauler, www.goosee.com/puppy #sixth script to create Puppy Linux image.gz PUPPYDIR="`pwd`" #/root/puppy SOURCESDIR="$PUPPYDIR/sources5" DESTDIR="$PUPPYDIR/rootfs-complete" FSSIZE=`cat $PUPPYDIR/rootfs-skeleton/root0/.etc/ramdisksize` echo "Files failed to strip:" > $SOURCESDIR/logstriperr.txt binstripfunc() { #param passed in is full path and filename, no wildchars allowed. #note, do not put quotes around the $1, fails if asterisks if [ ! -h $1 ];then #-h test if symbolic link. strip --strip-unneeded $1 > /dev/null 2>&1 if [ ! $? -eq 0 ];then echo "$1" >> $SOURCESDIR/logstriperr.txt fi fi } libstripfunc() { #param passed in is full path and filename, no wildchars allowed. #note, do not put quotes around the $1, fails if asterisks #WARNING: do not strip all symbols, as this script strips some #lib files at their source, in the host system. if [ ! -h $1 ];then #-h test if symbolic link. strip --strip-debug $1 > /dev/null 2>&1 if [ ! $? -eq 0 ];then echo "$1" >> $SOURCESDIR/logstriperr.txt fi fi } check_status() { /bin/echo -en "\\033[65G" if [ $1 -eq 0 ] then /bin/echo -en "\\033[1;32mdone" else /bin/echo -en "\\033[1;31mfailed" FLAGFAILED=1 fi /bin/echo -e "\\033[0;39m" } skip_key() { if [ "$FIRSTTIME" = "yes" ];then echo -n "Press ENTER to continue (and compile/install $1): " read mmm nnn="y" else echo -en "To compile/install $1, press \"y\", else \"ENTER\" to skip: " read nnn fi } echo echo -e "Would you like to cleanup sources5/ folder by running \"make clean\"" echo -e "or \"make distclean\" in all the packages? This will remove all the" echo "configuration and compiled files. You probably only want to do this" echo "if you want to make everything into a tarball for distribution, or" echo " you need to save space on the drive." echo -e "This script will cleanup then exit if you choose \"y\"." echo -ne "Press \"y\" to clean sources5/, anything else not to: " read mmm if [ "$mmm" = "y" ];then echo "Please wait..." cd $PUPPYDIR/sources5/abs-src-0.908 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/gbase-0.5 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/gnetconfig-0.1.5 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/xanim2801 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/gxanim-0.50 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/mtools-3.9.8 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/MToolsFM-1.9-3 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/rp-pppoe-3.5 cd src make distclean &>/dev/null rm -f log*.txt &>/dev/null cd ../gui make clean &>/dev/null rm -f log*.txt &>/dev/null #sane-backends got from host. cd $PUPPYDIR/sources5/xsane-0.90 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/sylpheed-0.9.11 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/Ted-2.14 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/xchat-1.8.11 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources5/bluefish-0.7 make distclean &>/dev/null rm -f log*.txt &>/dev/null sync echo "...cleaned sources5/ folder. Exiting script..." exit fi echo echo "Do you want to recompile everything in sources5/ folder and install" echo "into rootfs-complete/ folder?" echo "If you just press ENTER, you will asked about each package, whether" echo "you want to compile and install it." echo "IF THIS IS THE VERY FIRST TIME THAT YOU ARE RUNNING THIS SCRIPT," echo -e "YOU MUST TYPE \"y\" TO BUILD EVERYTHING!" echo echo -en "Type \"y\" for everything or just press ENTER only for no: " read nnn if [ "$nnn" ];then FIRSTTIME="yes" cd $PUPPYDIR fi echo skip_key abs if [ "$nnn" ];then echo "Compiling/installing abs..." cd $PUPPYDIR/sources5/abs-src-0.908 echo "Pup094, have hacked the source: Makefile, kernel/font.c, font.h, X11/pixmaps/abs.xpm" echo "ABS linked against Xaw95 did not display edit-boxes. Have modified Makefile so links" echo "statically with libXaw3d.a" make clean &>/dev/null make &>logbuild.txt sync cp -afv abs $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/abs" fi echo skip_key gbase if [ "$nnn" ];then echo "Compiling/installing gbase..." cd $PUPPYDIR/sources5/gbase-0.5 make clean &>/dev/null make &>logbuild.txt sync cp -afv gbase $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/gbase" fi echo skip_key gnetconfig if [ "$nnn" ];then echo "Compiling/installing gnetconfig..." cd $PUPPYDIR/sources5/gnetconfig-0.1.5 make distclean &>/dev/null ./configure --localstatedir=/var --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt sync cp -afv gnetconfig $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/gnetconfig" fi echo skip_key xanim if [ "$nnn" ];then echo "Compiling/installing xanim..." echo "Note, Makefile edited." cd $PUPPYDIR/sources5/xanim2801 make clean &>/dev/null make &>logbuild.txt sync cp -afv xanim $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/xanim" fi echo skip_key gxanim if [ "$nnn" ];then echo "Compiling/installing gxanim..." cd $PUPPYDIR/sources5/gxanim-0.50 make clean &>/dev/null make &>logbuild.txt sync cp -afv gxanim $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/gxanim" fi echo skip_key mtools if [ "$nnn" ];then echo "Compiling/installing mtools..." cd $PUPPYDIR/sources5/mtools-3.9.8 make distclean &>/dev/null ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt sync for ONEFILE in mattrib mbadblocks mcat mcd mcopy mdel mdeltree mdir mdu mformat minfo mlabel mmd mmount mmove mpartition mrd mread mren mshowfat mtoolstest mtype mzip mtools do cp -afv $ONEFILE $DESTDIR/usr/bin/;check_status $? done sync binstripfunc "$DESTDIR/usr/bin/mtools" fi echo skip_key mtoolsfm if [ "$nnn" ];then echo "Compiling/installing mtoolsfm..." cd $PUPPYDIR/sources5/MToolsFM-1.9-3 make distclean &>/dev/null ./configure --disable-nls --sysconfdir=/etc --localstatedir=/var --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt sync cp -afv src/MToolsFM $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/MToolsFM" fi echo echo "Note that the kernel should have pppoe support compiled in." echo "The pppd program must be in the host (see createpuppy0)." skip_key rp-pppoe if [ "$nnn" ];then echo "Compiling/installing rp-pppoe..." cd $PUPPYDIR/sources5/rp-pppoe-3.5 cd src make distclean &>/dev/null ./configure --localstatedir=/var --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt sync for ONEFILE in pppoe pppoe-server pppoe-sniff pppoe-relay do cp -afv $ONEFILE $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/$ONEFILE" done cd ../scripts for ONEFILE in adsl-connect adsl-start adsl-status adsl-stop adsl-setup adsl-init do cp -afv $ONEFILE $DESTDIR/usr/sbin/;check_status $? done cd ../gui make clean &>/dev/null make &>logguibuild.txt cp -afv pppoe-wrapper $DESTDIR/usr/sbin/;check_status $? cp -afv tkpppoe $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/pppoe-wrapper" chmod 755 $DESTDIR/usr/sbin/tkpppoe fi echo echo "NOTE: script createpuppy0 requested you to make sure that sane-backends" echo "package is installed. So, will assume it is there..." echo "MAYBE WILL COMPILE IT MYSELF IN THE FUTURE, FOR LESS DEPENDENCIES!" skip_key sane-backends if [ "$nnn" ];then echo "Compiling/installing sane-backends..." #cd $PUPPYDIR/sources5/sane-backends-1.0.12 echo "It should be in the host, so will copy to Puppy..." for ONEFILE in scanimage sane-find-scanner gamma4scanimage do cp -afv /usr/bin/$ONEFILE $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/$ONEFILE" done #find the real one... FILESANE="`find /usr/lib -maxdepth 1 -type f -mount -name libsane.so*`" libstripfunc "$FILESANE" cp -afv /usr/lib/libsane.so* $DESTDIR/usr/lib/;check_status $? echo "NOTE, the folder /usr/lib/sane/ in the host has all the drivers for" echo "the scanners. Puppy has these as an external package." echo "...so, we do NOT copy these into rootfs-complete/." echo "NOTE, Puppy already has installed, in rootfs-skeleton/etc/sane.d/" echo "folder." echo echo "The Mandrake 9.2 sane-backends requires libgphoto and libexif..." echo "...yeah, bunging them into Puppy also..." FILEGPHOTO2="`find /usr/lib -maxdepth 1 -type f -mount -name libgphoto2.so*`" libstripfunc "$FILEGPHOTO2" FILEGPHOTO2="`find /usr/lib -maxdepth 1 -type f -mount -name libgphoto2_port.so*`" libstripfunc "$FILEGPHOTO2" sync cp -afv /usr/lib/libgphoto2*.so* $DESTDIR/usr/lib/ FILEGPHOTO2="`find /usr/lib -maxdepth 1 -type f -mount -name libexif.so.9*`" libstripfunc "$FILEGPHOTO2" sync cp -afv /usr/lib/libexif.so.9* $DESTDIR/usr/lib/ fi echo echo "Note, Mandrake 9.2 needs libsane2-devel package installed -- see notes" echo "in createpuppy0, so this should have been done." skip_key xsane if [ "$nnn" ];then echo "Compiling/installing xsane..." cd $PUPPYDIR/sources5/xsane-0.90 make distclean &>/dev/null ./configure --disable-gimp --disable-nls --disable-gtk2 --localstatedir=/var &>logconfig.txt make &>logbuild.txt sync cp -afv src/xsane $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/xsane" fi echo skip_key sylpheed if [ "$nnn" ];then echo "Compiling/installing sylpheed..." cd $PUPPYDIR/sources5/sylpheed-0.9.99 make distclean &>/dev/null ./configure --enable-ssl --disable-compface --disable-ipv6 --disable-nls --localstatedir=/var --build=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt sync cp -afv src/sylpheed $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/sylpheed" fi echo echo "Note, for Ted 2.16 I had to edit Ted/configure and appFrame/configure to " echo "ignore GTK2." echo "Anyway, can't get 2.16 to work properly so going back to 2.14." skip_key ted if [ "$nnn" ];then echo "Compiling/installing ted..." cd $PUPPYDIR/sources5/Ted-2.14 make clean &>/dev/null make compile.shared &>logbuild.txt sync cp -afv Ted/Ted $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/Ted" fi echo skip_key xchat if [ "$nnn" ];then echo "Compiling/installing xchat..." echo "Note, needs /usr/lib/libzvt.so.2, whatever that is (see createpuppy1)." cd $PUPPYDIR/sources5/xchat-1.8.11 make distclean &>/dev/null ./configure --disable-trans --disable-plugin --disable-nls --enable-openssl=/usr --disable-gnome --disable-perl --disable-python --prefix=/usr/local --build=i486-pc-linux-gnu --localstatedir=/var &>logconfig.txt make &>logbuild.txt sync cp -afv src/fe-gtk/xchat $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/xchat" fi echo skip_key bluefish if [ "$nnn" ];then echo "Compiling/installing bluefish..." cd $PUPPYDIR/sources5/bluefish-0.7 make distclean &>/dev/null ./configure --disable-nls --disable-splash-screen --build=i486-pc-linux-gnu --sysconfdir=/etc --localstatedir=/var &>logconfig.txt make &>logbuild.txt sync cp -afv src/bluefish $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/bluefish" fi #echo #skip_key abiword #if [ "$nnn" ];then # echo "Compiling/installing abiword..." # cd $PUPPYDIR/sources5/abiword-1.0.2 # cd abi # make clean &>/dev/null # make distclean &>/dev/null # #Config for abiword 1.0.2: # #./configure --with-libwmf --disable-gnome --disable-scripting --disable-bidi --without-pspell --with-libiconv --with-libjpeg --with-libxml2 --with-zlib --with-libpng --localstatedir=/var --build=i486-pc-linux-gnu &>logconfig.txt # #Config for abiword 2.0.0: # ./configure --disable-gnome --disable-scripting --disable-pspell --with-libxml2 --with-zlib --with-libjpeg --with-libpng --localstatedir=/var ----build=i486-pc-linux-gnu --disable-enchant --with-popt --without-ImageMagick &>logconfig.txt # make &>logbuild.txt #fi echo echo "...finished script." ####END####