# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1328655335 -3600
# Node ID 99e62ec13155a02ccf257fac177e6a6df63de6c9
# Parent  c133ada8f98fe8acf066caccbeaeeaa280955032
Remove scripts related to the Debian distribution

diff --git a/SbuildHack.pm b/SbuildHack.pm
deleted file mode 100644
--- a/SbuildHack.pm
+++ /dev/null
@@ -1,29 +0,0 @@
-# sbuildhack module originally from Debathena.
-package SbuildHack;
-
-use Sbuild qw(binNMU_version);
-
-sub new_binNMU_version {
-    my $v = shift;
-    my $binNMUver = shift;
-    die("Wrong binNMUver!") unless ($binNMUver == 171717);
-    my %tags = (
-        'sarge' => '~debian3.1',
-        'etch' => '~debian4.0',
-        'lenny' => '~debian4.1',
-        'breezy' => '~ubuntu5.10',
-        'dapper' => '~ubuntu6.06',
-        'edgy' => '~ubuntu6.10',
-        'feisty' => '~ubuntu7.04',
-        'gutsy' => '~ubuntu7.10',
-        'hardy' => '~ubuntu8.04'
-    );
-    return "$v$tags{$main::distribution}";
-};
-
-{
-    no warnings 'redefine';
-    *Sbuild::binNMU_version = \&new_binNMU_version;
-}
-
-1;
diff --git a/sage-build b/sage-build
--- a/sage-build
+++ b/sage-build
@@ -15,39 +15,30 @@
       echo "sage: Building and installing modified Sage library files."
       echo ""
 
-      ## install c_lib
-      ## we're doing this here instead of setup.py because
-      ## it's easier to keep track of whether or not we're 
-      ## switching branches, which changes what we do with
-      ## the c_lib install
-      ##
-      ## that's no longer true, but it's easier to just 
-      ## keep this here.
+      # install c_lib
+      # we're doing this here instead of setup.py for historical
+      # reasons:
+      #
+      # it used to be easier to keep track of whether or not we're 
+      # switching branches, which changes what we do with the c_lib
+      # install
       echo ""
       echo "Installing c_lib"
       CUR=`pwd`
       cd "c_lib"
-      if [ -n "$SAGE_DEBIAN" ]; then
-        SAGE_LOCAL=/usr scons -Q install
-      else
-        scons -Q install
-      fi
-      ## make sure c_lib install went okay
+      scons -Q install
+      # make sure c_lib install went okay
       if [ $? -ne 0 ]; then
-	  echo "ERROR: There was an error building c_lib."
-	  echo ""
-	  exit 1
+          echo >&2 "Error building c_lib."
+          exit 1
       fi
       cd "$CUR"
 
       ./install "$SAGE_ROOT"
       if [ $? -ne 0 ]; then
-         echo "sage: There was an error installing modified $1 library code."
-         echo ""
+         echo >&2 "Error installing modified $1 library code."
          exit 1
       fi
-   #else
-      #echo "The directory $SAGE_ROOT/devel/$1/ does not exist."
    fi
 }
 
@@ -58,14 +49,13 @@
     DO_BUILD_ALL=0
 fi   
 
-
 if [ "$1" != "" ]; then
     # make devel/sage point to devel/$1
     cd "$SAGE_ROOT/devel/"
     if [ ! -d "sage-$1" ]; then
         # this will happen a lot because of people (=me) making typos.
-        echo "No such branch '$SAGE_ROOT/devel/sage-$1'"
-	echo "Use 'sage -clone' to create a new branch."
+        echo >&2 "No such branch '$SAGE_ROOT/devel/sage-$1'"
+        echo >&2 "Use 'sage --clone' to create a new branch."
         exit 1
     fi
     # On Solaris (and perhaps other systems), "ln -snf FILE LINK"
@@ -78,24 +68,18 @@
 fi
 
 if [ ! -d "$SAGE_ROOT/devel/sage" ]; then
-    echo "There is no directory '$SAGE_ROOT/devel/sage'"
+    echo >&2 "There is no directory '$SAGE_ROOT/devel/sage'"
     exit 1
 fi
 
 if [ $DO_BUILD_ALL = 1 ]; then
-   CUR=`pwd`
-   cd "$SAGE_ROOT/devel/sage/sage"
-   echo "*** TOUCHING ALL CYTHON (.pyx) FILES ***"
-   touch */*.pyx */*/*.pyx */*/*/*.pyx */*/*/*/*.pyx */*/*/*/*/*.pyx */*/*/*/*/*.pyx  */*/*/*/*/*/*.pyx 2> /dev/null
-   cd ../c_lib
-   if [ -n "$SAGE_DEBIAN" ]; then
-     SAGE_LOCAL=/usr scons -Q install
-   else
-     scons -Q install
-   fi
-   cd ..
-
-   cd "$CUR"
+    CUR=`pwd`
+    cd "$SAGE_ROOT/devel/sage/sage"
+    echo "*** TOUCHING ALL CYTHON (.pyx) FILES ***"
+    touch */*.pyx */*/*.pyx */*/*/*.pyx */*/*/*/*.pyx */*/*/*/*/*.pyx */*/*/*/*/*.pyx  */*/*/*/*/*/*.pyx 2> /dev/null
+    cd ../c_lib
+    scons -Q install
+    cd "$CUR"
 fi
 
 # In case SAGE64 has been set to yes before re-inject it into the environment
diff --git a/sage-build-debian b/sage-build-debian
deleted file mode 100755
--- a/sage-build-debian
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh -xe
-if [ ! -e dist/debian ]; then
-    echo "This spkg does not build a Debian package."
-    exit 0
-fi
-echo "Starting Debian build"
-unset LD_LIBRARY_PATH
-unset LIBRARY_PATH
-unset PYTHONPATH
-unset PYTHONHOME
-DIRECTORY=$(basename `pwd`)
-mv src "$DIRECTORY"
-mv dist/debian "$DIRECTORY/"
-sage-debsource "$DIRECTORY"
-sage-sbuildhack "$DEBIAN_RELEASE" *.dsc
-sage-sbuildhack lenny-amd64 *.dsc
-DISTRO=$(echo "$DEBIAN_RELEASE" | cut -f1 -d-)
-ARCHITECTURE=$(echo "$DEBIAN_RELEASE" | cut -f2 -d-)
-if [ -n "$SAGE_REPO" ]; then
-    reprepro --ignore=wrongdistribution -b "$SAGE_REPO" include "$DISTRO" *_source.changes
-    reprepro --ignore=wrongdistribution -b "$SAGE_REPO" include "$DISTRO" *_"$ARCHITECTURE.changes"
-    reprepro --ignore=wrongdistribution -b "$SAGE_REPO" include "$DISTRO" *_"amd64.changes"
-fi
-mv *.dsc *.changes *.build *.deb *.tar.gz *.diff.gz "$SAGE_ROOT/.."
-echo "Debian Build complete"
diff --git a/sage-debsource b/sage-debsource
deleted file mode 100755
--- a/sage-debsource
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-# Usage: dasource [-r REPOS] [PACKAGENAME ...]
-
-# Originally from the MIT Athena 10 project.
-
-# Creates or updates a checkout and source package for each listed
-# PACKAGENAME, or for all regular packages if no PACKAGENAME is
-# specified.
-
-# If REPOS is specified, it is used in preference to the canonical
-# Athena repository trunk.
-
-# Package subdirectories are created in the cwd.  The source checkout
-# will reside in PACKAGENAME/PACKAGENAME-VERSION and the source
-# package will be created in PACKAGENAME.
-
-set -e
-
-die() {
-  echo "$@" >&2
-  exit 1
-}
-
-do_package() {
-  dir=$1
-
-  version=$(echo $dir | sed 's/[^-]*-//' | sed 's/\.alpha/~alpha/' | sed 's/\.rc/~rc/')
-  upver=$(echo $version | sed 's/\(.*\)-\([^-]*\)/\1/')
-  if dpkg --compare-versions "$upver" '>>' "20000000"; then
-      # send to 0.0.x
-      upver="0.0.$upver"
-  fi
-  if [ "$upver" = "$version" ]; then
-      dver=0sage1
-  else
-      dver=0sage$(echo $version | sed 's/\(.*\)-\([^-]*\)/\2/')
-  fi
-  sver="$upver-$dver"
-
-  # Extract the package name from the changelog
-  pkgname=$(cd $dir && dpkg-parsechangelog | sed -n 's/Source: //p')
-
-  # Rename the source checkout if necessary.
-  correctdir=${pkgname}-$upver
-  if [ $dir != $correctdir ]; then
-    echo "Renaming $dir to $correctdir"
-    mv $dir $correctdir
-    dir=$correctdir
-  fi
-
-  # make sure we're running with a clean upstream
-  (cd $dir && debuild clean)
-
-  # If the version has a debian component then we need an orig archive.
-  if [ $sver != $upver ]; then
-    tarfile=${pkgname}_$upver.orig.tar.gz
-    if [ ! -e $pkgname/$tarfile ]; then
-        echo "Creating original source archive"
-        (tar --exclude=.svn --exclude=CVS --exclude=debian $correctname -czf \
-         $tarfile ${pkgname}-$upver)
-    fi
-  fi
-
-  # Add a changelog entry updating to the current version number.
-  (cd $dir && dch -v "$sver" "Build with new Sage spkg $dir.spkg")
-
-  # Build an unsigned package, ignoring version control subdirs in the source.
-  echo "Creating source package"
-  (cd $dir && DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes debuild -S -i -I -sa -us -uc)
-}
-
-if [ $# -gt 0 ]; then
-    do_package "$1"
-fi
diff --git a/sage-make_devel_packages b/sage-make_devel_packages
--- a/sage-make_devel_packages
+++ b/sage-make_devel_packages
@@ -115,7 +115,6 @@
 
 cp -pr sage-* .hg* ipy_profile_sage.py "$SCRIPTS"/
 cp -p "$SAGE_ROOT"/local/bin/sage-spkg-install "$SCRIPTS"/spkg-install
-cp -p "$SAGE_ROOT"/local/bin/SbuildHack.pm "$SCRIPTS"/
 cp -p "$SAGE_ROOT"/local/bin/ncadoctest.py "$SCRIPTS"/
 cp -p "$SAGE_ROOT"/local/bin/sagedoctest.py "$SCRIPTS"/
 
diff --git a/sage-sbuildhack b/sage-sbuildhack
deleted file mode 100755
--- a/sage-sbuildhack
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# Wrapper around sbuild.  The main purpose is to append a
-# distribution-dependent string like "~ubuntu7.10" to the binary
-# package version, using Sbuildhack.pm.
-
-# Originally from Debathena
-
-usage() {
-    echo "Usage: $0 <dist>-<arch> ..." >&2
-    exit 1
-}
-
-dist_arch=$1; shift
-if [ -z "$dist_arch" ]; then usage; fi
-IFS=- read dist arch <<EOF
-$dist_arch
-EOF
-if [ -z "$dist" ] || [ -z "$arch" ]; then usage; fi
-perl -I"$(dirname "$0")" -MSbuildHack \
-	/usr/bin/sbuild --binNMU=171717 --make-binNMU="Build with sbuild." \
-	-d "$dist" --arch="$arch" --apt-update -v "$@"
diff --git a/sage-spkg-install b/sage-spkg-install
--- a/sage-spkg-install
+++ b/sage-spkg-install
@@ -17,7 +17,7 @@
    hg update
 else
     # Initial install.  Just copy all the files over. 
-    cp -pR sage-*  *doctest.py SbuildHack.pm .hg* ipy_profile_sage.py "$TARGET"
+    cp -pR sage-*  *doctest.py .hg* ipy_profile_sage.py "$TARGET"
 fi
 
 # Create an appropriate hgrc file for the target
