1#!/bin/sh
2# LIC: GPL
3#***********************************************************************
4#
5# go-gui
6#
7# Quick-start shell script to set up PPPoE and GUI wrapper
8#
9# Copyright (C) 2000 Roaring Penguin Software Inc.
10#
11# $Id$
12#***********************************************************************
13
14# GUI only works on Linux
15if test "`uname`" != "Linux" ; then
16    echo "Sorry, the GUI only works on Linux."
17    exit 1
18fi
19
20# Figure out directory of script
21MYDIR=`dirname $0`
22cd $MYDIR/src
23
24echo "Running ./configure..."
25./configure
26if [ "$?" != 0 ] ; then
27    echo "Oops!  It looks like ./configure failed."
28    exit 1
29fi
30
31echo "Running make..."
32make
33if [ "$?" != 0 ] ; then
34    echo "Oops!  It looks like make failed."
35    exit 1
36fi
37
38echo "Running make install..."
39make install
40
41if [ "$?" != 0 ] ; then
42    echo "Oops!  It looks like make install failed."
43    exit 1
44fi
45
46echo "Building GUI wrapper..."
47cd ../gui
48make
49if [ "$?" != 0 ] ; then
50    echo "Oops!  It looks like make failed."
51    exit 1
52fi
53
54echo "Installing GUI..."
55make install
56
57if [ "$?" != 0 ] ; then
58    echo "Oops!  It looks like make install failed."
59    exit 1
60fi
61
62# Install entry in KDE menu
63if test -n "$KDEDIR" ; then
64    echo "Installing KDE menu entry Internet : TkPPPoE..."
65    mkdir -p "$KDEDIR/share/applnk/Internet"
66    cat <<EOF > "$KDEDIR/share/applnk/Internet/tkpppoe.kdelnk"
67# KDE Config File
68[KDE Desktop Entry]
69Name=TkPPPoE
70Comment=Start/Stop PPPoE connections
71Exec=tkpppoe
72Terminal=0
73Type=Application
74EOF
75fi
76
77# Install entry in GNOME menus
78GNOMEDIR=`gnome-config --datadir 2>/dev/null`
79if test -n "$GNOMEDIR" ; then
80    echo "Installing GNOME menu entry Internet : TkPPPoE..."
81    mkdir -p "$GNOMEDIR/gnome/apps/Internet"
82cat <<EOF > "$GNOMEDIR/gnome/apps/Internet/tkpppoe.desktop"
83[Desktop Entry]
84Name=TkPPPoE
85Comment=Start/Stop PPPoE connections
86Exec=tkpppoe
87Terminal=0
88Type=Application
89EOF
90fi
91echo "Running GUI configuration tool..."
92tkpppoe &
93exit 0
94