source: MondoRescue/branches/stable/mindi/install.sh@ 471

Last change on this file since 471 was 471, checked in by bcornec, 18 years ago

typo in mindi's install.sh

  • Property svn:keywords set to Id
File size: 4.5 KB
RevLine 
[179]1#!/bin/bash
[1]2
3if [ ! -f "mindi" ] ; then
4 echo "Please 'cd' to the directory you have just untarred." >> /dev/stderr
5 exit 1
6fi
[179]7
[184]8if [ "_$PREFIX" != "_" ]; then
[235]9 local=$PREFIX
[179]10 if [ -f /usr/local/sbin/mindi ]; then
11 echo "WARNING: /usr/local/sbin/mindi exists. You should probably remove it !"
12 fi
[235]13 conf=$CONFDIR/mindi
[185]14 echo $PATH | grep /usr/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add /usr/sbin to your PATH."
[179]15else
16 local=/usr/local
17 if [ -f /usr/sbin/mindi ]; then
18 echo "WARNING: /usr/sbin/mindi exists. You should probably remove the mindi package !"
19 fi
20 conf=$local/etc/mindi
[185]21 echo $PATH | grep $local/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add $local/sbin to your PATH."
[179]22fi
23
[1]24if uname -a | grep Knoppix > /dev/null || [ -e "/ramdisk/usr" ] ; then
25 local=/ramdisk/usr
26 export PATH=/ramdisk/usr/sbin:/ramdisk/usr/bin:/$PATH
27fi
28
[237]29MINDIVER=`cat VERSION`
[243]30MINDIREV=`cat REVISION`
31echo "mindi ${MINDIVER}-r${MINDIREV} will be installed under $local"
[179]32
[248]33DOCDIR=$local/share/doc/mindi-$MINDIVER
34MANDIR=$local/share/man/man8
[241]35
[306]36ARCH=`/bin/arch`
37echo $ARCH | grep -x "i[0-9]86" &> /dev/null && ARCH=i386 && locallib=$local/lib
38# For the moment, we don't build specific x86_64 busybox binaries
39echo $ARCH | grep -x "x86_64" &> /dev/null && ARCH=i386 && locallib=$local/lib64
40export ARCH
41
[179]42echo "Creating target directories ..."
[454]43install -m 755 -d $conf $conf/deplist.d $locallib/mindi $MANDIR $local/sbin $DOCDIR
[1]44
[179]45echo "Copying files ..."
[306]46install -m 644 isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg syslinux.cfg syslinux-H.cfg dev.tgz $locallib/mindi
[237]47install -m 644 deplist.txt $conf
[454]48install -m 644 distributions/conf/deplist.d/* $conf/deplist.d
49install -m 755 distributions/conf/mindi.conf $conf
[235]50
[311]51cp -af rootfs aux-tools $locallib/mindi
[306]52chmod 755 $locallib/mindi/rootfs/bin/*
53chmod 755 $locallib/mindi/rootfs/sbin/*
54chmod 755 $locallib/mindi/aux-tools/sbin/*
[449]55chmod 755 $conf/mindi.conf
[1]56
[179]57if [ "$RPMBUILDMINDI" = "true" ]; then
[243]58 sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=/usr~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=/etc/mindi~" -e "s~^MINDI_VER=VVV~MINDI_VER=$MINDIVER~" -e "s~^MINDI_REV=RRR~MINDI_REV=$MINDIREV~" mindi > $local/sbin/mindi
[179]59else
[243]60 sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$local~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$conf~" -e "s~^MINDI_VER=VVV~MINDI_VER=$MINDIVER~" -e "s~^MINDI_REV=RRR~MINDI_REV=$MINDIREV~" mindi > $local/sbin/mindi
[179]61fi
62chmod 755 $local/sbin/mindi
[237]63install -m 755 analyze-my-lvm parted2fdisk.pl $local/sbin
[179]64
[248]65install -m 644 mindi.8 $MANDIR
[315]66install -m 644 ChangeLog COPYING README README.busybox README.ia64 README.pxe TODO INSTALL svn.log $DOCDIR
[179]67
[235]68# Managing busybox
[306]69if [ -f $locallib/mindi/rootfs/bin/busybox-$ARCH ]; then
[179]70 echo "Installing busybox ..."
[306]71 install -s -m 755 $locallib/mindi/rootfs/bin/busybox-$ARCH $locallib/mindi/rootfs/bin/busybox
[179]72else
73 echo "WARNING: no busybox found, mindi will not work on this arch ($ARCH)"
74fi
[1]75if [ "$ARCH" = "i386" ] ; then
[306]76 if [ -f $locallib/mindi/rootfs/bin/busybox-$ARCH.net ]; then
[179]77 echo "Installing busybox.net ..."
[306]78 install -s -m 755 $locallib/mindi/rootfs/bin/busybox-$ARCH.net $locallib/mindi/rootfs/bin/busybox.net
[179]79 else
80 echo "WARNING: no busybox.net found, mindi will not work on this arch ($ARCH) with network"
81 fi
[1]82fi
[235]83# Remove left busybox
[306]84rm -f $locallib/mindi/rootfs/bin/busybox-*
[179]85
[235]86# Managing parted2fdisk
[1]87if [ "$ARCH" = "ia64" ] ; then
[235]88 (cd $local/sbin && ln -sf parted2fdisk.pl parted2fdisk)
[306]89 make -f Makefile.parted2fdisk DEST=$locallib/mindi install
90 if [ -f $locallib/mindi/rootfs/sbin/parted2fdisk-$ARCH ]; then
[179]91 echo "Installing parted2fdisk ..."
[306]92 install -s -m 755 $locallib/mindi/rootfs/sbin/parted2fdisk-$ARCH $locallib/mindi/rootfs/sbin/parted2fdisk
93 install -s -m 755 $locallib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/sbin/parted2fdisk
[179]94 else
95 echo "WARNING: no parted2fdisk found, mindi will not work on this arch ($ARCH)"
96 fi
[1]97else
[235]98 # FHS requires fdisk under /sbin
99 (cd $local/sbin && ln -sf /sbin/fdisk parted2fdisk)
[179]100 echo "Symlinking fdisk to parted2fdisk"
[306]101 ( cd $locallib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
[1]102fi
[235]103# Remove left parted2fdisk
[306]104rm -f $locallib/mindi/rootfs/sbin/parted2fdisk-*
[179]105
[237]106if [ "$RPMBUILDMINDI" != "true" ]; then
[306]107 chown -R root:root $locallib/mindi $conf $DOCDIR
[248]108 chown root:root $local/sbin/mindi $MANDIR/mindi.8 $local/sbin/analyze-my-lvm $local/sbin/parted2fdisk.pl
[237]109 if [ "$ARCH" = "ia64" ] ; then
110 chown root:root $local/sbin/parted2fdisk
111 fi
112fi
113
[466]114# Special case for SuSE family where doc is put elsewhere in the RPM
[471]115if [ _"$dfam" = _"suse" ]; then
[460]116 rm -rf $DOCDIR
117fi
118
[1]119exit 0
Note: See TracBrowser for help on using the repository browser.