#!/bin/sh #post-install script. #Puppy Linux #assume current directory is rootfs-complete, which has the final filesystem. #this script is similar to the post-install scripts of the window managers. #Keywords are located in the Help page and the lines uncommented. #DISTRO_VERSION, DISTRO_NAME are global variables visible here. #110422 DISTRO_VERSION variable now has dotted format. note, also now using full dotted version# in puppy filenames. #120225 create symlink release-notes.htm to actual release-notes file. NO. #120225 backup doc files, refer /usr/sbin/indexgen.sh. #120818 now have /etc/xdg in Woof, taken out of xdg_puppy PET, relocated pinstall.sh to here. #132211 removed icewm template from default, who uses that anyway? setvar WKGDIR = "$(pwd)" echo "Configuring Puppy skeleton..." #cleanup... rm -f /tmp/fbvideomode.txt echo "Configuring Puppy Help page..." #refer /usr/sbin/indexgen.sh... cp -f usr/share/doc/index.html.top usr/share/doc/index.html.top-raw #120225 cp -f usr/share/doc/index.html.bottom usr/share/doc/index.html.bottom-raw #120225 cp -f usr/share/doc/home.htm usr/share/doc/home-raw.htm #120225 setvar cutDISTRONAME = "$(echo -n $DISTRO_NAME | cut -f 1 -d ' )" setvar cPATTERN = ""s/cutDISTRONAME/${cutDISTRONAME}/g"" setvar RIGHTVER = "$DISTRO_VERSION" setvar PUPPYDATE = "$(date | tr -s " " | cut -f 2,6 -d " )" setvar RELEASE_DATE = "$(date "+%B, %Y)" setvar dPATTERN = ""s/PUPPYDATE/${PUPPYDATE}/g"" setvar rPATTERN = ""s/RELEASE_DATE/${RELEASE_DATE}/g"" echo "Writing version number and distro name and date to Help page..." setvar PATTERN1 = ""s/RIGHTVER/${RIGHTVER}/g"" setvar PATTERN2 = ""s/DISTRO_VERSION/${DISTRO_VERSION}/g"" setvar nPATTERN = ""s/DISTRO_NAME/${DISTRO_NAME}/g"" sed -i -e $PATTERN1 -e $PATTERN2 -e $nPATTERN -e $dPATTERN -e $cPATTERN usr/share/doc/index.html.top sed -i -e $PATTERN1 -e $PATTERN2 -e $nPATTERN -e $dPATTERN usr/share/doc/index.html.bottom #...note, /usr/sbin/indexgen.sh puts these together as index.html (via rc.update and 3builddistro). echo "Writing distro name to jumping-off page..." sed -i -e $nPATTERN usr/share/doc/home.htm echo "Creating base release notes..." if test ! -e usr/share/doc/release-${cutDISTRONAME}-${DISTRO_VERSION}.htm{ mv -f usr/share/doc/release-skeleton.htm usr/share/doc/release-${cutDISTRONAME}-${DISTRO_VERSION}.htm sed -i -e $PATTERN1 -e $PATTERN2 -e $nPATTERN -e $rPATTERN usr/share/doc/release-${cutDISTRONAME}-${DISTRO_VERSION}.htm #else # rm -f usr/share/doc/release-skeleton.htm } if test ! -e usr/share/doc/release-${cutDISTRONAME}-${RIGHTVER}.htm{ ln -s release-${cutDISTRONAME}-${DISTRO_VERSION}.htm usr/share/doc/release-${cutDISTRONAME}-${RIGHTVER}.htm } # write extra stuff for release notes source etc/DISTRO_SPECS if test -f ../../support/release_extras/"${DISTRO_FILE_PREFIX}.htm"{ echo "Customising ${cutDISTRONAME}-${DISTRO_VERSION}.htm" test -f /tmp/release.htm && rm /tmp/release.*m setvar ctrl = '0' while read htmline{ if test $ctrl -lt 45{ # must be updated if the skeleton released notes are altered echo $htmline >> /tmp/release.htm } else { echo $htmline >> /tmp/release.bottom } setvar ctrl = $(($ctrl + 1)) } < usr/share/doc/release-${cutDISTRONAME}-${DISTRO_VERSION}.htm cat "../../support/release_extras/${DISTRO_FILE_PREFIX}.htm" >> /tmp/release.htm sed -i "s/DISTRO_VERSION/$DISTRO_VERSION/g" /tmp/release.htm cat /tmp/release.bottom >> /tmp/release.htm cp -af /tmp/release.htm usr/share/doc/release-${cutDISTRONAME}-${DISTRO_VERSION}.htm } #ln -snf release-${cutDISTRONAME}-${DISTRO_VERSION}.htm usr/share/doc/release-notes.htm #120225 #echo "The default kernel for Puppy is vmlinuz." echo -n "vmlinuz" > /tmp/vmlinuzforpup.txt #note, createpuppy will read this. #120818 now have /etc/xdg in Woof, taken out of xdg_puppy PET, relocated pinstall.sh to here... #this code is to fix the icewm menu... if test -f ./etc/xdg/templates/_root_.icewm_menu{ if test $(find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name evilwm) = ""{ grep -v ' evilwm$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/ } if test $(find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name fluxbox) = ""{ grep -v ' fluxbox$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/ } if test $(find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name fvwm95) = ""{ grep -v ' fvwm95$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/ } if test $(find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name jwm) = ""{ grep -v ' jwm$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/ } if test $(find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name pwm) = ""{ grep -v ' pwm$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/ } if test $(find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name xfce4-session) = ""{ grep -v ' xfce4-session$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/ } } #screenshot setvar TAS = $(find usr/bin usr/sbin usr/local/bin -name tas) setvar SCREENY = $(find usr/bin usr/sbin -name 'screeny) if test $TAS{ echo '#!/bin/sh exec tas' > usr/local/bin/defaultscreenshot chmod 755 usr/local/bin/defaultscreenshot setvar SCR = 'tas' } elif test $SCREENY{ echo '#!/bin/sh exec screeny' > usr/local/bin/defaultscreenshot chmod 755 usr/local/bin/defaultscreenshot setvar SCR = 'screeny' } else { echo '#!/bin/sh exec mtpaint -s' > usr/local/bin/defaultscreenshot chmod 755 usr/local/bin/defaultscreenshot setvar SCR = ""mtpaint -s"" } echo "Setting $SCR as defaultscreenshot app" #end#