#!/bin/sh
#
# install script
#
# SYNOPSIS
# ./jslaunch-install-nosysv
#
# installs jslaunch into /usr/local/bin, and the man files into /usr/local/man
#
#  This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
   
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
   
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.



echo "WARNING: this install script will install jslaunch setuid root"
echo "While this is perfectly safe (root permissions will be given up
echo "before shell commands are executed), if you feel bad about other"
echo "users on your system being able to see what joystick buttons are "
echo "being pressed, you should remove the line 'make setuid' from this"
echo "script"

echo make clean
make clean

echo make all
make all

# Comment these lines to not have jslaunch & jstest setuid root
# and uncomment the 'make install' lines
echo "make suid-install"
make suid-install

# echo make install
# make install

echo
echo
echo "Installation done... now do: "
echo
echo "jslaunchd start"
echo
echo "to start the daemon. "
echo "If you want to change the settings you can edit /etc/jslaunchd.conf"
echo "before you run it. Run jstest to determine which button numbers"
echo "correspond to which buttons."
echo
echo "To start jslaunch at boot time add the line"
echo
echo "jslaunchd start"
echo
echo "to /etc/rc.local"
echo
echo "To remove installation, do: "
echo
echo "rm /usr/local/bin/jslaunch"
echo "rm /usr/local/bin/jstest"
echo "rm /usr/local/bin/jslaunchd"
echo "rm /usr/local/man/man1/jslaunch"
echo "rm /usr/local/man/man1/jslaunchd"
echo "rm /usr/local/man/man1/jstest"
echo "rm /etc/jslaunchd.conf"