diff --git a/nix-dist/build+upload.sh b/nix-dist/build+upload.sh deleted file mode 100755 index 7cae11658c8..00000000000 --- a/nix-dist/build+upload.sh +++ /dev/null @@ -1,79 +0,0 @@ -#! /bin/sh - -url="https://svn.cs.uu.nl:12443/repos/trace/nix/trunk/" - -curl="curl --fail --silent --show-error" -# auth-info file should have format `username:password'. -if ! auth_info=$(cat auth-info); then - echo "cannot get authentication info" - exit 1 -fi -curl_up="$curl --user $auth_info" - -rev=$(svn log --quiet --non-interactive "$url" \ - | grep '^r' \ - | sed "s/r\([0-9]*\).*$/\1/" \ - | head -n 1) -if test -z "$rev"; then - echo "cannot fetch head revision number" - exit 1 -fi - -echo "building revision $rev of $url" - -# !!! race -echo $rev > head-revision.nix - -if ! storeexprs=($(nix-instantiate -vv do-it.nix)); then exit 1; fi - -srcexpr=${storeexprs[0]} -testexpr=${storeexprs[1]} -rpmexpr=${storeexprs[2]} - -if ! outpath=$(nix-store -vvvv -qnf "$srcexpr"); then exit 1; fi - -uploader="http://catamaran.labs.cs.uu.nl/~eelco/cgi-bin/create-dist.pl" - -# Extract the name of the release. -relname=$((cd $outpath && echo nix-*.tar.bz2) | sed -e s/.tar.bz2//) -echo "release is $relname" - -# If it already exists on the server, quit. -if ! exists=$($curl_up $uploader/exists/$relname); then - echo "cannot check for existence of $relname on the server" - exit 1 -fi -if test "$exists" = "yes"; then - echo "server already has release $relname" - exit 0 -fi - -# Create an upload session on the server. -if ! sessionname=$($curl_up $uploader/create/$relname); then - echo "cannot create upload session" - exit 1 -fi -echo "session name is $sessionname" - -# Upload the source distribution and the manual. -$curl_up -T "$outpath"/nix-*.tar.bz2 "$uploader/upload/$sessionname/" || exit 1 -$curl_up -T "$outpath"/manual.tar.bz2 "$uploader/upload-tar/$sessionname" || exit 1 - -# Perform a test build. -#if ! nix-store -vvvv -r "$testexpr" > /dev/null; then exit 1; fi - -# Perform an RPM build, and upload the RPM to the server. -if ! rpmpath=$(nix-store -vvvv -qnf "$rpmexpr"); then exit 1; fi -$curl_up -T "$rpmpath"/nix-*.rpm "$uploader/upload/$sessionname/" || exit 1 - -# Finish the upload session. -$curl_up "$uploader/finish/$sessionname" || exit 1 - -# Publish the release on the Wiki. -# !!! create /tmp file -echo -n $relname > relname -$curl_up -T relname "$uploader/put/head-revision" || exit 1 -rm -f $relname - -# Force a refresh of the Wiki. -$curl 'http://www.cs.uu.nl/groups/ST/twiki/bin/fresh/Trace/NixDeploymentSystem' > /dev/null || exit 1 diff --git a/nix-dist/do-it.nix b/nix-dist/do-it.nix deleted file mode 100644 index 0598d02cedc..00000000000 --- a/nix-dist/do-it.nix +++ /dev/null @@ -1,32 +0,0 @@ -let { - system = "i686-linux"; - pkgs = (import ../pkgs/system/all-packages.nix) {system = system;}; - stdenv = pkgs.stdenv_; - - sourcedist = (import ./nix-source-dist.nix) { - stdenv = stdenv; - autoconf = pkgs.autoconf; - automake = pkgs.automake; - libxml2 = pkgs.libxml2; - libxslt = pkgs.libxslt; - docbook_dtd = pkgs.docbook_xml_dtd; - docbook_xslt = pkgs.docbook_xml_xslt; - fetchurl = pkgs.fetchurl; - fetchsvn = pkgs.fetchsvn; - rev = import ./head-revision.nix; - }; - - testbuild = (import ./nix-test-build.nix) { - stdenv = stdenv; - getopt = pkgs.getopt; - src = sourcedist; - }; - - rpmbuild = (import ./nix-rpm-build.nix) { - stdenv = stdenv; - getopt = pkgs.getopt; - src = sourcedist; - }; - - body = [sourcedist testbuild rpmbuild]; -} diff --git a/nix-dist/mail-result.sh b/nix-dist/mail-result.sh deleted file mode 100755 index f5e94d18bba..00000000000 --- a/nix-dist/mail-result.sh +++ /dev/null @@ -1,33 +0,0 @@ -#! /bin/sh - -email=$1 -shift - -logfile=/tmp/logfile-$$ # !!! security -trap "rm $logfile" EXIT - -echo $logfile - -if ! "$@" > $logfile 2>&1; then - BLOCKER=/tmp/inhibit-notify - if ! test -f $BLOCKER; then - HEAD=`head $logfile` - TAIL=`tail $logfile` - bzip2 < $logfile > $logfile.bz2 - mail -s "Nix build failed" -a $logfile.bz2 $email < $rpmmacros - -# Do the build. -$rpm -ta $src/*.tar.gz || exit 1 - -# Copy the resulting RPMs. -mkdir $out || exit 1 -cp -p $rpmdir/RPMS/*/* $out || exit 1 diff --git a/nix-dist/nix-source-dist.nix b/nix-dist/nix-source-dist.nix deleted file mode 100644 index 0a6672f84ca..00000000000 --- a/nix-dist/nix-source-dist.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ stdenv, autoconf, automake, libxml2, libxslt -, docbook_dtd, docbook_xslt -, fetchurl, fetchsvn, rev -}: - -derivation { - name = "nix-source-dist"; - system = stdenv.system; - - builder = ./nix-source-dist.sh; - src = fetchsvn { - url = "https://svn.cs.uu.nl:12443/repos/trace/nix/trunk/"; - rev = rev; - }; - - bdbSrc = fetchurl { - url = "http://www.sleepycat.com/update/snapshot/db-4.2.52.tar.gz"; - md5 = "cbc77517c9278cdb47613ce8cb55779f"; - }; - - atermSrc = fetchurl { - url = http://www.cwi.nl/projects/MetaEnv/aterm/aterm-2.0.5.tar.gz; - md5 = "68aefb0c10b2ab876b8d3c0b2d0cdb1b"; - }; - - sdfSrc = fetchurl { - url = ftp://ftp.stratego-language.org/pub/stratego/sdf2/sdf2-bundle-1.6.tar.gz; - md5 = "283be0b4c7c9575c1b5cc735316e6192"; - }; - - stdenv = stdenv; - autoconf = autoconf; - automake = automake; - libxml2 = libxml2; - libxslt = libxslt; - docbook_dtd = docbook_dtd; - docbook_xslt = docbook_xslt; -} diff --git a/nix-dist/nix-source-dist.sh b/nix-dist/nix-source-dist.sh deleted file mode 100755 index 5f0911b97ea..00000000000 --- a/nix-dist/nix-source-dist.sh +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/sh - -buildinputs="$autoconf $automake $libxml2 $libxslt" -. $stdenv/setup - -echo "copying sources..." -cp -prd $src/* . || exit 1 -chmod -R u+w . || exit 1 -cp -p $bdbSrc externals/db-4.2.52.tar.gz || exit 1 # !!! -cp -p $atermSrc externals/aterm-2.0.5.tar.gz || exit 1 -cp -p $sdfSrc externals/sdf2-bundle-1.6.tar.gz || exit 1 - -echo "autoconfing..." -autoreconf -i || exit 1 - -echo "configuring..." -./configure --prefix=`pwd`/inst \ - --with-docbook-catalog=$docbook_dtd/xml/dtd/docbook/docbook.cat \ - --with-docbook-xsl=$docbook_xslt/xml/xsl/docbook \ - --with-xml-flags="--nonet" || exit 1 - -echo "building..." -make distdir || exit 1 -pkgname=$(echo nix-*) -tar cvfz $pkgname.tar.gz $pkgname || exit 1 -tar cvfj $pkgname.tar.bz2 $pkgname || exit 1 - -echo "copying result..." -mkdir $out || exit 1 -cp -p $pkgname.tar.gz $pkgname.tar.bz2 $out || exit 1 -(cd doc/manual && make install) || exit 1 -(cd inst/share/nix && tar cvfj $out/manual.tar.bz2 manual) || exit 1 diff --git a/nix-dist/nix-test-build.nix b/nix-dist/nix-test-build.nix deleted file mode 100644 index 6fa7f271607..00000000000 --- a/nix-dist/nix-test-build.nix +++ /dev/null @@ -1,12 +0,0 @@ -{stdenv, getopt, src}: - -derivation { - name = "nix-test-build"; - system = stdenv.system; - - builder = ./nix-test-build.sh; - src = src; - - stdenv = stdenv; - getopt = getopt; # required by sdf2table -} diff --git a/nix-dist/nix-test-build.sh b/nix-dist/nix-test-build.sh deleted file mode 100755 index 55ccb9b2e5f..00000000000 --- a/nix-dist/nix-test-build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh - -buildinputs="$getopt" -. $stdenv/setup || exit 1 - -tar xvfj $src/*.tar.bz2 || exit 1 -cd nix-* || exit 1 -./configure --prefix=$out || exit 1 -make || exit 1 -make check || exit 1 -make install || exit 1 diff --git a/nix-dist/server-side/cgi-bin/create-dist.pl b/nix-dist/server-side/cgi-bin/create-dist.pl deleted file mode 100755 index 23a4e6955c2..00000000000 --- a/nix-dist/server-side/cgi-bin/create-dist.pl +++ /dev/null @@ -1,134 +0,0 @@ -#! /usr/bin/perl -w - -use strict; - - -# Global settings. -my $releasesDir = "/home/eelco/public_html/nix"; - -umask 0002; - - -sub printResult { - my $result = shift; - print "Content-Type: text/plain\n\n"; - print "$result\n"; -} - - -sub uploadFileTo { - my $path = shift; - open OUT, ">$path" or die "cannot create $path: $!"; - while () { - print OUT "$_" or die; - } - close OUT or die; -} - - -my $args = $ENV{"PATH_INFO"}; - -# Parse command. -die unless $args =~ /^\/([a-z-]+)\/(.*)$/; -my $command = $1; -$args = $2; - - -# Perform the command. - -# Start creation of a release. -if ($command eq "create") { - die unless $args =~ /^([A-Za-z0-9-][A-Za-z0-9-\.]*)$/; - my $releaseName = $1; - - my $uniqueNr = int (rand 1000000); - my $sessionName = "tmp-$uniqueNr-$releaseName"; - my $releaseDir = "$releasesDir/$sessionName"; - - mkdir $releaseDir, 0775 or die "cannot create $releaseDir: $!"; - - printResult "$sessionName"; -} - -# Upload a file to a release. -elsif ($command eq "upload") { - die unless $args =~ /^([A-Za-z0-9-][A-Za-z0-9-\.]*)((\/[A-Za-z0-9-][A-Za-z0-9-\.]*)+)$/; - my $sessionName = $1; - my $path = $2; - - my $fullPath = "$releasesDir/$sessionName/$path"; - - uploadFileTo $fullPath; - - printResult "ok"; -} - -# Upload and unpack a tar file to a release. -elsif ($command eq "upload-tar") { - die unless $args =~ /^([A-Za-z0-9-][A-Za-z0-9-\.]*)((\/[A-Za-z0-9-][A-Za-z0-9-\.]*)*)$/; - my $sessionName = $1; - my $path = $2; # may be empty - - my $fullPath = "$releasesDir/$sessionName/$path"; - - system("cd $fullPath && tar xfj - 1>&2") == 0 or die "cannot unpack: $?"; - - printResult "ok"; -} - -# Finish the release. -elsif ($command eq "finish") { - die unless $args =~ /^([A-Za-z0-9-][A-Za-z0-9-\.]+)$/; - my $sessionName = $1; - - die unless $sessionName =~ /^tmp-\d+-(.*)$/; - my $releaseName = $1; - - my $releaseDir1 = "$releasesDir/$sessionName"; - my $releaseDir2 = "$releasesDir/$releaseName"; - - system("chmod -R g=u $releaseDir1 1>&2") == 0 or die "cannot chmod: $?"; - - if (-d $releaseDir2) { - my $uniqueNr = int (rand 1000000); - my $releaseDir3 = "$releasesDir/replaced-$uniqueNr-$releaseName"; - rename $releaseDir2, $releaseDir3 - or die "cannot rename $releaseDir2 to $releaseDir3"; - } - - rename $releaseDir1, $releaseDir2 - or die "cannot rename $releaseDir1 to $releaseDir2"; - - printResult "$releaseName"; -} - -# Check for release existence. -elsif ($command eq "exists") { - die unless $args =~ /^([A-Za-z0-9-][A-Za-z0-9-\.]*)$/; - my $releaseName = $1; - - my $releaseDir = "$releasesDir/$releaseName"; - - if (-d $releaseDir) { - printResult "yes"; - } else { - printResult "no"; - } -} - -# Upload a single file, outside of a release. -elsif ($command eq "put") { - $args = "/" . $args; - die unless $args =~ /^((\/[A-Za-z0-9-][A-Za-z0-9-\.]*)+)$/; - my $path = $1; - - my $fullPath = "$releasesDir/$path"; - - uploadFileTo $fullPath; - - printResult "ok"; -} - -else { - die "invalid command"; -}