Skip to content

Instantly share code, notes, and snippets.

Created September 12, 2016 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/d494a0b60c5ac400f1ed3d9a542da101 to your computer and use it in GitHub Desktop.
Save anonymous/d494a0b60c5ac400f1ed3d9a542da101 to your computer and use it in GitHub Desktop.
#!/bin/sh
########################
# NOTES:
#
########################
# Golded+ Fido Editor pakage for Slamd64
# Download latest verison of and remame in bottom in unzip
# You could do it automatically if uncomment this line:
# wget -c http://superb-east.dl.sourceforge.net/sourceforge/golded-plus/gps70503.tb2
# Correct GoldEd+ zip file name if you would like fresh version
# fetch latest snapshot of sourses from http://golded-plus.sourceforge.net/download.html
# Depens on character set conversion library libiconv version 1.11_1 or highest.
########################
# Set initial variables:
NAME=golded # Program name
PNAME=golded # Package name (Useful for changing case, removing "-"s, etc.)
VERSION=1.1.5-b # Program version
PVERSION= # Package version (Useful for removing "-"s, CVS builds, etc.)
ARCH=${ARCH:-x86_64} # Package architecture
BUILD=${BUILD:-fido_my1} # Build number plus packager initials (use your own)
ZIPNAME=gps90710.tb2
CWD=`pwd`
TMP="/tmp" # Location to compile the source
PKG=$TMP/package-$NAME # Location to build the package (use "package-$NAME" to avoid poss. conflicts)
PDOC="$TMP/golded+/docs/*"
date=`date +%Y%m%d`
shortdate=`echo ${date} | sed s/^...//`
shortname=$TMP/gpl${shortdate}.zip
# Define compiler flags based on intended architecture:
# Can easily expand this for alternate compilations
if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mcpu=i686"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
fi
rm -rf $PKG
mkdir -p /usr/local
mkdir -p /usr/local/bin
mkdir -p /usr/local/sbin
mkdir -p /usr/local/etc
mkdir -p /usr/local/etc/golded+
mkdir -p /usr/local/etc/fidoip
cd $TMP
rm -rf $TMP/golded+
# Correct GoldEd+ zip file name if you are using fresh version.
tar -xjpf $CWD/$ZIPNAME
cd $TMP/golded+
./dist-gpl.sh
./dist-gpl.sh
# Create package docs:
# Probably should define the package documentation with
# a variable ($PDOCS) up top and replace the names with it
mkdir -p /usr/local/doc/$PNAME-$VERSION
cp -a $PDOC /usr/local/doc/$PNAME-$VERSION/
chmod 644 /usr/local/doc/$PNAME-$VERSION/*
if [ -e $CWD/decode.txt ]; then
cat $CWD/decode.txt > /usr/local/etc/fidoip/decode.txt.template
cat $CWD/decode.txt > /usr/local/etc/golded+/golded.cfg
fi
if [ -e $CWD/goldhelp.cfg ]; then
mkdir -p /usr/local/etc
mkdir -p /usr/local/etc/golded+
cat $CWD/goldhelp.cfg > /usr/local/etc/golded+/goldhelp.cfg
fi
if [ -e $CWD/goldkeys.cfg ]; then
mkdir -p /usr/local/etc
mkdir -p /usr/local/etc/golded+
cat $CWD/goldkeys.cfg > /usr/local/etc/golded+/goldkeys.cfg
fi
if [ -e $CWD/goldlang.cfg ]; then
mkdir -p /usr/local/etc
mkdir -p /usr/local/etc/golded+
cat $CWD/goldlang.cfg > /usr/local/etc/golded+/goldlang.cfg
fi
if [ -e $CWD/gedcolor.cfg ]; then
mkdir -p /usr/local/etc
mkdir -p /usr/local/etc/golded+
cat $CWD/gedcolor.cfg > /usr/local/etc/golded+/gedcolor.cfg
fi
if [ -e $CWD/golded.tpl ]; then
mkdir -p /usr/local/etc
mkdir -p /usr/local/etc/golded+
cat $CWD/golded.tpl > /usr/local/etc/golded+/golded.tpl
fi
# Add log for golded+:
mkdir -p /home/fido
cat $CWD/golded.log > /home/fido/golded.log
if [ -e $CWD/ge ]; then
mkdir -p /usr/local/bin
cp -p $CWD/ge /usr/local/bin/
fi
if [ -e $CWD/g ]; then
mkdir -p /usr/local/bin
cp -p $CWD/g /usr/local/bin/
fi
if [ -e $CWD/gl ]; then
mkdir -p /usr/local/bin
cp -p $CWD/gl /usr/local/bin/
fi
mkdir -p /usr/local/etc/golded+
cp -a $TMP/golded+/cfgs /usr/local/etc/golded+/
cp -a $TMP/golded+/bin/* /usr/local/sbin/
cp -a $TMP/golded+/chsgen/* /usr/local/etc/golded+/
if [ -e $CWD/golded.cfm ]; then
cp $CWD/golded.cfm /usr/local/etc/golded+/
fi
if [ -e $CWD/net5020.ndl ]; then
mkdir -p /home/fido
mkdir -p /home/fido/nodelist
cp $CWD/*.ndl /home/fido/nodelist/
cp $CWD/goldnode.* /home/fido/nodelist/
fi
if [ -e $CWD/nodelist.sh ]; then
cat $CWD/nodelist.sh > /usr/local/bin/nodelist.sh
chmod +x /usr/local/bin/nodelist.sh
fi
# Adding fghigetdir directory for downloading messages
mkdir -p /home/fido/fghigetdir
cp $CWD/*.eng /usr/local/etc/fidoip/
cat $CWD/golded.tpl.fghi.disable-template > /usr/local/etc/fidoip/golded.tpl.fghi.disable-template
cat $CWD/golded.tpl > /usr/local/etc/fidoip/golded.tpl
cp $CWD/.screenrc /usr/local/etc/golded+/
# Removing dump staff
rm -f /usr/local/sbin/*.Diz
rm -f /usr/local/sbin/*.txt
# Clean up the extra stuff:
if [ "$1" = "--cleanup" ]; then
rm -rf $PKG
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment