#!/bin/bash

exe=${1:-ebe}

rm -rf $exe.d

mkdir -p $exe.d

cp $exe $exe.d
#cp ebe.rcc $exe.d

cat > $exe.d/README << EOF1
            Installation instructions for $exe

Select a directory to install $exe and execute the following command
from within this directory:

    sh ./install directory_to_install

This will install a shell script named $exe into the chosen directory
and will copy all required files into another directory named $exe.d
in that same installation directory.  If you leave off the installation
directory name, it will install in /usr/local/bin.
EOF1

cat > $exe.d/install << EOF2
#!/bin/bash

dir=\${1:-/usr/local/bin}
cp * \$dir
chmod a+rx \$dir/$exe
chmod a+r \$dir/*ebe*
EOF2

chmod a+rx $exe.d/install

tar czf $exe.tgz $exe.d
