#!/bin/sh #(c)2004 Barry Kauler, www.goosee.com/puppy #second script to create Puppy Linux image.gz pwd | grep "sources1" &>/dev/null if [ $? -eq 0 ];then echo "You must first copy/move this script up one level, so that it is in the" echo "same directory as createpuppy0, busybox.links, sources0/, sources1/, etc." echo -e "Then open a terminal window in that directory and run \"# ./createpuppy1\"" echo echo -n "Press ENTER to exit: " exit fi PUPPYDIR="`pwd`" #/root/puppy SOURCESDIR="$PUPPYDIR/sources1" 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 "The script createpuppy0 must be run first. It creates a basic Puppy" echo "that can boot to the commandline." echo "Script createpuppy1 adds further programs to rootfs-complete/ folder" echo "to allow Puppy to run in X graphics mode, with a desktop and basic" echo "X applications." echo -n "Press ENTER to continue this script (CTRL-C to quit): " read vvv echo echo -e "Would you like to cleanup sources1/ 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 sources1/, anything else not to: " read mmm if [ "$mmm" = "y" ];then echo "Please wait..." cd $PUPPYDIR/sources1/libpng-1.2.5 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/tiff-v3.5.7 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/giflib-4.1.0 #make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/jpeg-6b make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/fvwm95-2.0.43f make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/gtk+-1.2.10 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/imlib-1.9.14 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/gdk-pixbuf-0.22.0 make clean &>/dev/null rm -f log*.txt &>/dev/null #cd $PUPPYDIR/sources1/gnotepad+-1.3.3 cd $PUPPYDIR/sources1/beaver-0.2.7/src #make distclean &>/dev/null make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/rxvt-2.6.4 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/xli-1.17.0 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/Xdialog-2.1.1 make distclean &>/dev/null rm -f log*.txt &>/dev/null # cd $PUPPYDIR/sources1/ ...xml2 ? cd $PUPPYDIR/sources1/rox-1.2.2 cd ROX-Filer/src make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/fig2dev make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/libieee1284-0.2.8 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/libghttp-1.0.9 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/libgsm-1.0.10.orig make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources1/xaw95-1.1.4 make clean &>/dev/null rm -f log*.txt &>/dev/null echo "...cleaned sources1/ folder. Exiting script..." exit fi if [ ! -d $DESTDIR ];then echo echo "$DESTDIR does not exist. This means that you have not yet" echo "run createpuppy0 script." echo -n "Press ENTER to quit: " read vvv exit fi echo echo "This script compiles the applications in $PUPPYDIR/sources1" echo "and also copies binaries directly out of the host system and" echo "builds the final Puppy filesystem as a compressed file image.gz." echo echo "The host must have Xfree v4.3.0 installed, but v4.2.x may work," echo "and /usr/X11R6/lib/X11/config/ folder must exist." if [ ! -d /usr/X11R6/lib/X11/config ];then echo echo "WHAT! /usr/X11R6/lib/X11/config directory does not exist." echo "Cannot continue this script." echo -n "Press ENTER to quit: " read vvv exit else echo "...ok, it does." fi echo echo "I have precompiled the Xvesa X server, and you will find it in folder" echo "sources1/xvesa-bin/. Note that it is a link to the actual folder, and you" echo "should change the symlink to point to the most appropriate actual folder." echo "Folder xvesa-bin-M90/ is compiled for Mandrake 9.0." echo "Folder xvesa-bin-M92/ is compiled for Mandrake 9.2." echo "Folder xvesa-bin-S91/ is compiled for Slackware 9.1." echo echo "Set the symlink right now. Example:" echo " # rm -f xvesa-bin" echo " # ln -s xvesa-bin-M90 xvesa-bin" echo echo -n "Then, press ENTER to continue this script: " read vvv echo echo "I have compiled Xfree v4.3.0 from source, to obtain the Xvesa server," echo "plus some support applications. Xfree also has a heap of libraries," echo "and it is possible that your host distro doesn't have these libraries" echo "or has older or incompatible versions." echo "Your host should really have Xfree version 4.3.0 installed, for" echo "compatibility with Puppy." echo "My pre-compiled binary files are in folder xvesa-bin/, and I will do a" echo "quick check now..." #xtype f means also find links to files. FNDFILE="`find /usr -maxdepth 3 -mount -xtype f -name libXft.so.2 | head -n 1`" if [ "$FNDFILE" = "" ];then echo "The host system does not have libXft.so.2, copying it from" echo "sources1/xvesa-bin/ to /usr/X11R6/lib/..." cp -a $PUPPYDIR/sources1/xvesa-bin/libXft.so.2* /usr/X11R6/lib/ &>/dev/null sync ldconfig fi FNDFILE="`find /usr -maxdepth 3 -mount -xtype f -name libfontconfig.so.1 | head -n 1`" if [ "$FNDFILE" = "" ];then echo "The host system does not have libfontconfig.so.1, copying it from" echo "sources1/xvesa-bin/ to /usr/X11R6/lib/..." cp -a $PUPPYDIR/sources1/xvesa-bin/libfontconfig.so.1* /usr/X11R6/lib/ &>/dev/null sync ldconfig fi FNDFILE="`find /usr -maxdepth 3 -mount -xtype f -name libexpat.so.1 | head -n 1`" if [ "$FNDFILE" = "" ];then echo "The host system does not have libexpat.so.1, copying it from" echo "sources1/xvesa-bin/ to /usr/X11R6/lib/..." cp -a $PUPPYDIR/sources1/xvesa-bin/libexpat.so.1* /usr/X11R6/lib/ &>/dev/null sync ldconfig fi FNDFILE="`which xft-config 2>/dev/null`" if [ "$FNDFILE" = "" ];then echo "The host system does not have xft-config, copying it from" echo "sources1/xvesa-bin/ to /usr/sbin/..." cp -a $PUPPYDIR/sources1/xvesa-bin/xft-config /usr/sbin/ &>/dev/null sync fi echo -e "Firstly, checking dependencies for file \"X\", the Xvesa server..." ldd $PUPPYDIR/sources1/xvesa-bin/X | grep "not found" if [ $? -eq 0 ];then #=0 found LIBSMISSING="yes" fi echo -e "Now check file \"xterm\"..." ldd $PUPPYDIR/sources1/xvesa-bin/xterm | grep "not found" if [ $? -eq 0 ];then #=0 found LIBSMISSING="yes" fi if [ "$LIBSMISSING" = "yes" ];then echo "...ok, there is a problem." echo "If files like libXft, libfontconfig, libexpat, are missing, you will" echo "find that they are actually in the host in /usr/lib or in /usr/X11R6/lib," echo "but they are the wrong versions." echo "What you should do at this point is upgrade. Download and install" echo "the Xfree v4.3.0 binary RPM or DEB or TGZ package, whatever your" echo "host requires." echo echo "Cannot continue this script." echo -n "Press ENTER to quit: " read vvv exit else echo "...ok" fi echo echo "Do you want to recompile everything in sources1/ 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 echo echo "Please be sure to follow instructions exactly." echo -en "If you see a red " echo -en "\\033[1;31mfailed" echo -en "\\033[0;39m" echo " message, you may have to abort" echo "the script with CTRL-C and find out why." echo "(or, you may wish to make a note of the file that failed to" echo " compile and just keep going with the script)" echo "(note, the script may have found a default file from the host," echo " so that failed file may already be in rootfs-complete)" echo -n "Press ENTER key to continue: " read vvv fi if [ "$FIRSTTIME" = "yes" ];then echo echo "First time, so will be doing every step of this script..." echo "note that each step may generate logconfig.txt, logbuild.txt," echo "loginstall.txt in the package folder, which are logs of" echo "stdout and errout for configuring, compiling, and installing." else echo echo "Not the first time running this script, so rootfs-complete" echo -e "folder has been built, and you only need to choose \"y\" " echo "for any section below if you want to re-compile/install it." fi if [ "$FIRSTTIME" = "yes" ];then echo echo "X apps are compiled on the host system and also some are copied" echo "directly from the host, so they use shared library files already in" echo "the host. Now we need to copy those to Puppy." echo echo "Filling rootfs-complete/usr/X11R6/lib..." # removed libGL*.so* libGLU*.so* -- putting back, for Qt/Konq/Amaya ...no. # removed libXaw95*.so* for SRCFILE in libexpat*.so* libfontconfig*.so* libfreetype*.so* libICE*.so* libpsres*.so* libSM*.so* libX11*.so* libXcursor*.so* libXext*.so* libXft*.so* libXi*.so* libXmu*.so* libXp*.so* libXrandr*.so* libXrender*.so* libXt*.so* libXtrap*.so* do FILESLST="`find /usr/X11R6/lib -maxdepth 1 -mount -xtype f -name $SRCFILE | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" #WARNING! WARNING! sync cp -afv $SRC2FILE $DESTDIR/usr/X11R6/lib/;check_status $? sync done done echo echo -n "Press ENTER key to continue: " read vvv echo echo "Filling rootfs-complete/usr/X11R6/lib/X11/locale..." #note, Mandrake9.0 puts these into locale/common, Slackware9.1 & # RH9 put them into locale/lib/common. Puppy has a link, # locale/common to locale/lib/common. for SRCFILE in ximcp*.so* xlcDef*.so* xlcUTF8Load*.so* xlibi18n*.so* xlocale*.so* xomGeneric*.so* do FILESLST="`find /usr/X11R6/lib/X11/locale -maxdepth 3 -mount -xtype f -name $SRCFILE | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" #WARNING! WARNING! sync cp -afv $SRC2FILE $DESTDIR/usr/X11R6/lib/X11/locale/lib/common/;check_status $? sync done done echo echo -n "Press ENTER key to continue: " read vvv echo echo "We need to put a few library files into Puppy /usr/lib also, in fact" echo "will grab everything we need for Puppy!..." echo "BUT, will not grab any GTK2 library files ...that option is later in script." echo "Filling rootfs-complete/usr/lib..." #removed libmad libid3tag*.so*, libmp3lame.so* (see createpuppy3) #added libzvt needed by xchat. removed libnetpbm*.so* as installed in createpuppy2. for SRCFILE in libImlib.so* libXft*.so* libXmuu*.so* libXrender*.so* liba52.so* libbz2*.so* libcdda_interface*.so* libcdda_paranoia*.so* libcrypto*.so* libdaemon*.so* libdb1.so* libdb.so.2 libdvdcontrol*.so* libdvdcss*.so* libdvdread*.so* libexpat*.so* libfontconfig*.so* libfreetype*.so* libgdk-1.2*.so* libgdk_imlib*.so* libgdk_pixbuf*.so* libghttp*.so* libgif*.so* libglib-1.2*.so* libgmodule-1.2*.so* libgs.so* libgthread-1.2*.so* libgthread.so libgtk-1.2*.so* libicq*.so* libieee1284*.so* libimlib-*.so* libjpeg*.so* libm.so libmagic.so* libmng*.so* libmsgevents*.so* libncurses.so libnsl.so libpng.so* libpopt*.so* libresolv.so libpstoedit*.so* libpthread.so libssl*.so* libstdc++.so libstdc++.so.5* libtcl*.so libthread_db.so libtidy*.so* libtiff*.so* libtix*.so libtk*.so libusb*.so* libutil.so libX11*.so* libXext*.so* libXft*.so* libXrender*.so* libxml2.so* libz.so libzvt.so* do FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name $SRCFILE | tr "\n" " "`" for SRC2FILE in $FILESLST do #need to be careful not to overwrite something put into /usr/lib by #createpuppy0 script... #cannot use "-xtype f" as ignores broken links... LOOKLDEST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type l -name $SRC2FILE 2>/dev/null`" LOOKFDEST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type f -name $SRC2FILE 2>/dev/null`" LOOKDEST="$LOOKLDEST$LOOKFDEST" if [ "$LOOKDEST" = "" ];then libstripfunc "$SRC2FILE" #WARNING! WARNING! sync cp -afv $SRC2FILE $DESTDIR/usr/lib/;check_status $? sync fi done done echo echo -n "Press ENTER key to continue: " read vvv echo echo "Copying pixbufloader files to rootfs-complete/usr/lib..." FILESLST="`find /usr/lib/gdk-pixbuf -maxdepth 2 -mount -xtype f -name libpixbufloader-*.so* | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" #WARNING! WARNING! sync cp -afv $SRC2FILE $DESTDIR/usr/lib/;check_status $? sync done echo echo -n "Press ENTER key to continue: " read vvv fi if [ "$FIRSTTIME" = "yes" ];then echo echo "When some packages are configured prior to compilation, they" echo "want to know what kind of X server is being used, and they look" echo "in /usr/X11R6/lib/X11/config folder." echo "The problem here is that Puppy uses a special very small" echo "X server known as Xvesa, which is one of the Kdrive family" echo "of small servers. However, the host most likely does not use" echo "Xvesa." echo "Rather than make you recompile the Xserver in the host, to" echo "use Xvsea, which could cause considerable trouble, I am going" echo "to try and cheat a little. This script copies six files," echo "xfree86.cf, host.def, kdrive.cf, site.def, xf86site.def, TinyX.cf" echo "to /usr/X11R6/lib/X11/config/ (renaming the originals with .bak)." echo "Note that I have edited the first three, look for my initials" echo -e "\"BK\" in the text. The last three are untouched, but I am copying" echo "them in case the host distro has modified them." echo echo -ne "Press ENTER to perform this \"cheat\" copy: " read vvv if [ ! -f /usr/X11R6/lib/X11/config/xfree86.cf.bak ];then cd $PUPPYDIR/sources1 mv -f /usr/X11R6/lib/X11/config/xfree86.cf /usr/X11R6/lib/X11/config/xfree86.cf.bak &>/dev/null sync cp -afv xvesa-bin/xfree86.cf /usr/X11R6/lib/X11/config/xfree86.cf;check_status $? mv -f /usr/X11R6/lib/X11/config/host.def /usr/X11R6/lib/X11/config/host.def.bak &>/dev/null sync cp -afv xvesa-bin/host.def /usr/X11R6/lib/X11/config/host.def;check_status $? mv -f /usr/X11R6/lib/X11/config/kdrive.cf /usr/X11R6/lib/X11/config/kdrive.cf.bak &>/dev/null sync cp -afv xvesa-bin/kdrive.cf /usr/X11R6/lib/X11/config/kdrive.cf;check_status $? mv -f /usr/X11R6/lib/X11/config/site.def /usr/X11R6/lib/X11/config/site.def.bak &>/dev/null sync cp -afv xvesa-bin/site.def /usr/X11R6/lib/X11/config/site.def;check_status $? mv -f /usr/X11R6/lib/X11/config/xf86site.def /usr/X11R6/lib/X11/config/xf86site.def.bak &>/dev/null sync cp -afv xvesa-bin/xf86site.def /usr/X11R6/lib/X11/config/xf86site.def;check_status $? mv -f /usr/X11R6/lib/X11/config/TinyX.cf /usr/X11R6/lib/X11/config/TinyX.cf.bak &>/dev/null sync cp -afv xvesa-bin/TinyX.cf /usr/X11R6/lib/X11/config/TinyX.cf;check_status $? else echo "...it has already been done before." fi fi echo echo "NOTE:" echo "You can compile X yourself, by downloading the complete tarball, then" echo "copy my modified files xfree86.cf, host.def, and kdrive.cf to config/cf/" echo "folder then follow the instructons to compile." echo "Do not install into the host. You will find a compiled file named Xvesa," echo "located in programs/Xserver/ folder. Copy that to $PUPPYDIR/sources1/xvesa-bin/ " echo "folder, rename to X, then press ENTER to continue this script..." echo echo "(note, if you do compile your own Xvesa, look in current xvesa-bin/ folder" echo " and construct a new xvesa-bin/ folder with all the same files)" echo echo "ALTERNATIVELY, I have already compiled Xvesa and placed it into the folder" echo "$PUPPYDIR/sources1/xvesa-bin/, so you can press ENTER right now..." echo "(the source X11 programs/ folder has other stuff, that I have also placed" echo " into xvesa-bin/ folder. This will all end up in /usr/X11R6/bin in Puppy)." echo skip_key Xvesa if [ "$nnn" ];then echo "Filling /usr/X11R6/bin/..." cd $PUPPYDIR/sources1/xvesa-bin for SRCFILE in X xcalc xclipboard xclock xconsole xcutsel xfontsel xhost xinit xlsfonts xmessage xmodmap xprop xrdb xset xsetroot do cp -afv $SRCFILE $DESTDIR/usr/X11R6/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/X11R6/bin/$SRCFILE" done fi echo echo "All distros will have libpng installed. If by some peculiar misfortune" echo "it isn't, it will be compiled here. But only once... to reinstall, you" echo -e "have to go into sources1/libpng-1.2.5 and run \"make uninstall\" before" echo "proceeding with this script..." echo "Nothing to worry about, just press ENTER key to continue..." echo "THIS SCRIPT WILL LOOK FIRST TO SEE IF libpng IS ALREADY INSTALLED, AND" echo "IF SO, WON'T DO ANYTHING. So, it's safe to press ENTER..." skip_key libpng if [ "$nnn" ];then LOOKDEST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libpng.so* 2>/dev/null`" if [ "$LOOKDEST" = "" ];then echo "Compiling and installing libpng..." cd $PUPPYDIR/sources1/libpng-1.2.5 make clean &>/dev/null make &>logbuild.txt make install &>loginstall.txt libstripfunc "/usr/lib/libpng12.so.0.1.2.5" #WARNING sync cp -afv /usr/lib/libpng*.so* $DESTDIR/usr/lib/;check_status $? sync else echo "libpng is already in $DESTDIR/usr/lib, got from host." fi fi # -xtype will find symlinks also... LOOKDEST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libpng.so 2>/dev/null`" if [ "$LOOKDEST" = "" ];then echo "There is a potential problem with the installation of libpng:" echo "it doesn't have /usr/lib/libpng.so, which should be a symlink to the" echo "actual libpng shared library file. Please create it now. Example:" echo " # ln -s libpng.so.3.1.2.5 libpng.so" echo echo -n "AFTER YOU HAVE FIXED THIS, press ENTER to continue: " read vvv fi LOOKPNG12="`which libpng12-config 2>/dev/null`" if [ "$LOOKPNG12" ];then echo "I am trying to force compiled apps not to use libpng12.so.xxx, just" echo "libpng.so.xxx. One way to hide it is to rename /usr/bin/libpng12-config..." mv -f $LOOKPNG12 ${LOOKPNG12}-DISABLED echo "...done." fi echo echo "Checking for libmng (verify only)..." skip_key libmng if [ "$nnn" ];then LOOKDEST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libmng.so 2>/dev/null`" if [ "$LOOKDEST" = "" ];then echo echo "WARNING:" echo "File /usr/lib/libmng.so is missing." echo "You should go into /usr/lib and make sure that there is a link," echo "for example: # ln -s libmng.so.1.0.0 libmng.so" echo "DO IT RIGHT NOW." echo echo -n "Press ENTER to continue: " read vvv fi fi echo echo "All distros will have libtiff installed. If by some peculiar misfortune" echo "it isn't, it will be compiled here. But only once... to reinstall, you" echo -e "have to go into sources1/tiff-v3.5.7 and run \"make uninstall\" before" echo "proceeding with this script..." echo "Nothing to worry about, just press ENTER key to continue..." echo "THIS SCRIPT WILL LOOK FIRST TO SEE IF libtiff IS ALREADY INSTALLED, AND" echo "IF SO, WON'T DO ANYTHING. So, it's safe to press ENTER..." skip_key libtiff if [ "$nnn" ];then LOOKDEST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libtiff.so* 2>/dev/null`" if [ "$LOOKDEST" = "" ];then echo "Compiling and installing libtiff..." cd $PUPPYDIR/sources1/tiff-v3.5.7 make distclean &>/dev/null ./configure --prefix=/usr --target=i486-pc-linux-gnu &>/logconfig.txt make &>logbuild.txt make install &>loginstall.txt cp -afv /usr/lib/libtiff.so* $DESTDIR/usr/lib/;check_status $? sync #searching for it, as make only builds libtiff.a and I'm not sure whether #make install will create libtiff.so.3, libtiff.so.3.5 or libtiff.so.3.5.7... #note, -type f finds only a file, -xtype f finds links also. FILESLST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type f -name libtiff.so* | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" done else echo "libtiff is already in $DESTDIR/usr/lib, got from host." fi fi # -xtype will find symlinks also... LOOKDEST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libtiff.so 2>/dev/null`" if [ "$LOOKDEST" = "" ];then echo "There is a potential problem with the installation of libtiff:" echo "it doesn't have /usr/lib/libtiff.so, which should be a symlink to the" echo "actual libtiff shared library file. Please create it now. Example:" echo " # ln -s libtiff.so.3.5 libtiff.so" echo echo -n "AFTER YOU HAVE FIXED THIS, press ENTER to continue: " read vvv fi echo echo -e "Puppy uses \"giflib\", not \"libungif\", and some distros may not" echo "have giflib installed (such as Mandrake). So will do it here..." echo "If not there, it will be installed. But only ONCE... to reinstall," echo -e "you have to go into the host /usr/lib and remove all the libgif.so*" echo "files before proceeding with this script! ..." echo "If in doubt, no problem, just press ENTER key to continue..." echo "PLEASE JUST PRESS ENTER KEY!" skip_key giflib if [ "$nnn" ];then #warning, using -type as distro may have libgif link to libunfig, and #-type ignores links in search... LOOKDEST="`find /usr/lib -maxdepth 1 -mount -type f -name libgif.so* 2>/dev/null`" if [ "$LOOKDEST" = "" ];then echo "Compiling and installing libgif..." cd $PUPPYDIR/sources1/giflib-4.1.0 #make distclean &>/dev/null #./configure --prefix=/usr --enable-shared --host=i486-pc-linux-gnu #...doesn't work. Do it this way...copied lib/makefile.unx to Makefile, #edit it a bit, then... cd lib make clean &>/dev/null make &>logbuild.txt #make install &>loginstall.txt rm -f /usr/lib/libgif.so* &>/dev/null cp -a libgif.so.3.0 /usr/lib/ &>/dev/null ln -s libgif.so.3.0 /usr/lib/libgif.so.3 &>/dev/null ln -s libgif.so.3.0 /usr/lib/libgif.so.0 &>/dev/null ln -s libgif.so.3.0 /usr/lib/libgif.so &>/dev/null ln -s libgif.so.3.0 /usr/lib/libgif.so.4 &>/dev/null mv -f /usr/include/gif_lib.h /usr/include/gif_lib.h-ORIG &>/dev/null cp -f gif_lib.h /usr/include/ &>/dev/null sync libstripfunc "/usr/lib/libgif.so.3.0" cp -afv /usr/lib/libgif.so* $DESTDIR/usr/lib/;check_status $? else echo "libgif is already in $DESTDIR/usr/lib, got from host." fi fi echo echo "All distros will have libjpeg installed. If by some peculiar misfortune" echo "it isn't, it will be compiled here. But only ONCE... to reinstall, you" echo -e "have to go into sources1/jpeg-6b and run \"make uninstall\" before" echo "proceeding with this script..." echo "Nothing to worry about, just press ENTER key to continue..." skip_key libjpeg if [ "$nnn" ];then LOOKDEST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libjpeg.so* 2>/dev/null`" if [ "$LOOKDEST" = "" ];then echo "Compiling and installing libjpeg..." cd $PUPPYDIR/sources1/jpeg-6b make distclean &>/dev/null ./configure --prefix=/usr --enable-shared --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt make install &>loginstall.txt libstripfunc "/usr/lib/ligjpeg.so.62.0.0" sync cp -afv /usr/lib/libjpeg.so* $DESTDIR/usr/lib/;check_status $? sync else echo "libjpeg is already in $DESTDIR/usr/lib, got from host." fi fi # -xtype will find symlinks also... LOOKDEST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libjpeg.so 2>/dev/null`" if [ "$LOOKDEST" = "" ];then echo "There is a potential problem with the installation of libjpeg:" echo "it doesn't have /usr/lib/libjpeg.so, which should be a symlink to the" echo "actual libjpeg shared library file. Please create it now. Example:" echo " # ln -s libjpeg.so.62.0.0 libjpeg.so" echo echo -n "AFTER YOU HAVE FIXED THIS, press ENTER to continue: " read vvv fi echo # -xtype will find symlinks also... LOOKDEST="`find /usr/X11R6/lib -maxdepth 1 -mount -xtype f -name libXpm.so 2>/dev/null`" if [ "$LOOKDEST" = "" ];then echo "Problem, /usr/X11R6/lib/libXpm.so symlink does not exist." echo "The Mandrake 9.0 install of Xfree is slightly broken. I have put checks" echo "and fixes in this script, and the missing libXpm.so is one of them." echo "...if you are using some other distro, it has the same problem!" echo "In Mandrake 9.0, fvwm95 cannot find -lXpm. Fix this by going into" echo "/usr/X11R6/lib and create a symlink libXpm.so to the actual LibXpm file." echo "For example: # ln -s libXpm.so.4.11 libXpm.so" echo "DO THIS NOW BEFORE PROCEEDING!" echo "...er, check, it may be in /usr/lib" echo fi skip_key fvwm95 if [ "$nnn" ];then echo "Compiling and installing fvwm95..." echo "Note that Fvwm95 will be installed fully into the host also." if [ ! -f /usr/include/X11/xpm.h ];then echo "Xfree installation a bit broken, installing /usr/include/X11/xpm.h..." #Mandrake 9.0 again! cp -fv $PUPPYDIR/sources1/xvesa-bin/xpm.h /usr/include/X11/xpm.h;check_status $? cp -fv $PUPPYDIR/sources1/xvesa-bin/simx.h /usr/include/X11/simx.h;check_status $? fi cd $PUPPYDIR/sources1/fvwm95-2.0.43f make uninstall &>/dev/null make distclean &>/dev/null ./configure --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt make install &>loginstall.txt sync echo "Installing to rootfs-complete/usr/local/lib/X11/fvwm95..." binstripfunc "/usr/local/lib/X11/fvwm95/FvwmAudio" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmAuto" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmBacker" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmBanner" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmButtons" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmConsole" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmConsoleC" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmCpp" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmDebug" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmForm" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmIconBox" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmIconMan" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmIdent" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmM4" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmPager" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmSave" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmSaveDesk" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmScript" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmScroll" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmTalk" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmTaskBar" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmWinList" binstripfunc "/usr/local/lib/X11/fvwm95/FvwmWharf" sync cp -af /usr/local/lib/X11/fvwm95/Fvwm* $DESTDIR/usr/local/lib/X11/fvwm95/ sync if [ -f /usr/local/lib/X11/fvwm95/FvwmAudio ];then echo "...installed Fvwm* executables ok.";check_status 0 else echo "...Fvwm* executables missing.";check_status 1 fi # FILESLST="`find /usr/local/lib/X11/fvwm95 -maxdepth 1 -mount -xtype f -name Fvwm* | tr "\n" " "`" # for SRC2FILE in $FILESLST # do # binstripfunc "$SRC2FILE" # sync # cp -afv $SRC2FILE $DESTDIR/usr/local/lib/X11/fvwm95/;check_status $? # sync # done # if [ "$FILESLST" = "" ];then # echo "Error, no executables in /usr/local/lib/X11/fvwm95";check_status 1 # fi echo "Now installing plugins..." FILESLST="`find /usr/local/lib/X11/fvwm95/plugins -maxdepth 1 -mount -xtype f -name *.so | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" sync cp -afv $SRC2FILE $DESTDIR/usr/local/lib/X11/fvwm95/plugins/;check_status $? sync done if [ "$FILESLST" = "" ];then echo "Error, no lib files in /usr/local/lib/X11/fvwm95/plugins";check_status 1 fi echo "Installing to rootfs-complete/usr/X11R6/bin..." cp -afv /usr/local/bin/fvwm95 $DESTDIR/usr/X11R6/bin/;check_status $? cp -afv /usr/local/bin/xpmroot $DESTDIR/usr/X11R6/bin/;check_status $? fi echo echo "I am going to assume that your host has GTK 1.2.10 installed!" echo "libglib is part of it... press ENTER, verifies here only..." skip_key glib if [ "$nnn" ];then echo "This script has already copied libglib-1.2.so* to Puppy. Verifying..." FILESLST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type f -name libglib-1.2*.so* | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "...IT IS NOT THERE! SOMETHING WRONG WITH YOUR DISTRO?" echo -n "Cannot continue. Press ENTER to exit: " read vvv exit else echo "...ok" fi fi echo echo "I am going to assume that your host has GTK 1.2.10 installed!" echo "libgtk and libgdk are part of it... press ENTER, verifies here only..." skip_key gtk if [ "$nnn" ];then echo "This script has already copied libgtk-1.2*.so* to Puppy. Verifying..." FILESLST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type f -name libgtk-1.2*.so* | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "...IT IS NOT THERE! SOMETHING WRONG WITH YOUR DISTRO?" echo -n "Cannot continue. Press ENTER to exit: " read vvv exit else echo "...ok" fi echo "This script has already copied libgdk-1.2*.so* to Puppy. Verifying..." FILESLST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type f -name libgdk-1.2*.so* | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "...IT IS NOT THERE! SOMETHING WRONG WITH YOUR DISTRO?" echo -n "Cannot continue. Press ENTER to exit: " read vvv exit else echo "...ok" fi echo # echo "There is a problem with Mozilla crashing, a GDK error, in Mandrake 9.2." # echo "When selected a bitmap font, choose a different size to display it, then" # echo "switch tab windows, get badmatch error." # echo "So, will compile GTK/GDK now and put into Puppy, not into host..." # echo -n "Press \"y\" key if host is Mandrake 9.2: " # read vvvv # if [ "$vvvv" = "y" ];then # cd $PUPPYDIR/sources1/gtk+-1.2.10 # make distclean &>/dev/null # ./configure --prefix=/usr --host=i486-pc-linux-gnu &>logconfig.txt # cp -afv gdk/.libs/libgdk-1.2.so.0.9.1 $DESTDIR/usr/lib/;check_status $? # sync # libstripfunc "$DESTDIR/usr/lib/libgdk-1.2.so.0.9.1" # cp -afv gtk/.libs/libgtk-1.2.so.0.9.1 $DESTDIR/usr/lib/;check_status $? # sync # libstripfunc "$DESTDIR/usr/lib/libgtk-1.2.so.0.9.1" # echo "...hmm, maybe should copy these to the host also, so apps are compiled" # echo "against the exact libs, but they are the same version so leaving the old" # echo "ones in host should be fine." # fi fi echo echo "I think that any decent distro will have the imlib library, but it must" echo "be the version 1.x, not 2.x. Of course, a distro may have both." echo "Press ENTER to check. Will install if it ain't there..." skip_key imlib if [ "$nnn" ];then echo "These should already have been copied to Puppy..." echo "libImlib.so* libgdk_imlib*.so* libimlib-*.so*" echo "Verifying..." FILESLST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type f -name libImlib.so* | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "Not there, so will compile and install it..." cd $PUPPYDIR/sources1/imlib-1.9.14 make uninstall &>/dev/null make distclean &>/dev/null ./configure --prefix=/usr --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt make install &>loginstall.txt FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libImlib.so* | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" sync cp -afv $SRC2FILE $DESTDIR/usr/lib/;check_status $? sync done if [ "$FILESLST" = "" ];then echo "Error, no libImlib.so* files.";check_status 1 fi FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libgdk_imlib*.so* | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" sync cp -afv $SRC2FILE $DESTDIR/usr/lib/;check_status $? sync done if [ "$FILESLST" = "" ];then echo "Error, no libgdk_imlib*.so* files.";check_status 1 fi FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libimlib-*.so* | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" sync cp -afv $SRC2FILE $DESTDIR/usr/lib/;check_status $? sync done if [ "$FILESLST" = "" ];then echo "Error, no libimlib-*.so* files.";check_status 1 fi else echo "...ok" fi echo echo "A problem with imlib in Mandrake 9.2 is that it is compiled with libungif," echo "but Puppy uses libgif. Rather than compile it myself and overwrite the host" echo "installation, I will just put links into Puppy and hope it is ok..." #note, amaya crashes on startup because of libimlib-gif.so missing libungif.so.4. rm -f $DESTDIR/usr/lib/libungif.so* sync REALGIF="`find /usr/lib -maxdepth 1 -type f -name libgif.so* | head -n 1`" ln -s $REALGIF $DESTDIR/usr/lib/libungif.so.4 ln -s $REALGIF $DESTDIR/usr/lib/libungif.so.0 fi echo echo "The pixbuf library should have been already installed in Puppy." echo "You can verify... press ENTER, will only verify..." skip_key pixbuf if [ "$nnn" ];then echo "Files libgdk_pixbuf*.so* libpixbufloader-*.so* should be in Puppy." echo "Verifying..." FILESLST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type f -name libgdk_pixbuf*.so* | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "Error, no libgdk_pixbuf*.so* files.";check_status 1 echo "Source package is in sources1/. Compile with --prefix=/usr and" echo "--build=i486-pc-linux-gnu and install into the host." echo -n "Press ENTER to abort script: " read vvv exit fi FILESLST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type f -name libpixbufloader-*.so* | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "Error, no libpixbufloader-*.so* files.";check_status 1 echo "Source package is in sources1/. Compile with --prefix=/usr and" echo "--build=i486-pc-linux-gnu and install into the host." echo -n "Press ENTER to abort script: " read vvv exit fi echo echo "In Mandrake 9.0 the pixbuf install is slightly broken, gdk-pixbuf-config" echo "is missing. Checking for it now..." which gdk-pixbuf-config &>/dev/null if [ ! $? -eq 0 ];then echo "...it is missing. Copying it out of the pixbuf package folder..." cp -fv $PUPPYDIR/sources1/gdk-pixbuf-0.22.0/gdk-pixbuf-config /usr/bin/;check_status $? chmod 755 /usr/bin/gdk-pixbuf-config fi echo echo "Also in Mandrake 9.0 the header files are missing. Checking..." FILESLST="`find /usr/include -maxdepth 3 -mount -type f -name gdk-pixbuf.h | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "...missing. Copying headers from package source to /usr/include..." cp -afv $PUPPYDIR/sources1/gdk-pixbuf-0.22.0/gdk-pixbuf-1.0 /usr/include/ &>/dev/null fi echo echo "There must be a symlink, /usr/lib/libgdk_pixbuf.so pointing to the actual" echo "libgdk_pixbuf.so* file. Checking..." #-xtype means will find symlinks also... FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libgdk_pixbuf.so | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo echo "/usr/lib/libgdk_pixbuf.so is missing. You will have to create it manually." echo " # ln -s libgdk_pixbuf.so.nnnn /usr/lib/libgdk_pixbuf.so" echo "replace libgdk_pixbuf.so.nnnn with proper name of actual library file." echo "DO THIS RIGHT NOW, BEFORE CONTINUING THIS SCRIPT!" echo echo -n "After fixing this problem, press ENTER to continue: " read vvv else echo "...ok" echo "However, better check that it points to the right place. libgdk_pixbuf.so" echo "must point to a file libgdk_pixbuf.so.nnn, NOT libgdk_pixbuf-2.nnnn" echo -n "After checking this (and fix if necessary), press ENTER to continue: " read vvv fi fi echo skip_key beaver #gnotepad if [ "$nnn" ];then cd $PUPPYDIR/sources1/beaver-0.2.7/src #gnotepad+-1.3.3 #make distclean &>/dev/null #./configure --enable-gnome=no --enable-glade=no --enable-splash=no --enable-clipboard --enable-undoredo --enable-regex-search --enable-recent --enable-toolbars --enable-fileinfo --enable-htmltags --enable-srcctrl --enable-efilesel --enable-gtk-xmhtml=no --enable-gtkhtml=no --disable-nls --host=i486-pc-linux-gnu &>logconfig.txt make clean &>/dev/null make &>logbuild.txt #cp -fv src/gnp $DESTDIR/usr/local/bin/;check_status $? cp -fv beaver $DESTDIR/usr/local/bin/;check_status $? sync #binstripfunc "$DESTDIR/usr/local/bin/gnp" binstripfunc "$DESTDIR/usr/local/bin/beaver" sync fi echo skip_key rxvt if [ "$nnn" ];then cd $PUPPYDIR/sources1/rxvt-2.6.4 make distclean &>/dev/null ./configure --sysconfdir=/etc --localstatedir=/var --enable-menubar --enable-xpm-background --enable-graphics --with-x --with-xpm --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt cp -fv src/rxvt $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/rxvt" sync fi echo skip_key xli if [ "$nnn" ];then cd $PUPPYDIR/sources1/xli-1.17.0 make distclean &>/dev/null xmkmf &>logconfig.txt echo "xli has a problem compiling on all distros so far. I have to temporarily" echo "replace /usr/include/string.h..." mv -f /usr/include/string.h /usr/include/string.h-TMP sync cp string.h-FIXED2 /usr/include/string.h sync make &>logbuild.txt rm -f /usr/include/string.h sync mv -f /usr/include/string.h-TMP /usr/include/string.h sync FLAGFAILED=0 cp -fv xli $DESTDIR/usr/local/bin/;check_status $? cp -fv xlito $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/rxvt" binstripfunc "$DESTDIR/usr/local/bin/xlito" sync if [ $FLAGFAILED -eq 1 ];then echo "Ok, it failed! Now we try Plan B..." echo "replace /usr/include/string.h..." mv -f /usr/include/string.h /usr/include/string.h-TMP sync cp string.h-FIXED2 /usr/include/string.h sync echo "For Plan B, replace varargs.h..." FILESLST="`find /usr/lib/gcc-lib -maxdepth 4 -mount -type f -name varargs.h | head -n 1`" mv -f ${FILESLST} ${FILESLST}-TMP sync cp varargs.h-FIXED $FILESLST sync make clean &>/dev/null make &>logbuild.txt rm -f /usr/include/string.h rm -f $FILESLST sync mv -f /usr/include/string.h-TMP /usr/include/string.h mv -f ${FILESLST}-TMP ${FILESLST} sync FLAGFAILED=0 cp -fv xli $DESTDIR/usr/local/bin/;check_status $? cp -fv xlito $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/rxvt" binstripfunc "$DESTDIR/usr/local/bin/xlito" sync fi fi echo skip_key xdialog if [ "$nnn" ];then cd $PUPPYDIR/sources1/Xdialog-2.1.1 make distclean &>/dev/null ./configure --sysconfdir=/etc --localstatedir=/var --disable-nls --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt cp -fv src/Xdialog $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/Xdialog" sync fi echo echo "I expect the host to have libxml2, and already installed into Puppy." echo "Verify here..." skip_key libxml2 if [ "$nnn" ];then echo "Checking for libxml2.so* installed in Puppy..." FILESLST="`find $DESTDIR/usr/lib -maxdepth 1 -mount -type f -name libxml2.so* | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "Error, no libxml2.so* files.";check_status 1 echo "Source package is in sources1/. Compile with --prefix=/usr " echo "--build=i486-pc-linux-gnu --with-iso8859x --without-iconv" echo "--enable-ipv6=no --sysconfdir=/etc --localstatedir=/var" echo "and install into the host." echo -n "Press ENTER to abort script: " read vvv exit else echo "...ok." fi fi echo echo "Now to compile and install rox, the file manager." echo "On Mandrake 9.0, pixbuf installation is slightly broken, and rox configure" echo "cannot find stuff. ...this checked for and fixed above." skip_key rox if [ "$nnn" ];then echo "Compiling and installing rox..." cd $PUPPYDIR/sources1/rox-1.2.2 cd ROX-Filer/src #do not do make distclean make clean &>/dev/null rm -f config.cache ./configure --enable-rox --with-platform=Linux-ix86 --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt cd $PUPPYDIR/sources1/rox-1.2.2/ROX-Filer/Linux-ix86 cp -afv ROX-Filer $DESTDIR/usr/local/apps/ROX-Filer/Linux-ix86/;check_status $? sync binstripfunc "$DESTDIR/usr/local/apps/ROX-Filer/Linux-ix86/ROX-Filer" sync fi echo skip_key fig2dev if [ "$nnn" ];then echo "Compiling and installing fig2dev..." echo "Note that there are various files edited in the source." echo "Note that fig2dev is part of a bigger package, transfig, and to get this" echo "to compile I have copied file patchlevel.h up one level, to sources1/." cd $PUPPYDIR/sources1/fig2dev #do not do make distclean. I have edited Makefile, could not find xpm.h. make clean &>/dev/null make &>logbuild.txt FLAGFAILED=0 cp -fv fig2dev $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/fig2dev" sync if [ $FLAGFAILED -eq 1 ];then echo "Ok, it failed! Now we try Plan B..." echo "For Plan B, replace varargs.h..." FILESLST="`find /usr/lib/gcc-lib -maxdepth 4 -mount -type f -name varargs.h | head -n 1`" mv -f ${FILESLST} ${FILESLST}-TMP sync cp varargs.h-FIXED $FILESLST sync make clean &>/dev/null make &>logbuild.txt cp -fv fig2dev $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/fig2dev" sync rm -f $FILESLST cp -f ${FILESLST}-TMP ${FILESLST} fi fi echo skip_key libieee1284 if [ "$nnn" ];then echo "Checking to see if already installed in host..." FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libieee1284.so | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "Compling and installing libieee1284..." cd $PUPPYDIR/sources1/libieee1284-0.2.8 make distclean &>/dev/null ./configure --sysconfdir=/etc --prefix=/usr --localstatedir=/var --build=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt make install &>loginstall.txt else echo "...yes it is." fi echo "Copying to Puppy..." cp -afv /usr/lib/libieee1284.so $DESTDIR/usr/lib/;check_status $? cp -afv /usr/lib/libieee1284.so.3 $DESTDIR/usr/lib/;check_status $? cp -afv /usr/lib/libieee1284.so.3.2.0 $DESTDIR/usr/lib/;check_status $? sync libstripfunc "$DESTDIR/usr/lib/libieee1284.so.3.2.0" sync fi echo skip_key libghttp if [ "$nnn" ];then echo "Checking to see if already installed in host..." FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libghttp.so | tr "\n" " "`" if [ "$FILESLST" = "" ];then echo "Compling and installing libghttp..." cd $PUPPYDIR/sources1/libghttp-1.0.9 make distclean &>/dev/null ./configure --sysconfdir=/etc --prefix=/usr --localstatedir=/var --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt make install &>loginstall.txt else echo "...yes it is." fi echo "Copying to Puppy..." cp -afv /usr/lib/libghttp.so $DESTDIR/usr/lib/;check_status $? cp -afv /usr/lib/libghttp.so.1 $DESTDIR/usr/lib/;check_status $? cp -afv /usr/lib/libghttp.so.1.0.0 $DESTDIR/usr/lib/;check_status $? sync libstripfunc "$DESTDIR/usr/lib/libghttp.so.1.0.0" sync fi echo skip_key libgsm if [ "$nnn" ];then echo "Compiling and installing libgsm (just a static lib)..." echo "Note, I have edited Makefile." cd $PUPPYDIR/sources1/libgsm-1.0.10.orig #do not do make distclean. make clean &>/dev/null make &>logbuild.txt make install &>loginstall.txt #note, libgsm.a to /usr/lib if [ -f /usr/lib/libgsm.a ];then echo "...installed /usr/lib/libgsm.a to host ok.";check_status 0 else echo ".../usr/lib/libgsm.a not there.";check_status 1 fi echo "...note, nothing to install into Puppy. Gphone will use static lib." fi echo skip_key file if [ "$nnn" ];then echo "Assuming it is in host. Above, already copied libmagic.so from host," echo "which is used by file." echo "Note, /usr/share/misc/file/ has config stuff, already in rootfs-skeleton/." cp -afv /usr/bin/file $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/file" fi echo echo "Puppy uses libXaw95, an improvement over libXaw Athena widget library." echo -e "NOTE: if Xaw95 fails to compile, Xaw3d will be the fallback." if [ ! -d /usr/include/X11/Xaw3d ];then echo echo "WARNING, /usr/include/X11/Xaw3d folder does not exist!" echo "This means that Xaw3d devel package is not installed. FIX RIGHT NOW!" echo "(or do not bother, as Xaw95 should compile okay!)" fi #echo -e "If you want libXaw95, type the two keys \"95\" then ENTER, or type" #echo -e "\"3d\" then press ENTER key for libXaw3d, " #echo -n "or press ENTER only for neither: " echo echo -n "Press ENTER to continue: " read FLAG95 FLAG95="95" if [ "$FLAG95" = "95" ];then echo skip_key xaw95 if [ "$nnn" ];then echo echo "NOTES:" echo "The redhat Puppy, up to v0.7.9, used the neXtaw Athena library for" echo "Athena-based applications. The v0.8.x Puppy series used Xaw95." echo "These are both improvements on the original Xaw library supplied" echo "with Xfree, and are almost drop-in replacements." echo "I found neXtaw to be buggy, hence replaced it with Xaw95." echo "Some apps that have been compiled for Xaw will work fine with the" echo "drop-in replacements, but some apps have to be explicitly compiled" echo "for the new Athena library." echo "Note, Xaw3d is an enhancement over Xaw, but is still not very pretty." echo echo "Checking to see if already installed in host..." #-type f will ignore symlinks... FILEREAL="`find /usr/X11R6/lib -maxdepth 1 -mount -type f -name libXaw95.so* | head -n 1`" if [ "$FILEREAL" = "" ];then echo "...it is not there." echo echo "Compiling and installing libXaw95 into host..." cd $PUPPYDIR/sources1/xaw95-1.1.4 make distclean &>/dev/null xmkmf &>logconfig.txt make includes &>/dev/null make depend &>/dev/null cp -f *.h /usr/X11R6/include/X11/Xaw95 &>/dev/null #cp -af Xaw95-include /usr/include/X11/Xaw95 &>/dev/null if [ ! -d /usr/include/X11/Xaw-DISABLED ];then mv -f /usr/include/X11/Xaw /usr/include/X11/Xaw-DISABLED &>/dev/null else rm -fr /usr/include/X11/Xaw &>/dev/null fi sync ln -s Xaw95 /usr/include/X11/Xaw &>/dev/null make &>logbuild.txt make install &>loginstall.txt ldconfig else echo "...ok." fi echo echo -n "Press ENTER key to continue: " read vvv echo echo "A major problem is that /usr/X11R6/lib/libXaw.so* exists in the host." echo "To more easily compile apps for Puppy, we really want these to only be" echo "symlinks to libXaw95.so (at the risk of breaking some existing app" echo "in the host)." echo "First, find exact name of the Xaw95 lib file..." # -type will ignore any symlinks... sync FILEXAW95="`find /usr/X11R6/lib -maxdepth 1 -mount -type f -name libXaw95.so* | head -n 1`" if [ "$FILEXAW95" ];then echo "...it is $FILEXAW95. Now to convert all libXaw.so* files into links..." FILESLST="`find /usr/X11R6/lib -maxdepth 1 -mount -xtype f -name libXaw.so* | tr "\n" " "`" for SRC2FILE in $FILESLST do if [ -d /root/DISABLEDXAW ];then rm -f $SRC2FILE else mkdir /root/DISABLEDXAW &>/dev/null mv -f $SRC2FILE /root/DISABLEDXAW/ &>/dev/null fi sync ln -s $FILEXAW95 $SRC2FILE &>/dev/null done echo "...done." rm -f /usr/lib/libXaw95.so #as it may have previously been relinked to Xaw3d. ln -s $FILEXAW95 /usr/lib/libXaw95.so echo echo "Now copy libXaw*.so* files to Puppy..." libstripfunc "$FILEXAW95" #WARNING sync cp -afv /usr/X11R6/lib/libXaw.so* $DESTDIR/usr/X11R6/lib/;check_status $? cp -afv /usr/X11R6/lib/libXaw95.so* $DESTDIR/usr/X11R6/lib/;check_status $? sync else echo "$FILEXAW95 ...failed to compile." echo "So, will now use Xaw3d instead..." FLAGS95="3d" fi fi fi if [ "$FLAG95" = "3d" ];then echo echo "The libXaw3d files should already be in the host..." FILEXAW3D="`find /usr/X11R6/lib -maxdepth 1 -mount -type f -name libXaw3d.so.* | head -n 1`" echo "...it is $FILEXAW3D. Now to convert all libXaw.so* files into links..." FILESLST="`find /usr/X11R6/lib -maxdepth 1 -mount -xtype f -name libXaw.so* | tr "\n" " "`" for SRC2FILE in $FILESLST do if [ -d /root/DISABLEDXAW ];then rm -f $SRC2FILE else mkdir /root/DISABLEDXAW &>/dev/null mv -f $SRC2FILE /root/DISABLEDXAW/ fi sync ln -s $FILEXAW3D $SRC2FILE done echo "...done." rm -f /usr/lib/libXaw.* &>/dev/null #precaution. mv /usr/lib/Xaw95.so /usr/lib/Xaw95.so_DISABLED &>/dev/null sync ln -s $FILEXAW3D /usr/lib/libXaw95.so #mess with the headers... if [ ! -d /usr/include/X11/Xaw-DISABLED ];then mv -f /usr/include/X11/Xaw /usr/include/X11/Xaw-DISABLED &>/dev/null else rm -fr /usr/include/X11/Xaw &>/dev/null fi sync ln -s Xaw3d /usr/include/X11/Xaw &>/dev/null echo echo "Now copy libXaw*.so* files to Puppy..." libstripfunc "$FILEXAW3D" #WARNING sync cp -afv /usr/X11R6/lib/libXaw.so* $DESTDIR/usr/X11R6/lib/;check_status $? cp -afv /usr/X11R6/lib/libXaw3d.so* $DESTDIR/usr/X11R6/lib/;check_status $? sync fi FLAG95="" #echo #skip_key gtk2 #if [ "$nnn" ];then # echo "If we are going to put gtk2 apps into Puppy, then we will need to copy a" # echo "heap of extra shared lib files into /usr/lib." # echo "For example, to use Abiword 2.x, we will need gtk2." # echo # echo -ne "Press \"y\" key to install gtk2 libs to Puppy: " # read vvv # if [ "$vvv" = "y" ];then # echo # echo "Copying files... " # CUMCOUNT=0 # for LIBFILES in libglade-2*.so* libgtk-x11-2*.so* libgdk-x11-2*.so* libatk-1*.so* libgdk_pixbuf-2*.so* libpango-1*.so* libpangoxft-1*.so* libpangox-1*.so* libgobject-2*.so* libgmodule-2*.so* libglib-2*.so* libfribidi.so* # do # REALFILE="`find /usr/lib -maxdepth 1 -type f -name $LIBFILES | head -n 1`" # libstripfunc $REALFILE # sync # FILECOUNT=`wc -c $REALFILE 2>/dev/null | tr -s ' ' | cut -f 2 -d ' '` # CUMCOUNT=expr $CUMCOUNT + $FILECOUNT # cp -afv /usr/lib/$LIBFILES $DESTDIR/usr/lib/ # done # echo "...done." # echo "The total size of GTK2 library files just added is $CUMCOUNT bytes." # fi #fi echo echo "To create files image.gz and usr_cram.fs from rootfs-complete/, run" echo "the script createimagegz." echo "Exiting this script now..." exit ############ #OLD STUFF ############ ############ echo echo "Now the script will build image.gz. You don't have to build" echo "image.gz now, especially if you want to go ahead and compile" echo "and install apps from sources2,etc." echo -ne "Press ENTER to continue, \"n\" to exit script now: " read vvv if [ "$vvv" = "n" ];then exit fi echo echo "Copying a modified .fvwm95rc from sources1/ to rootfs-complete/root0/..." cd $PUPPYDIR/sources1 cp -fv fvwm95rc $DESTDIR/root0/.fvwm95rc echo echo "Copying rootfs-complete/ to rootfs-tmp1/..." cd $PUPPYDIR rm -fr rootfs-tmp1 2>/dev/null sync cp -af rootfs-complete rootfs-tmp1 sync echo "Converting rootfs-tmp1/usr/ folder to cramfs image file..." cd $PUPPYDIR/rootfs-tmp1 $PUPPYDIR/mkcramfs usr usr_cram.fs sync rm -f -r usr sync cd $PUPPYDIR rm -fr rootfs-tmp2 2>/dev/null sync mkdir rootfs-tmp2 echo "Making ext2 filesystem on rootfs-tmp2/, size $FSSIZE Kbytes..." dd if=/dev/zero of=image bs=1k count=$FSSIZE sync losetup /dev/loop0 image mke2fs -m 0 -b 1024 /dev/loop0 sync mount -t ext2 /dev/loop0 rootfs-tmp2 echo "Copying everything from rootfs-tmp1/ to rootfs-tmp2/..." cp -a rootfs-tmp1/* rootfs-tmp2/ sync echo "Creating compressed file image.gz..." umount rootfs-tmp2 losetup -d /dev/loop0 dd if=image | gzip -9 > image.gz sync rm -f image rm -fr rootfs-tmp1 rm -fr rootfs-tmp2 sync echo "image.gz created!" ####END####