digitalmars.D - linux install script
- BCS (43/43) Jun 20 2007 I wrote a script that downloads and installs dmd on linux
- BCS (2/6) Jun 21 2007 I forgot to point out: the script should be run as root
- Bruno Medeiros (68/71) Jun 23 2007 Let me share my install script for Windows as well. It downloads the
- Tom Demmer (7/8) Jun 23 2007 [...]
- BCS (3/14) Jun 25 2007 interesting, could you be more specific (OS/ver/etc). I got the FTP part...
- Tom Demmer (8/25) Jun 25 2007 ubuntu 7.04 with direct connection to the Inet. I did not try with my co...
- BCS (6/32) Jun 25 2007 I was hoping to not change any non D settings and have it just work. I h...
- Daniel Giddings (4/42) Jun 25 2007 If it's any help you can also access it via http.
- Dejan Lekic (2/2) Jun 26 2007 I wrote similar script centuries ago, and is still available on http://d...
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
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
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
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
Reply to Tom,BCS Wrote: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.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 25 2007
BCS Wrote:Reply to Tom,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 TomBCS Wrote: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.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 25 2007
Reply to Tom,BCS Wrote: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.Reply to Tom,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 TomBCS Wrote: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.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 25 2007
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: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.Reply to Tom,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 TomBCS Wrote: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.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 25 2007
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