]> andersk Git - test.git/commitdiff
Preparations for packaging ShellInABox in a way that makes it easy for Debian package...
authorMarkus Gutschke <markus@shellinabox.com>
Mon, 30 Nov 2009 18:26:43 +0000 (18:26 +0000)
committerMarkus Gutschke <markus@shellinabox.com>
Mon, 30 Nov 2009 18:26:43 +0000 (18:26 +0000)
12 files changed:
ChangeLog
commit
config.h
configure
configure.ac
demo/vt100.js
distributions/README [new file with mode: 0644]
distributions/debian/shellinabox_2.10-1.diff.gz [new file with mode: 0644]
distributions/debian/shellinabox_2.10-1.dsc [new file with mode: 0644]
distributions/debian/shellinabox_2.10.orig.tar.gz [new file with mode: 0644]
shellinabox/shell_in_a_box.js
shellinabox/vt100.js

index 1ecfcdc6d17bf3c9c9f2e880fe0f3de46da3a890..93e45221b097e528df17805316e127f9cc779d7f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-29  Markus Gutschke  <markus@shellinabox.com>
+
+       * Preparations for packaging ShellInABox in a way that makes it
+       easy for Debian package maintainers to pick it up.
+
 2009-11-25  Markus Gutschke  <markus@shellinabox.com>
 
        * On browsers that support CSS transforms, enable switching between
diff --git a/commit b/commit
index 9ab1eb418c3e32c7a05228e06a8a43fc93db1e9a..022fb5406a770849c343f2c1a2c51d4ac3739b44 100755 (executable)
--- a/commit
+++ b/commit
@@ -1,7 +1,11 @@
 #!/bin/bash -e
 
+# The script ensures that all commands succeed unless an error occurred. If it
+# does though, the shell terminates the script and our exit handler runs.
 trap 'tput bel || :; echo Failed! >&2' EXIT
 
+# Ask the user a yes/no question. This function does not require the user to
+# press ENTER after making a selection.
 yes_no() {
   local c
   while :; do
@@ -32,30 +36,122 @@ yes_no() {
   done
 }
 
+# Build Debian package and create all the files that are needed by the
+# distribution maintainer.
+debian_package() {
+  set -e
+  (
+    # Try to build the package. If things fail, let the exit handler remove all
+    # temporary files.
+    trap 'rm -rf "${prj}-${ver}" "${prj}_${ver}"*' EXIT
+
+    # Clean up any old temporary files
+    rm -rf "${prj}-${ver}" "${prj}_${ver}"*
+
+    # Extract the distribution source archive
+    tar zfx "${prj}-${ver}.tar.gz"
+
+    # We want to ship the "debian" directory with the source archive that
+    # users download directly from the project web site. This allows them to
+    # easily build their own Debian package by following the instructions in
+    # INSTALL.Debian.
+    # But when preparing our package for direct integration with Debian-based
+    # distributions, we have to instead remove the "debian" directory, as the
+    # distribution prefers that third-party projects are not built "natively".
+    mv "${prj}-${ver}/debian" "${prj}_${ver}_debian"
+    tar zfc "${prj}_${ver}.orig.tar.gz" "${prj}-${ver}"
+    mv "${prj}_${ver}_debian" "${prj}-${ver}/debian"
+
+    # Reset compatibility level
+    echo 7 >"${prj}-${ver}/debian/compat"
+
+    # Build Debian packages.
+    (cd "${prj}-${ver}"
+     fakeroot dpkg-buildpackage -sa -us -uc || :)
+    trap '' EXIT
+  )
+
+  # Revert any changes that might be pending in distributions/debian/*
+  local revert="$(svn st |
+                  grep distributions/debian |
+                  grep '^[^?]' |
+                  awk '{ print $2 }' |
+                  tac)"
+  if [ -n "${revert}" ]; then
+    svn revert ${revert}
+    rm -f ${revert}
+  fi
+
+  # Create distributions/debian if it does not exist yet.
+  mkdir -p distributions/debian
+  for i in distributions distributions/debian; do
+    if [ -z "$(svn st "${i}" 2>/dev/null | grep -v '^[?]')" ]; then
+      svn add --depth=empty "${i}"
+    fi
+  done
+
+  # If this version of files already exists in the distribution directory,
+  # we are not yet ready to cut a new release. Just clean up and exit.
+  for i in "${prj}_${ver}"[-.]*.*; do
+    [ -r "distributions/debian/${i}" ] && {
+      rm $(ls "${prj}_${ver}"[-.]* | egrep -v '_*.changes|_*.deb')
+      return 0
+    }
+  done
+
+  # Move new Debian files into release area.
+  mv $(ls "${prj}_${ver}"[-.]* | egrep -v '_*.changes|_*.deb')                \
+     distributions/debian/
+  svn add distributions/debian/"${prj}_${ver}"[-.]*.*
+
+  # Let the caller know that we added new packages.
+  return 1
+}
+
+# Quick sanity check that we are running from the correct directory
 test -r configure.ac
+
+# Make sure there are no stale files
 svn update
+
+# Determine Subversion revision number, project name, and public version
+# number
 {
-rev=$(($(svn info | sed -e 's/^Revision: \(.*\)/\1/;t1;d;:1;q')+1))
+  rev=$(($(svn info | sed -e 's/^Revision: \(.*\)/\1/;t1;d;:1;q')+1))
+  prj="$(sed -e 's/^AC_INIT(\([^,]*\),.*/\1/;t1;d;:1;q' configure.ac)"
+  ver="$(sed -e 's/^AC_INIT([^,]*, *\([^,]*\),.*/\1/;t1;d;:1;q' configure.ac)"
 } 2>/dev/null
-prj="$(sed -e 's/^AC_INIT(\([^,]*\),.*/\1/;t1;d;:1;q' configure.ac)"
-ver="$(sed -e 's/^AC_INIT([^,]*, *\([^,]*\),.*/\1/;t1;d;:1;q' configure.ac)"
+
+# Update "configure.ac" with the next Subversion revision number. This
+# information will trickle down into various source files where it becomes
+# part of the user-visible version information.
 sed -ie 's/^\(VCS_REVISION=\).*/\1'"${rev}"'/' configure.ac
 touch shellinabox/vt100.jspp shellinabox/shell_in_a_box.jspp
+
+# For now, Ubuntu/Hardy is still quite popular. We want to make it easy for
+# our users to build Debian packages from source. So, make sure we lock the
+# compatibility level at 6. Once we no longer care about maintaining strict
+# backwards compatibility, we can lift this restriction.
 echo 6 >debian/compat
+
+# Build all the sources, create the distribution tar archive, and run some
+# basic sanity checks.
 make all distcheck
-( trap 'rm -rf "${prj}-${ver}"' EXIT
-  rm -f "${prj}-${ver}" &&
-  tar zfx "${prj}-${ver}.tar.gz" &&
-  cd "${prj}-${ver}" &&
-  fakeroot dpkg-buildpackage -us -uc &&
-  cd .. &&
-  rm -f $(ls "${prj}_${ver}-"*.* | egrep -v '.deb$') ) || :
+
+# Build Debian package and create all the files that are needed by the
+# distribution maintainer.
+msg=
+debian_package ||
+  msg="${msg}
+NOTICE: New version released. Please do not forget to notify distributions"
+
 svn diff $(svn st |
-           egrep -v ' configure$| aclocal.m4$|^[?]' |
+           egrep -v ' configure$| aclocal.m4$|distributions|^[?]' |
            sed -e 's/^[^ ]* *//') | less
 echo -n 'Commit these changes (Y/n): '
 yes_no 0 || exit 1
 svn commit
+echo "${msg}"
 
 trap '' EXIT
 exit 0
index 2f1ef178be3f5cc0e95d75c236f1699dcc493b0f..ee99d85bb36070657e530117abb544fa40aa8c78 100644 (file)
--- a/config.h
+++ b/config.h
 #define STDC_HEADERS 1
 
 /* Most recent revision number in the version control system */
-#define VCS_REVISION "191"
+#define VCS_REVISION "192"
 
 /* Version number of package */
 #define VERSION "2.10"
index 0b4c26755e504b00e06afc79f6bea53d8a66c505..97c9da8389358be239aa30e83088094ddd0865e1 100755 (executable)
--- a/configure
+++ b/configure
@@ -2319,7 +2319,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-VCS_REVISION=191
+VCS_REVISION=192
 
 
 cat >>confdefs.h <<_ACEOF
index 0e5651590031c544213f84c8f3600ce3c005548a..f469a1e5aa35272c83ac85e80889e9bef9d5a7ee 100644 (file)
@@ -2,7 +2,7 @@ AC_PREREQ(2.57)
 
 dnl This is the one location where the authoritative version number is stored
 AC_INIT(shellinabox, 2.10, markus@shellinabox.com)
-VCS_REVISION=191
+VCS_REVISION=192
 AC_SUBST(VCS_REVISION)
 AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
                    [Most recent revision number in the version control system])
index 70e531bbcb5be20a8a1fff753a9b2d1331d61318..2763b226ed725e51c354d812bf1c083186336a9e 100644 (file)
@@ -1955,7 +1955,7 @@ VT100.prototype.toggleBell = function() {
 };
 
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.10 (revision 191)" +
+  alert("VT100 Terminal Emulator " + "2.10 (revision 192)" +
         "\nCopyright 2008-2009 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
diff --git a/distributions/README b/distributions/README
new file mode 100644 (file)
index 0000000..5282504
--- /dev/null
@@ -0,0 +1,3 @@
+This directory contains files that can be picked up by distributions that
+want to package ShellInABox and that want to ship it directly rather than
+making their users download it from the project's homepage.
diff --git a/distributions/debian/shellinabox_2.10-1.diff.gz b/distributions/debian/shellinabox_2.10-1.diff.gz
new file mode 100644 (file)
index 0000000..a2da18a
Binary files /dev/null and b/distributions/debian/shellinabox_2.10-1.diff.gz differ
diff --git a/distributions/debian/shellinabox_2.10-1.dsc b/distributions/debian/shellinabox_2.10-1.dsc
new file mode 100644 (file)
index 0000000..ed4da2d
--- /dev/null
@@ -0,0 +1,17 @@
+Format: 1.0
+Source: shellinabox
+Binary: shellinabox
+Architecture: any
+Version: 2.10-1
+Maintainer: Markus Gutschke <markus@shellinabox.com>
+Standards-Version: 3.6.1
+Build-Depends: debhelper (>= 4.0.0), binutils, libssl-dev, libpam0g-dev, zlib1g-dev
+Checksums-Sha1: 
+ 1847ca3684a3cd07b0831b977a6dadf5775f0d58 516377 shellinabox_2.10.orig.tar.gz
+ d724b4320311d93976bc70aceaaf3d3b9883cc1d 6073 shellinabox_2.10-1.diff.gz
+Checksums-Sha256: 
+ 32d5307bd920232f21918a1edfe015da44b31991458a18e5760e60540052ceb2 516377 shellinabox_2.10.orig.tar.gz
+ 119748a3a3e7d274ad9603ae5a751199c830f6e09ce6b699061c053ac03db549 6073 shellinabox_2.10-1.diff.gz
+Files: 
+ b3474662e46077f023de95ca44154c80 516377 shellinabox_2.10.orig.tar.gz
+ af657b1c3410a8c60225bb324642c26e 6073 shellinabox_2.10-1.diff.gz
diff --git a/distributions/debian/shellinabox_2.10.orig.tar.gz b/distributions/debian/shellinabox_2.10.orig.tar.gz
new file mode 100644 (file)
index 0000000..1083dd4
Binary files /dev/null and b/distributions/debian/shellinabox_2.10.orig.tar.gz differ
index 612f3bae5cd3f4cb588b8f477c14ff5b7b9d72a6..d2fb11e300cddaa842aafbf5a2f6a3170504f368 100644 (file)
@@ -358,7 +358,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) {
 };
 
 ShellInABox.prototype.about = function() {
-  alert("Shell In A Box version " + "2.10 (revision 191)" +
+  alert("Shell In A Box version " + "2.10 (revision 192)" +
         "\nCopyright 2008-2009 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com" +
         (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?
index 70e531bbcb5be20a8a1fff753a9b2d1331d61318..2763b226ed725e51c354d812bf1c083186336a9e 100644 (file)
@@ -1955,7 +1955,7 @@ VT100.prototype.toggleBell = function() {
 };
 
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.10 (revision 191)" +
+  alert("VT100 Terminal Emulator " + "2.10 (revision 192)" +
         "\nCopyright 2008-2009 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
This page took 0.112442 seconds and 5 git commands to generate.