1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
|
#!/bin/sh
rm -f src/*.o src/custom.h src/evilvte.h src/install.sh src/uninstall.sh
DO_SED=sed
DO_ECHO=echo
prefix="/usr/local"
CONF_FILE="src/config.h"
for opt do
case "$opt" in
--quiet) DO_SED=true
DO_ECHO=true
;;
--prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
;;
--config=*) CONF_FILE=`echo $opt | cut -d '=' -f 2`
;;
*) echo
echo " Options: --prefix=/usr/local (default)"
echo " --prefix=/usr"
echo
echo " --config=src/config.h (default)"
echo ' --config=$HOME/.config/evilvte/config.h'
echo
exit
;;
esac
done
if [ ! -e $CONF_FILE ] || [ -d $CONF_FILE ]; then
$DO_ECHO
$DO_ECHO "[1m[31mWARNING:[m parsing error: $CONF_FILE"
HOME_ERR=`echo $CONF_FILE | grep '~'`
if [ "$HOME_ERR" != "" ]; then
$DO_ECHO ' Please do not use "~".'
else
$DO_ECHO " Please make sure your configuration file is correct."
fi
$DO_ECHO
exit
fi
PROG=`grep PROGRAM_NAME $CONF_FILE | grep -v ^\/\/ | awk '{print $3}'`
if [ "$PROG" = "" ]; then
PROG=evilvte
fi
SUSE_LD=`ld -v 2>&1 | tr A-Z a-z | grep suse`
if [ "$SUSE_LD" != "" ]; then
SUSE_DETECTED=TRUE
echo \#define DEF_TAB_LABEL 1 >> src/config.o
else
SUSE_DETECTED=FALSE
fi
ARCH_UNAME=`uname -a | grep -- '-ARCH '`
if [ "$ARCH_UNAME" != "" ]; then
ARCH_DETECTED=TRUE
echo \#define DEF_TAB_LABEL 1 >> src/config.o
else
ARCH_DETECTED=FALSE
fi
GNU_GOLD=`ld -v | tr A-Z a-z | tr -s ' ' ' ' | grep 'gnu gold'`
if [ "$GNU_GOLD" != "" ]; then
LDLIBS="-L/usr/local/lib -lvte -lgtk-x11-2.0 -lgdk-x11-2.0 -lgobject-2.0 -lglib-2.0 -lgdk_pixbuf-2.0"
else
LDLIBS="-L/usr/local/lib -lvte"
fi
VTEINC=`pkg-config --cflags vte`
if [ $? != 0 ]; then
exit
else
$DO_ECHO
$DO_ECHO Prefix: [1m[33m$prefix[m
$DO_ECHO [1m[33mSUSE system detected[m $SUSE_DETECTED | sed 's/TRUE//' | grep -v FALSE$
$DO_ECHO [1m[33mArch Linux detected[m $ARCH_DETECTED | sed 's/TRUE//' | grep -v FALSE$
$DO_ECHO -n "Configuration: "
DEFINE_LINES=`sed 's/\t/ /g' $CONF_FILE | tr -s ' ' ' ' | sed -e 's/^ //' -e 's~/\*~\n~g' | grep ^\#define | wc -l`
if [ "$DEFINE_LINES" = "0" ]; then
$DO_ECHO [1m[31mDisable everything.[m
else
$DO_ECHO
fi
$DO_SED 's/\t/ /g' $CONF_FILE | tr -s ' ' ' ' | sed 's/^ //' | grep ^\#define | sed 's~/\*~\n~g' | grep -v \*\/ | \
sed -e 's/$/[m/' \
-e 's/"/[1m[32m"/' \
-e 's/ 0/[1m[32m 0/' \
-e 's/ 1/[1m[32m 1/' \
-e 's/ 2/[1m[32m 2/' \
-e 's/ 3/[1m[32m 3/' \
-e 's/ 4/[1m[32m 4/' \
-e 's/ 5/[1m[32m 5/' \
-e 's/ 6/[1m[32m 6/' \
-e 's/ 7/[1m[32m 7/' \
-e 's/ 8/[1m[32m 8/' \
-e 's/ 9/[1m[32m 9/' \
-e 's/TRUE/[1m[32mTRUE/' \
-e 's/FALSE/[1m[31mFALSE/' \
-e 's/ AUTO/[1m[32m AUTO/' \
-e 's/ ERASE_TTY/[1m[32m ERASE_TTY/' \
-e 's/ BLOCK/[1m[32m BLOCK/' \
-e 's/ IBEAM/[1m[32m IBEAM/' \
-e 's/ UNDERLINE/[1m[32m UNDERLINE/' \
-e 's/ BACKSPACE/[1m[32m BACKSPACE/g' \
-e 's/BACKSPACE_KEY/[mBACKSPACE_KEY/' \
-e 's/ DELETE/[1m[32m DELETE/g' \
-e 's/DELETE_KEY/[mDELETE_KEY/' \
-e 's/ VTE_FIXED/[1m[32m VTE_FIXED/' \
-e 's/ LINUX/[1m[32m LINUX/' \
-e 's/ RXVT/[1m[32m RXVT/' \
-e 's/ TANGO/[1m[32m TANGO/' \
-e 's/ XTERM/[1m[32m XTERM/' \
-e 's/ g_/[1m[32m g_/' \
-e 's/ RIGHT/[1m[32m RIGHT/' \
-e 's/ LEFT/[1m[32m LEFT/' \
-e 's/ TOP/[1m[32m TOP/' \
-e 's/ BOTTOM/[1m[32m BOTTOM/' \
-e 's/ CTRL /[1m[32m CTRL /'
$DO_ECHO
$DO_ECHO Please edit [1m[33m$CONF_FILE[m to customize your options.
$DO_ECHO
fi
bindir=$prefix/bin
mandir=$prefix/share/man/man1
deskdir=$prefix/share/applications
ICON_DIR=$prefix/share/pixmaps
GNOME_DEF_APP=$prefix/share/gnome-control-center/default-apps
EVILVTE_VERSION=`head -n 1 ChangeLog`
echo "VTEINC=$VTEINC" >> src/config.o
echo "prefix=$prefix" >> src/config.o
echo "bindir=\$(DESTDIR)$bindir" >> src/config.o
echo "mandir=\$(DESTDIR)$mandir" >> src/config.o
echo "deskdir=\$(DESTDIR)$deskdir" >> src/config.o
echo \#define ICON_DIR '"'$ICON_DIR'"' >> src/config.o
echo "ICON_DIR_INSTALL=\$(DESTDIR)$ICON_DIR" >> src/config.o
echo "GNOME_DEF_APP=\$(DESTDIR)$GNOME_DEF_APP" >> src/config.o
echo "LDLIBS=$LDLIBS" >> src/config.o
echo "PROG=$PROG" >> src/config.o
echo \#define EVILVTE_VERSION '"'$EVILVTE_VERSION'"' >> src/config.o
echo "CONF_FILE=$CONF_FILE" >> src/config.o
head -n 1 $0 > src/uninstall.sh
echo "echo rm -f $bindir/$PROG" >> src/uninstall.sh
echo "rm -f $bindir/$PROG" >> src/uninstall.sh
echo "echo rm -f $bindir/showvte" >> src/uninstall.sh
echo "rm -f $bindir/showvte" >> src/uninstall.sh
echo "echo rm -f $deskdir/evilvte.desktop" >> src/uninstall.sh
echo "rm -f $deskdir/evilvte.desktop" >> src/uninstall.sh
echo "echo rm -f $GNOME_DEF_APP/evilvte.xml" >> src/uninstall.sh
echo "rm -f $GNOME_DEF_APP/evilvte.xml" >> src/uninstall.sh
echo "echo rm -f $mandir/evilvte.1" >> src/uninstall.sh
echo "rm -f $mandir/evilvte.1" >> src/uninstall.sh
echo "echo rm -f $mandir/showvte.1" >> src/uninstall.sh
echo "rm -f $mandir/showvte.1" >> src/uninstall.sh
echo "echo rm -f $ICON_DIR/evilvte.png" >> src/uninstall.sh
echo "rm -f $ICON_DIR/evilvte.png" >> src/uninstall.sh
echo "echo rmdir $ICON_DIR" >> src/uninstall.sh
echo "rmdir $ICON_DIR" >> src/uninstall.sh
echo "echo rmdir $mandir" >> src/uninstall.sh
echo "rmdir $mandir" >> src/uninstall.sh
echo "echo rmdir $prefix/share/man" >> src/uninstall.sh
echo "rmdir $prefix/share/man" >> src/uninstall.sh
echo "echo rmdir $GNOME_DEF_APP" >> src/uninstall.sh
echo "rmdir $GNOME_DEF_APP" >> src/uninstall.sh
echo "echo rmdir $prefix/share/gnome-control-center" >> src/uninstall.sh
echo "rmdir $prefix/share/gnome-control-center" >> src/uninstall.sh
echo "echo rmdir $deskdir" >> src/uninstall.sh
echo "rmdir $deskdir" >> src/uninstall.sh
echo "echo rmdir $prefix/share" >> src/uninstall.sh
echo "rmdir $prefix/share" >> src/uninstall.sh
echo "echo rmdir $bindir" >> src/uninstall.sh
echo "rmdir $bindir" >> src/uninstall.sh
echo "echo rmdir $prefix" >> src/uninstall.sh
echo "rmdir $prefix" >> src/uninstall.sh
echo "true" >> src/uninstall.sh
|