%pre OLDINSTALL=%{USRLIB64}/linuxconf/help.eng/notices/01-oldinstall INITTABREPLACE=%{USRLIB64}/linuxconf/uninstall/inittab.replace UPGRADE="NO" echo "#### pre install script" >>/tmp/linuxconf-rpminstall.log date >>/tmp/linuxconf-rpminstall.log log(){ echo $* >>/tmp/linuxconf-rpminstall.log $* } # Check for tarball installation if [ -f %{USRLIB64}/linuxconf/conf.daemons ] ; then UPGRADE="YES" fi if [ -f %{USRLIB64}/linuxconf/std/conf.daemons ] ; then UPGRADE="YES" fi # Check for old 1.9r22 RPM installation if [ -f %{USRLIB64}/linuxconf/install/doinst.sh ] ; then UPGRADE="YES" fi if [ $UPGRADE = "YES" ] ; then # Script to upgrade pre-1.9r25 Linuxconf to new SysV compliant booting. # Dale - Hacked in a few minutes late one night :-) echo Upgrading from older install strategy >>/tmp/linuxconf-rpminstall.log # Kill the Install directory if [ -f /install/doinst.sh ] ; then log rm -Rf /install fi # Kill the old %{USRLIB64}/linuxconf directory, the RPM will put # everything we need back in later. log rm -Rf %{USRLIB64}/linuxconf # Create the directories we will need for the upgrade log install -d -g users -m 755 -o root %{USRLIB64}/linuxconf/ log install -d -g users -m 755 -o root %{USRLIB64}/linuxconf/help.eng/notices/ log install -d -g users -m 755 -o root %{USRLIB64}/linuxconf/uninstall/ # Create a note displayed by linuxconf informing that the RPM # install has done some cleanup echo " Installation note" >$OLDINSTALL echo >>$OLDINSTALL echo "The RPM installation has detected that linuxconf was already" >>$OLDINSTALL echo "installed using the tar.gz kit" >>$OLDINSTALL echo >>$OLDINSTALL echo "It has taken action to fix your linuxconf installation" >>$OLDINSTALL echo "so it becomes more compatible with RPM based systems" >>$OLDINSTALL echo >>$OLDINSTALL echo "You may want to check /tmp/linuxconf-rpminstall.log" >>$OLDINSTALL # I put a default RedHat inittab in %{USRLIB64}/linuxconf/install # When I unpack the distro, the original SHOULD be there, but hey, # You never can tell when someone is gonna need that 1k taken up # by the backup.... if [ -f /etc/inittab.old ] ; then log cp /etc/inittab %{USRLIB64}/linuxconf/uninstall/inittab.beforeupgrade log mv -f /etc/inittab.old /etc/inittab #else # Tell the RPM to replace this file with a stock RedHat # We haven't untarred anything yet, so we can't replace it #log cp /etc/inittab %{USRLIB64}/linuxconf/uninstall/inittab.beforeupgrade #log touch $INITTABREPLACE fi if [ -f /etc/rc.d/rc.M ] ; then log mv -f /etc/rc.d/rc.M %{USRLIB64}/linuxconf/uninstall/rc.M.beforeupgrade fi if [ -f /etc/rc.d/rc.sysinit.old ] ; then log mv -f /etc/rc.d/rc.sysinit.old %{USRLIB64}/linuxconf/uninstall/rc.sysinit.beforelinuxconf fi if [ -f /etc/rc.d/rc.old ] ; then log mv -f /etc/rc.d/rc.old %{USRLIB64}/linuxconf/uninstall/rc.beforelinuxconf fi if [ -f /usr/bin/passwd.old ] ; then log mv -f /usr/bin/passwd.old %{USRLIB64}/linuxconf/uninstall/passwd.beforelinuxconf fi if [ -f /usr/sbin/syslogd.old ] ; then log mv -f /usr/bin/syslogd.old %{USRLIB64}/linuxconf/uninstall/syslogd.beforelinuxconf fi if [ -f /etc/conf.linuxconf ] ; then log mv -f /etc/conf.linuxconf /etc/conf.linuxconf-installed fi fi