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 :)


---- bash script follows ----
#! /bin/bash
# Digital Mars D Languge Compiler installation script
# May need some fine tuning


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
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

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

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)
/usr/bin/find samples/d -type f \
| while read SAMPLE; do
/usr/bin/ginstall $SAMPLE $PREFIX/share/$PKG/samples

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


; Path to phobos sources


/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