www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - linux install script

reply BCS <BCS pathlink.com> writes:
I wrote a script that downloads and installs dmd on linux

here it is for whatever it's worth:


ftp << E
open ftp.digitalmars.com
binary
get dmd.zip
bye
E


rm -rf dmd/


unzip -o -q dmd.zip


MAND=` man -w | sed  "s/:.*//"`


DMDVER=`dmd | grep Comp | sed "s/.*v//"`








cp dmd/bin/dmd /usr/bin/dmd
chmod 755 /usr/bin/dmd


cp dmd/lib/libphobos.a /usr/lib/libphobos.a
chmod 644 /usr/lib/libphobos.a


cp -r dmd/src/phobos /usr/include/phobos
chmod 755 /usr/include/phobos
find /usr/include/phobos -type d -exec chmod 755 "{}" ";"
find /usr/include/phobos -type f -exec chmod 644 "{}" ";"


cp dmd/man/man1/dmd.1 $MAND/man1/dmd.1
chmod 644 $MAND/man1/dmd.1









Jun 20 2007
next sibling parent BCS <ao pathlink.com> writes:
Reply to BCS,

 I wrote a script that downloads and installs dmd on linux
 
 here it is for whatever it's worth:
 
I forgot to point out: the script should be run as root
Jun 21 2007
prev sibling next sibling parent Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
BCS wrote:
 I wrote a script that downloads and installs dmd on linux
 
 here it is for whatever it's worth:
Let me share my install script for Windows as well. It downloads the latest dmd, unpacks it, copies the previous DMD version to an archive dir, and does a diff of the html doc. It requires MINGW/CYGWIN and tools like wget, grep, unzip, diff. I could improve this script (to clean some trivial html doc differences) if I knew a way to do multi-line regexp substitutions. What I know of sed only does substitutions inside each line. ------------------------------ DMDARCHIVEDIR="dmd-archive" DMDINSTALLDIR="." DMDBASEURL="http://www.digitalmars.com/d" #DMDBASEURL="http://www.digitalmars.com/d/1.0" wget -nv $DMDBASEURL/changelog.html -O changelog.html URLKEY="ftp.digitalmars.com/dmd\.[1-4].[0-9][0-9][0-9]\.zip" DMDURL=`grep -G -o "$URLKEY" changelog.html | line -n 1` rm changelog.html #DMDURL=ftp.digitalmars.com/dmd.1.011.zip echo ">>" DMDURL: $DMDURL DMDVER=`echo $DMDURL | grep -G -o "[1-4].[0-9][0-9][0-9]"` DMDVERMAJOR=`echo $DMDVER | grep -G -o "[1-4]\\."` DMDVERMINOR=`echo $DMDVER | grep -G -o "[0-9][0-9][0-9]"` DMDVEROLD=`$DMDINSTALLDIR/dmd/bin/dmd | grep Compiler | sed "s/.*v//"` echo ">>" DMDVER: $DMDVER Major: $DMDVERMAJOR Minor: $DMDVERMINOR DMDVEROLD: $DMDVEROLD wget -nv http://$DMDURL -O dmd.$DMDVER.zip mkdir -p $DMDARCHIVEDIR/dmd-$DMDVER unzip -o -q "dmd.$DMDVER.zip" -d $DMDARCHIVEDIR/dmd-$DMDVER rm -R $DMDINSTALLDIR/dmd unzip -o -q "dmd.$DMDVER.zip" -d $DMDINSTALLDIR rm "dmd.$DMDVER.zip" if grep -q CYGWIN <<< `uname`; then echo ">>" Doing Windows fix for cygwin/mingw shells rm $DMDINSTALLDIR/dmd/bin/dmd rm $DMDINSTALLDIR/dmd/bin/rdmd rm $DMDINSTALLDIR/dmd/bin/obj2asm fi; DMDVERMINOR_NOZEROES=`sed -e "s/^0\+/ /" <<< $DMDVERMINOR` DMDVERPREV=$DMDVERMAJOR`printf %03i $[DMDVERMINOR_NOZEROES-1]` #DMDVEROLD=DMDVERPREV echo ">>" Generating diff for $DMDVEROLD "->" $DMDVER DOCDIRNEW=$DMDARCHIVEDIR/dmd-$DMDVER/dmd/html/d DOCDIROLD=$DMDARCHIVEDIR/dmd-$DMDVEROLD/dmd/html/d echo ">>" Running diff -ruN $DOCDIROLD $DOCDIRNEW echo ">> Output: >" "$DMDARCHIVEDIR/dmd-$DMDVEROLD-$DMDVER.diff.txt" diff -ruN $DOCDIROLD $DOCDIRNEW > "$DMDARCHIVEDIR/dmd-$DMDVEROLD-$DMDVER.diff.txt" .*\n.*\n.*\n.*\n-.*lastupdate.*\n\+.*lastupdate.*\n.*\n.*\n.*\n #Index: .*\n=====.*\n---.*\n\+\+\+.*\nIndex Language.*\n+.*D Programming Language 1.0.*\n.*\n.*\n.*\n -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Jun 23 2007
prev sibling next sibling parent reply Tom Demmer <t_demmer web.de> writes:
BCS Wrote:

 I wrote a script that downloads and installs dmd on linux
[...] Neat, but the ftp part does not work for me because my client does not send "ftp" "tdemmer ". So I replaced the part by the line wget ftp://ftp.digitalmars.com/dmd.zip Ciao Tom
Jun 23 2007
parent reply BCS <ao pathlink.com> writes:
Reply to Tom,

 BCS Wrote:
 
 I wrote a script that downloads and installs dmd on linux
 
[...] Neat, but the ftp part does not work for me because my client does not send "ftp" "tdemmer ". So I replaced the part by the line wget ftp://ftp.digitalmars.com/dmd.zip Ciao Tom
interesting, could you be more specific (OS/ver/etc). I got the FTP part working only after the wget version didn't work on the machine I wrote it on.
Jun 25 2007
parent reply Tom Demmer <t_demmer web.de> writes:
BCS Wrote:

 Reply to Tom,
 
 BCS Wrote:
 
 I wrote a script that downloads and installs dmd on linux
 
[...] Neat, but the ftp part does not work for me because my client does not send "ftp" "tdemmer ". So I replaced the part by the line wget ftp://ftp.digitalmars.com/dmd.zip Ciao Tom
interesting, could you be more specific (OS/ver/etc). I got the FTP part working only after the wget version didn't work on the machine I wrote it on.
ubuntu 7.04 with direct connection to the Inet. I did not try with my company laptop, with Cygwin on it. But normally wget allows for whatever parameters you need. I can even wget through the company firewall via the conpany firewall over http. If you want to, I can dig out the parameters for the proxy to put into the .wgetrc file. Ciao Tom
Jun 25 2007
parent reply BCS <ao pathlink.com> writes:
Reply to Tom,

 BCS Wrote:
 
 Reply to Tom,
 
 BCS Wrote:
 
 I wrote a script that downloads and installs dmd on linux
 
[...] Neat, but the ftp part does not work for me because my client does not send "ftp" "tdemmer ". So I replaced the part by the line wget ftp://ftp.digitalmars.com/dmd.zip Ciao Tom
interesting, could you be more specific (OS/ver/etc). I got the FTP part working only after the wget version didn't work on the machine I wrote it on.
ubuntu 7.04 with direct connection to the Inet. I did not try with my company laptop, with Cygwin on it. But normally wget allows for whatever parameters you need. I can even wget through the company firewall via the conpany firewall over http. If you want to, I can dig out the parameters for the proxy to put into the .wgetrc file. Ciao Tom
I was hoping to not change any non D settings and have it just work. I have a new version on dsource under: http://svn.dsource.org/projects/scrapple/trunk/scripts/dmd_update this might (should) work. If you will test the first bit and tell me I would be grateful.
Jun 25 2007
parent Daniel Giddings <danielg microforte.com> writes:
If it's any help you can also access it via http.

wget http://ftp.digitalmars.com/dmd.zip

:-) Dan

BCS wrote:
 Reply to Tom,
 
 BCS Wrote:

 Reply to Tom,

 BCS Wrote:

 I wrote a script that downloads and installs dmd on linux
[...] Neat, but the ftp part does not work for me because my client does not send "ftp" "tdemmer ". So I replaced the part by the line wget ftp://ftp.digitalmars.com/dmd.zip Ciao Tom
interesting, could you be more specific (OS/ver/etc). I got the FTP part working only after the wget version didn't work on the machine I wrote it on.
ubuntu 7.04 with direct connection to the Inet. I did not try with my company laptop, with Cygwin on it. But normally wget allows for whatever parameters you need. I can even wget through the company firewall via the conpany firewall over http. If you want to, I can dig out the parameters for the proxy to put into the .wgetrc file. Ciao Tom
I was hoping to not change any non D settings and have it just work. I have a new version on dsource under: http://svn.dsource.org/projects/scrapple/trunk/scripts/dmd_update this might (should) work. If you will test the first bit and tell me I would be grateful.
Jun 25 2007
prev sibling parent Dejan Lekic <dejan.lekic gmail.com> writes:
I wrote similar script centuries ago, and is still available on
http://dejan.lekic.googlepages.com/install-dmd . I use it regularly for
installing DMD on any GNU/Linux. I did not try it on some UNIX, but I guess it
will work. The script knows what to do when root executes it (it does
system-wide installation of DMD), and also when user executes it (it installs
DMD inside users HOME, and sets up DFLAGS).

Kind regards
Jun 26 2007