www.digitalmars.com         C & C++   DMDScript  

D - linux install script

reply beltorak <beltorak_member pathlink.com> writes:
I hate to nitpick about something that seems trivial, but the linux installation
instructions leave a little to be desired.  I propose including the following
bash script (at the end of this message) to the zip file.  Installation
instructions would then be:
1. chmod +x ./install.bash
2. (as root) ./install.bash

This would install the libraries, sources, and config file as well as the html
documentation and samples.

Also, including the command syntax help in the compiler executable would be a
great boon, as well as versioning the compiler, just for the sake of keeping the
release executables and libraries managable.  Versioning the releases allows
using a package creation tool (like checkinstall) to keep track of all the files
for removal or updating when the next release comes out.  The version I settled
on was the date stamp of the compiler as found in the zip file (21 Jan 2004).

I would also like to have the dmd directory (in the zip file) labeled with the
release (ie: dmd-24jan04), and all the files and directories kept there.

Thanks for the great work on it; I am enjoying it so far :)

-t.

---- bash script follows ----




PREFIX=/usr/local
RELEASE=21jan04
PKG=dmd-$RELEASE

echo Creating Directories
/bin/mkdir -p -m 0755 $PREFIX/doc/$PKG
/bin/mkdir -p -m 0755 $PREFIX/share/$PKG/samples
/usr/bin/find src -type d \
| while read DIR; do
/bin/mkdir -p -m 0755 $PREFIX/share/$PKG/$DIR
done
echo Done.

echo Installing Documentation
/usr/bin/find html/d -type f \
| while read DOCFILE; do
/usr/bin/ginstall -m 0644 $DOCFILE $PREFIX/doc/$PKG
done

echo Installing Binaries
for BIN in dmd obj2asm dumpobj; do
/usr/bin/ginstall -m 0755 bin/$BIN $PREFIX/bin
done

echo Installing Libraries and Sources
/usr/bin/ginstall -m 0644 lib/libphobos.a $PREFIX/lib
/usr/bin/find src -type f \
| while read D_SRC; do
/usr/bin/ginstall -m 0644 $D_SRC $(dirname $PREFIX/share/$PKG/$D_SRC)
done
/usr/bin/find samples/d -type f \
| while read SAMPLE; do
/usr/bin/ginstall $SAMPLE $PREFIX/share/$PKG/samples
done

echo Installing config file
echo <HERE >bin/dmd.conf

[Environment]

; Path to phobos sources
DFLAGS=-I$PREFIX/share/$PKG/src/phobos

HERE

/usr/bin/ginstall -m 0644 bin/dmd.conf /etc

echo Done.

---- end script ----
Feb 11 2004
parent beltorak <beltorak_member pathlink.com> writes:
In the bash script, the following line:
echo <HERE >bin/dmd.conf

should be replaced with:
cat<<HERE >bin/dmd.conf

sorry bout that.
Feb 17 2004