[SCM] leiningen packaging branch, master, updated. debian/1.6.1-2-5-ga5fd472

Wolodja Wentland babilen at gmail.com
Fri Oct 7 14:51:11 UTC 2011


The following commit has been merged in the master branch:
commit eac4a74cabebfd76b3d64b10dce70bb6658ec152
Author: Wolodja Wentland <babilen at gmail.com>
Date:   Thu Oct 6 16:23:38 2011 +0100

    Debian release 1.6.1.1-1

diff --git a/debian/changelog b/debian/changelog
index 12d1a7b..b0758df 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+leiningen (1.6.1.1-1) unstable; urgency=low
+
+  * New upstream version
+  * Follow java-pkg git packaging guidelines
+  * Use correct lancet version
+
+ -- Wolodja Wentland <babilen at gmail.com>  Thu, 06 Oct 2011 15:03:32 +0000
+
 leiningen (1.6.1-2) unstable; urgency=low
 
   * Added a patch for bin/lein to fix "java.lang.ClassNotFoundException:
diff --git a/debian/patches/0001-Update-lancet.patch b/debian/patches/0001-Update-lancet.patch
new file mode 100644
index 0000000..deef90a
--- /dev/null
+++ b/debian/patches/0001-Update-lancet.patch
@@ -0,0 +1,328 @@
+From: Wolodja Wentland <babilen at gmail.com>
+Date: Thu, 6 Oct 2011 15:57:27 +0100
+Subject: Update lancet
+
+---
+ src/lancet.clj      |  140 -------------------------------------------
+ src/lancet/core.clj |  164 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 164 insertions(+), 140 deletions(-)
+ delete mode 100755 src/lancet.clj
+ create mode 100644 src/lancet/core.clj
+
+diff --git a/src/lancet.clj b/src/lancet.clj
+deleted file mode 100755
+index 7af9f49..0000000
+--- a/src/lancet.clj
++++ /dev/null
+@@ -1,140 +0,0 @@
+-(ns lancet
+-  (:gen-class)
+-  (:import (java.beans Introspector)
+-           (java.util.concurrent CountDownLatch)
+-           (org.apache.tools.ant.types Path)))
+-
+-(println "WARNING: lancet namespace is deprecated; use lancet.core.")
+-
+-(def #^{:doc "Dummy ant project to keep Ant tasks happy"}
+-  ant-project
+-  (let [proj (org.apache.tools.ant.Project.)
+-        logger (org.apache.tools.ant.NoBannerLogger.)]
+-    (doto logger
+-      (.setMessageOutputLevel org.apache.tools.ant.Project/MSG_INFO)
+-      (.setEmacsMode true)
+-      (.setOutputPrintStream System/out)
+-      (.setErrorPrintStream System/err))
+-    (doto proj
+-      (.init)
+-      (.addBuildListener logger))))
+-
+-(defmulti coerce (fn [dest-class src-inst] [dest-class (class src-inst)]))
+-
+-(defmethod coerce [java.io.File String] [_ str]
+-  (java.io.File. str))
+-(defmethod coerce [Boolean/TYPE String] [_ str]
+-  (contains? #{"on" "yes" "true"} (.toLowerCase str)))
+-(defmethod coerce :default [dest-cls obj] (cast dest-cls obj))
+-(defmethod coerce [Path String] [_ str]
+-  (Path. lancet/ant-project str))
+-
+-(defn env [val]
+-  (System/getenv (name val)))
+-
+-(defn- build-sh-args [args]
+-  (concat (.split (first args) " +") (rest args)))
+-
+-(defn property-descriptor [inst prop-name]
+-  (first
+-   (filter #(= prop-name (.getName %))
+-           (.getPropertyDescriptors
+-            (Introspector/getBeanInfo (class inst))))))
+-
+-(defn get-property-class [write-method]
+-  (first (.getParameterTypes write-method)))
+-
+-(defn set-property! [inst prop value]
+-  (let [pd (property-descriptor inst prop)]
+-    (when-not pd
+-      (throw (Exception. (format "No such property %s." prop))))
+-    (let [write-method (.getWriteMethod pd)
+-          dest-class (get-property-class write-method)]
+-      (.invoke write-method inst (into-array [(coerce dest-class value)])))))
+-
+-(defn set-properties! [inst prop-map]
+-  (doseq [[k v] prop-map] (set-property! inst (name k) v)))
+-
+-(defn instantiate-task [project name props & filesets]
+-  (let [task (.createTask project name)]
+-    (when-not task
+-      (throw (Exception. (format "No task named %s." name))))
+-    (doto task
+-      (.init)
+-      (.setProject project)
+-      (set-properties! props))
+-    (doseq [fs filesets]
+-      (.addFileset task fs))
+-    task))
+-
+-(defn runonce
+-  "Create a function that will only run once. All other invocations
+-  return the first calculated value. The function *can* have side effects
+-  and calls to runonce *can* be composed. Deadlock is possible
+-  if you have circular dependencies.
+-  Returns a [has-run-predicate, reset-fn, once-fn]"
+-  [function]
+-  (let [sentinel (Object.)
+-        result (atom sentinel)
+-        reset-fn (fn [] (reset! result sentinel))
+-        has-run-fn (fn [] (not= @result sentinel))]
+-    [has-run-fn
+-     reset-fn
+-     (fn [& args]
+-       (locking sentinel
+-         (if (= @result sentinel)
+-           (reset! result (function))
+-           @result)))]))
+-
+-(defmacro has-run? [f]
+-  `((:has-run (meta (var ~f)))))
+-
+-(defmacro reset [f]
+-  `((:reset-fn (meta (var ~f)))))
+-
+-(def targets (atom #{}))
+-
+-(defmacro deftarget [sym doc & forms]
+-  (swap! targets #(conj % sym))
+-  (let [has-run (gensym "hr-") reset-fn (gensym "rf-")]
+-    `(let [[~has-run ~reset-fn once-fn#] (runonce (fn [] ~@forms))]
+-       (def ~(with-meta sym {:doc doc :has-run has-run :reset-fn reset-fn})
+-            once-fn#))))
+-
+-(defmacro define-ant-task [clj-name ant-name]
+-  `(defn ~clj-name [& props#]
+-     (let [task# (apply instantiate-task ant-project ~(name ant-name) props#)]
+-       (.execute task#)
+-       task#)))
+-
+-(defmacro define-ant-type [clj-name ant-name]
+-  `(defn ~clj-name [props#]
+-     (let [bean# (new ~ant-name)]
+-       (set-properties! bean# props#)
+-       (when (property-descriptor bean# "project")
+-         (set-property! bean# "project" ant-project))
+-       bean#)))
+-
+-(defn task-names [] (map symbol (seq (.. ant-project getTaskDefinitions keySet))))
+-
+-(defn safe-ant-name [n]
+-  (if (ns-resolve 'clojure.core n) (symbol (str "ant-" n)) n))
+-
+-(defmacro define-all-ant-tasks []
+-  `(do ~@(map (fn [n] `(define-ant-task ~n ~n)) (task-names))))
+-
+-(defmacro define-all-ant-tasks []
+-  `(do ~@(map (fn [n] `(define-ant-task ~(safe-ant-name n) ~n)) (task-names))))
+-
+-(define-all-ant-tasks)
+-
+-;; The version of ant that maven-ant-tasks requires doesn't have this class:
+-;; (define-ant-type files org.apache.tools.ant.types.resources.Files)
+-(define-ant-type fileset org.apache.tools.ant.types.FileSet)
+-
+-(defn -main [& targs]
+-  (load-file "build.clj")
+-  (if targs
+-    (doseq [targ (map symbol targs)]
+-      (eval (list targ)))
+-    (println "Available targets: " @targets)))
+diff --git a/src/lancet/core.clj b/src/lancet/core.clj
+new file mode 100644
+index 0000000..e9167e8
+--- /dev/null
++++ b/src/lancet/core.clj
+@@ -0,0 +1,164 @@
++(ns lancet.core
++  (:gen-class)
++  (:import (java.beans Introspector)
++           (java.util.concurrent CountDownLatch)
++           (org.apache.tools.ant.types Path)
++           (org.apache.tools.ant.taskdefs Manifest$Attribute)
++           (java.util Map)))
++
++(def #^{:doc "Dummy ant project to keep Ant tasks happy"}
++  ant-project
++  (let [proj (org.apache.tools.ant.Project.)
++        logger (org.apache.tools.ant.NoBannerLogger.)]
++    (doto logger
++      (.setMessageOutputLevel org.apache.tools.ant.Project/MSG_INFO)
++      (.setEmacsMode true)
++      (.setOutputPrintStream System/out)
++      (.setErrorPrintStream System/err))
++    (doto proj
++      (.init)
++      (.addBuildListener logger))))
++
++(defmulti coerce (fn [dest-class src-inst] [dest-class (class src-inst)]))
++
++(defmethod coerce [java.io.File String] [_ str]
++  (java.io.File. str))
++(defmethod coerce [Boolean/TYPE String] [_ str]
++  (contains? #{"on" "yes" "true"} (.toLowerCase str)))
++(defmethod coerce :default [dest-cls obj] (cast dest-cls obj))
++(defmethod coerce [Path String] [_ str]
++  (Path. ant-project str))
++
++(defn env [val]
++  (System/getenv (name val)))
++
++(defn- build-sh-args [args]
++  (concat (.split (first args) " +") (rest args)))
++
++(defn property-descriptor [inst prop-name]
++  (first
++   (filter #(= prop-name (.getName %))
++           (.getPropertyDescriptors
++            (Introspector/getBeanInfo (class inst))))))
++
++(defn get-property-class [write-method]
++  (first (.getParameterTypes write-method)))
++
++(defn set-property! [inst prop value]
++  (let [pd (property-descriptor inst prop)]
++    (when-not pd
++      (throw (Exception. (format "No such property %s." prop))))
++    (let [write-method (.getWriteMethod pd)
++          dest-class (get-property-class write-method)]
++      (.invoke write-method inst (into-array [(coerce dest-class value)])))))
++
++(defn set-properties! [inst prop-map]
++  (doseq [[k v] prop-map] (set-property! inst (name k) v)))
++
++(def ant-task-hierarchy
++  (atom (-> (make-hierarchy)
++            (derive ::exec ::has-args))))
++
++(defmulti add-nested
++  "Adds a nested element to ant task.
++Elements are added in a different way for each type.
++Task name keywords are connected into a hierarchy which can
++be used to extensively add other types to this method.
++The default behaviour is to add an element as a fileset."
++  (fn [name task nested] [(keyword "lancet.core" name) (class nested)])
++  :hierarchy ant-task-hierarchy)
++
++(defmethod add-nested [::manifest Map]
++  [_ task props]
++  (doseq [[n v] props] (.addConfiguredAttribute task
++                                                (Manifest$Attribute. n v))))
++(defmethod add-nested [::has-args String]
++  [_ task arg]
++  (doto  (.createArg task) (.setValue arg)))
++
++(defmethod add-nested :default [_ task nested] (.addFileset task nested))
++
++(defn instantiate-task [project name props & nested]
++  (let [task (.createTask project name)]
++    (when-not task
++      (throw (Exception. (format "No task named %s." name))))
++    (doto task
++      (.init)
++      (.setProject project)
++      (set-properties! props))
++    (doseq [n nested]
++      (add-nested name task n)
++      )
++    task))
++
++(defn runonce
++  "Create a function that will only run once. All other invocations
++  return the first calculated value. The function *can* have side effects
++  and calls to runonce *can* be composed. Deadlock is possible
++  if you have circular dependencies.
++  Returns a [has-run-predicate, reset-fn, once-fn]"
++  [function]
++  (let [sentinel (Object.)
++        result (atom sentinel)
++        reset-fn (fn [] (reset! result sentinel))
++        has-run-fn (fn [] (not= @result sentinel))]
++    [has-run-fn
++     reset-fn
++     (fn [& args]
++       (locking sentinel
++         (if (= @result sentinel)
++           (reset! result (function))
++           @result)))]))
++
++(defmacro has-run? [f]
++  `((:has-run (meta (var ~f)))))
++
++(defmacro reset [f]
++  `((:reset-fn (meta (var ~f)))))
++
++(def targets (atom #{}))
++
++(defmacro deftarget [sym doc & forms]
++  (swap! targets #(conj % sym))
++  (let [has-run (gensym "hr-") reset-fn (gensym "rf-")]
++    `(let [[~has-run ~reset-fn once-fn#] (runonce (fn [] ~@forms))]
++       (def ~(with-meta sym {:doc doc :has-run has-run :reset-fn reset-fn})
++            once-fn#))))
++
++(defmacro define-ant-task [clj-name ant-name]
++  `(defn ~clj-name [& props#]
++     (let [task# (apply instantiate-task ant-project ~(name ant-name) props#)]
++       (.execute task#)
++       task#)))
++
++(defmacro define-ant-type [clj-name ant-name]
++  `(defn ~clj-name [props#]
++     (let [bean# (new ~ant-name)]
++       (set-properties! bean# props#)
++       (when (property-descriptor bean# "project")
++         (set-property! bean# "project" ant-project))
++       bean#)))
++
++(defn task-names [] (map symbol (seq (.. ant-project getTaskDefinitions keySet))))
++
++(defn safe-ant-name [n]
++  (if (ns-resolve 'clojure.core n) (symbol (str "ant-" n)) n))
++
++(defmacro define-all-ant-tasks []
++  `(do ~@(map (fn [n] `(define-ant-task ~n ~n)) (task-names))))
++
++(defmacro define-all-ant-tasks []
++  `(do ~@(map (fn [n] `(define-ant-task ~(safe-ant-name n) ~n)) (task-names))))
++
++(define-all-ant-tasks)
++
++;; Newer versions of ant don't have this class:
++;; (define-ant-type files org.apache.tools.ant.types.resources.Files)
++(define-ant-type fileset org.apache.tools.ant.types.FileSet)
++
++(defn -main [& targs]
++  (load-file "build.clj")
++  (if targs
++    (doseq [targ (map symbol targs)]
++      (eval (list targ)))
++    (println "Available targets: " @targets)))
+-- 
diff --git a/debian/patches/0002-Non-standalone-lein.patch b/debian/patches/0002-Non-standalone-lein.patch
new file mode 100644
index 0000000..5a7c46d
--- /dev/null
+++ b/debian/patches/0002-Non-standalone-lein.patch
@@ -0,0 +1,266 @@
+From: Wolodja Wentland <babilen at gmail.com>
+Date: Thu, 6 Oct 2011 16:00:15 +0100
+Subject: Non-standalone lein
+
+---
+ bin/lein |  196 +++++++++++++-------------------------------------------------
+ 1 files changed, 40 insertions(+), 156 deletions(-)
+
+diff --git a/bin/lein b/bin/lein
+index de67bfd..3d1ca7b 100755
+--- a/bin/lein
++++ b/bin/lein
+@@ -1,19 +1,12 @@
+-#!/bin/sh
++#!/bin/bash
++
++# This variant of the lein script is meant for downstream packagers.
++# It has all the cross-platform stuff stripped out as well as the
++# logic for running from checkouts and self-upgrading.
+ 
+ LEIN_VERSION="1.6.1.1"
+ export LEIN_VERSION
+ 
+-case $LEIN_VERSION in
+-    *SNAPSHOT) SNAPSHOT="YES" ;;
+-    *) SNAPSHOT="NO" ;;
+-esac
+-
+-# Make sure classpath is in unix format for manipulating, then put
+-# it back to windows format when we use it
+-if [ "$OSTYPE" = "cygwin" ] && [ "$CLASSPATH" != "" ]; then
+-    CLASSPATH=`cygpath -up $CLASSPATH`
+-fi
+-
+ if [ `whoami` = "root" ] && [ "$LEIN_ROOT" = "" ]; then
+     echo "WARNING: You're currently running as root; probably by accident."
+     echo "Press control-C to abort or Enter to continue as root."
+@@ -21,10 +14,10 @@ if [ `whoami` = "root" ] && [ "$LEIN_ROOT" = "" ]; then
+     read _
+ fi
+ 
++# cd to the project root, if applicable
+ NOT_FOUND=1
+ ORIGINAL_PWD="$PWD"
+-while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]
+-do
++while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]; do
+     cd ..
+     if [ "$(dirname "$PWD")" = "/" ]; then
+         NOT_FOUND=0
+@@ -32,9 +25,10 @@ do
+     fi
+ done
+ 
+-if [ "$LEIN_HOME" = "" ]; then
+-    LEIN_HOME="$HOME/.lein"
+-fi
++# Support $JAVA_OPTS for backwards-compatibility.
++JVM_OPTS=${JVM_OPTS:-"$JAVA_OPTS"}
++JAVA_CMD=${JAVA_CMD:-"java"}
++LEIN_HOME=${LEIN_HOME:-"$HOME/.lein"}
+ 
+ DEV_PLUGINS="$(ls -1 lib/dev/*jar 2> /dev/null)"
+ USER_PLUGINS="$(ls -1 "$LEIN_HOME"/plugins/*jar 2> /dev/null)"
+@@ -69,7 +63,7 @@ LEIN_PLUGIN_PATH="$(echo "$DEV_PLUGINS" | tr \\n :)"
+ LEIN_USER_PLUGIN_PATH="$(echo "$(unique_user_plugins)" | tr \\n :)"
+ CLASSPATH="$CLASSPATH:$LEIN_PLUGIN_PATH:$LEIN_USER_PLUGIN_PATH:test/:src/"
+ LEIN_JAR="$HOME/.lein/self-installs/leiningen-$LEIN_VERSION-standalone.jar"
+-CLOJURE_JAR="$HOME/.m2/repository/org/clojure/clojure/1.2.1/clojure-1.2.1.jar"
++CLOJURE_JAR="/usr/share/java/clojure-1.2.jar:/usr/share/java/asm3.jar:/usr/share/java/asm3-commons.jar"
+ NULL_DEVICE=/dev/null
+ 
+ # apply context specific CLASSPATH entries
+@@ -84,163 +78,53 @@ else
+     SCRIPT="$0"
+ fi
+ 
+-# resolve symlinks to the script itself portably
+-while [ -h "$SCRIPT" ] ; do
+-    ls=`ls -ld "$SCRIPT"`
+-    link=`expr "$ls" : '.*-> \(.*\)$'`
+-    if expr "$link" : '/.*' > /dev/null; then
+-        SCRIPT="$link"
+-    else
+-        SCRIPT="$(dirname "$SCRIPT"$)/$link"
+-    fi
++SHARE_JARS="ant ant-launcher classworlds clojure-1.2 \
++lucene-memory maven-ant-tasks maven-artifact maven-artifact-manager \
++maven-error-diagnostics maven-model maven-settings maven-project maven-profile \
++maven-repository-metadata plexus-container-default-alpha plexus-interpolation \
++plexus-utils wagon-file wagon-http-lightweight wagon-http-shared wagon-provider-api \
++xml-apis lucene-core lucene-highlighter clucy robert-hooke lancet \
++backport-util-concurrent" # NFI why that last one is necessary
++for JAR in $SHARE_JARS; do
++    CLASSPATH="$CLASSPATH":"/usr/share/java/$JAR.jar"
+ done
+ 
+-BIN_DIR="$(dirname "$SCRIPT")"
+-
+-if [ -r "$BIN_DIR/../src/leiningen/core.clj" ]; then
+-    # Running from source checkout
+-    LEIN_DIR="$(dirname "$BIN_DIR")"
+-    LEIN_LIBS="$(find -H "$LEIN_DIR/lib" -mindepth 1 -maxdepth 1 -print0 2> /dev/null | tr \\0 \:)"
+-    CLASSPATH="$CLASSPATH:$LEIN_LIBS:$LEIN_DIR/src:$LEIN_DIR/classes:$LEIN_DIR/resources:$LEIN_JAR"
+-
+-    if [ "$LEIN_LIBS" = "" -a "$1" != "self-install" -a ! -r "$LEIN_JAR" ]; then
+-        echo "Leiningen is missing its dependencies. Please see \"Building\" in the README."
+-        exit 1
+-    fi
+-else
+-    # Not running from a checkout
+-    CLASSPATH="$CLASSPATH:$LEIN_JAR"
+-
+-    if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
+-        "$0" self-install
+-    fi
++# Do not use installed leiningen jar during self-compilation
++if ! { [ "$1" = "compile" ] &&
++       grep -qsE 'defproject leiningen[[:space:]]+"[[:digit:].]+"' \
++         project.clj ;}; then
++    CLASSPATH="$CLASSPATH":/usr/share/java/leiningen-$LEIN_VERSION.jar
+ fi
+ 
+-HTTP_CLIENT="wget --no-check-certificate -O"
+-if type -p curl >/dev/null 2>&1; then
+-    if [ "$https_proxy" != "" ]; then
+-        CURL_PROXY="-x $https_proxy"
+-    fi
+-    HTTP_CLIENT="curl $CURL_PROXY --insecure -f -L -o"
++if [ $DEBUG ]; then
++    echo $CLASSPATH
++    echo $CLOJURE_JAR
+ fi
+ 
+-export JAVA_CMD=${JAVA_CMD:-"java"}
+-
+-# Support $JAVA_OPTS for backwards-compatibility.
+-export JVM_OPTS=${JVM_OPTS:-"$JAVA_OPTS"}
+-
+-# TODO: investigate http://skife.org/java/unix/2011/06/20/really_executable_jars.html
+-# If you're packaging this for a package manager (.deb, homebrew, etc)
+-# you need to remove the self-install and upgrade functionality.
+-if [ "$1" = "self-install" ]; then
+-    echo "Downloading Leiningen now..."
+-    LEIN_DIR=`dirname "$LEIN_JAR"`
+-    mkdir -p "$LEIN_DIR"
+-    LEIN_URL="https://github.com/downloads/technomancy/leiningen/leiningen-$LEIN_VERSION-standalone.jar"
+-    $HTTP_CLIENT "$LEIN_JAR" "$LEIN_URL"
+-    if [ $? != 0 ]; then
+-        echo "Failed to download $LEIN_URL"
+-        if [ $SNAPSHOT = "YES" ]; then
+-            echo "If you have Maven installed, you can do"
+-            echo "mvn dependency:copy-dependencies; mv target/dependency lib"
+-            echo "See README.md for further SNAPSHOT build instructions."
+-        fi
+-        rm $LEIN_JAR 2> /dev/null
+-        exit 1
+-    fi
+-elif [ "$1" = "upgrade" ]; then
+-    if [ "$LEIN_DIR" != "" ]; then
+-        echo "The upgrade task is not meant to be run from a checkout."
+-        exit 1
+-    fi
+-    if [ $SNAPSHOT = "YES" ]; then
+-        echo "The upgrade task is only meant for stable releases."
+-        echo "See the \"Hacking\" section of the README."
+-        exit 1
+-    fi
+-    if [ ! -w "$SCRIPT" ]; then
+-        echo "You do not have permission to upgrade the installation in $SCRIPT"
+-        exit 1
+-    else
+-        echo "The script at $SCRIPT will be upgraded to the latest stable version."
+-        echo -n "Do you want to continue [Y/n]? "
+-        read RESP
+-        case "$RESP" in
+-            y|Y|"")
+-                echo
+-                echo "Upgrading..."
+-                TARGET="/tmp/lein-$$-upgrade"
+-                LEIN_SCRIPT_URL="https://github.com/technomancy/leiningen/raw/stable/bin/lein"
+-                $HTTP_CLIENT "$TARGET" "$LEIN_SCRIPT_URL" \
+-                    && mv "$TARGET" "$SCRIPT" \
+-                    && chmod +x "$SCRIPT" \
+-                    && echo && $SCRIPT self-install && echo && echo "Now running" `$SCRIPT version`
+-                exit $?;;
+-            *)
+-                echo "Aborted."
+-                exit 1;;
+-        esac
+-    fi
+-else
+-    if [ "$OSTYPE" = "cygwin" ]; then
+-        # When running on Cygwin, use Windows-style paths for java
+-        CLOJURE_JAR=`cygpath -w "$CLOJURE_JAR"`
+-        ORIGINAL_PWD=`cygpath -w "$ORIGINAL_PWD"`
+-        CLASSPATH=`cygpath -wp "$CLASSPATH"`
+-        NULL_DEVICE=NUL
+-    fi
+-
+-    if [ $DEBUG ]; then
+-        echo $CLASSPATH
+-        echo $CLOJURE_JAR
+-    fi
+-
+-    JLINE=""
+-    if ([ "$1" = "repl" ] || [ "$1" = "interactive" ] || [ "$1" = "int" ]) &&
+-        [ -z $INSIDE_EMACS ] && [ "$TERM" != "dumb" ]; then
+-        # Use rlwrap if it's available, otherwise fall back to JLine
+-        RLWRAP=`which rlwrap`
+-        if [ ! -x "$RLWRAP" ] || [ "$RLWRAP" = "" ]; then
+-            if [ ! -r "$LEIN_HOME/.jline-warn" ]; then
+-                echo "Using JLine for console I/O; install rlwrap for optimum experience."
+-                touch "$LEIN_HOME/.jline-warn"
+-            fi
+-            RLWRAP=""
+-            JLINE=jline.ConsoleRunner
+-            if [ "$OSTYPE" = "cygwin" ]; then
+-                JLINE="-Djline.terminal=jline.UnixTerminal jline.ConsoleRunner"
+-                CYGWIN_JLINE=y
+-            fi
+-        else
+-            # Test to see if rlwrap supports custom quote chars
+-            rlwrap -m -q '"' echo "hi" > /dev/null 2>&1
+-            if [ $? -eq 0 ]; then
+-                RLWRAP="$RLWRAP -m -q '\"'"
+-            fi
+-        fi
++# Use rlwrap if appropriate
++if ([ "$1" = "repl" ] || [ "$1" = "interactive" ] || [ "$1" = "int" ]) &&
++    [ -z $INSIDE_EMACS ] && [ "$TERM" != "dumb" ]; then
++    which rlwrap > /dev/null
++    if [ $? -eq 0 ]; then
++        RLWRAP="rlwrap -m -q '\"'" # custom quote chars
+     fi
++fi
+ 
+-    # The -Xbootclasspath argument is optional here: if the jar
+-    # doesn't exist everything will still work, it will just have a
+-    # slower JVM boot.
+-    test $CYGWIN_JLINE && stty -icanon min 1 -echo
+-    if [ "$1" = "trampoline" ]; then
++if [ "$1" = "trampoline" ]; then
+         TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
+         $JAVA_CMD -Xbootclasspath/a:"$CLOJURE_JAR" -client $JVM_OPTS \
+             -Dleiningen.original.pwd="$ORIGINAL_PWD" \
+             -Dleiningen.trampoline-file=$TRAMPOLINE_FILE -cp "$CLASSPATH" \
+-            $JLINE clojure.main -e "(use 'leiningen.core)(-main)" \
++            clojure.main -e "(use 'leiningen.core)(-main)" \
+             $NULL_DEVICE "$@"
+         if [ -r $TRAMPOLINE_FILE ]; then
+             TRAMPOLINE="$(cat $TRAMPOLINE_FILE)"
+             rm $TRAMPOLINE_FILE
+             exec sh -c "$TRAMPOLINE"
+         fi
+-    else
++else
+         exec $RLWRAP $JAVA_CMD -Xbootclasspath/a:"$CLOJURE_JAR" -client $JVM_OPTS \
+             -Dleiningen.original.pwd="$ORIGINAL_PWD" \
+-            -cp "$CLASSPATH" $JLINE clojure.main -e "(use 'leiningen.core)(-main)" \
++            -cp "$CLASSPATH" clojure.main -e "(use 'leiningen.core)(-main)" \
+             $NULL_DEVICE "$@"
+-        test $CYGWIN_JLINE && stty icanon echo
+-    fi
+ fi
+-- 
diff --git a/debian/patches/0003-Disable-dependency-download.patch b/debian/patches/0003-Disable-dependency-download.patch
new file mode 100644
index 0000000..26a1ab9
--- /dev/null
+++ b/debian/patches/0003-Disable-dependency-download.patch
@@ -0,0 +1,26 @@
+From: Wolodja Wentland <babilen at gmail.com>
+Date: Thu, 6 Oct 2011 16:00:56 +0100
+Subject: Disable dependency download
+
+---
+ project.clj |    7 -------
+ 1 files changed, 0 insertions(+), 7 deletions(-)
+
+diff --git a/project.clj b/project.clj
+index 1cb5b7d..9cda7ce 100644
+--- a/project.clj
++++ b/project.clj
+@@ -6,12 +6,5 @@
+   :description "Automate Clojure projects without setting your hair on fire."
+   :url "https://github.com/technomancy/leiningen"
+   :license {:name "Eclipse Public License"}
+-  :dependencies [[org.clojure/clojure "1.2.1"]
+-                 [org.clojure/clojure-contrib "1.2.0"]
+-                 [clucy "0.2.2"]
+-                 [lancet "1.0.1"]
+-                 [jline "0.9.94" :exclusions [junit]]
+-                 [robert/hooke "1.1.2"]
+-                 [org.apache.maven/maven-ant-tasks "2.0.10" :exclusions [ant]]]
+   :disable-implicit-clean true
+   :eval-in-leiningen true)
+-- 
diff --git a/debian/patches/0004-Lein-upgrade-message.patch b/debian/patches/0004-Lein-upgrade-message.patch
new file mode 100644
index 0000000..9dbcb2b
--- /dev/null
+++ b/debian/patches/0004-Lein-upgrade-message.patch
@@ -0,0 +1,22 @@
+From: Wolodja Wentland <babilen at gmail.com>
+Date: Thu, 6 Oct 2011 16:02:21 +0100
+Subject: Lein upgrade message
+
+---
+ src/leiningen/upgrade.clj |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/src/leiningen/upgrade.clj b/src/leiningen/upgrade.clj
+index c2dd189..05d41df 100644
+--- a/src/leiningen/upgrade.clj
++++ b/src/leiningen/upgrade.clj
+@@ -1,5 +1,8 @@
+ (ns leiningen.upgrade
+   "Upgrade Leiningen to the latest stable release.")
+ 
++(defn upgrade []
++  (println "Upgrades should be done using apt rather than Leiningen itself."))
++
+ ;; This file is only a placeholder. The real upgrade
+ ;; implementation can be found in the 'lein' script.
+-- 
diff --git a/debian/patches/0005-Fix-manpage.patch b/debian/patches/0005-Fix-manpage.patch
new file mode 100644
index 0000000..703fe4b
--- /dev/null
+++ b/debian/patches/0005-Fix-manpage.patch
@@ -0,0 +1,19 @@
+From: Wolodja Wentland <babilen at gmail.com>
+Date: Thu, 6 Oct 2011 16:02:55 +0100
+Subject: Fix manpage
+
+---
+ doc/lein.1 |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/doc/lein.1 b/doc/lein.1
+index 5be6ad4..9b9f075 100644
+--- a/doc/lein.1
++++ b/doc/lein.1
+@@ -1,4 +1,4 @@
+-./"to render: groff -Tascii -man doc/lein.1 > lein.man"
++.\"to render: groff -Tascii -man doc/lein.1 > lein.man"
+ .TH LEININGEN 1 "2011 June 30"
+ .SH NAME
+ lein \- Automate Clojure projects
+-- 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..897ea95
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,5 @@
+0001-Update-lancet.patch
+0002-Non-standalone-lein.patch
+0003-Disable-dependency-download.patch
+0004-Lein-upgrade-message.patch
+0005-Fix-manpage.patch
diff --git a/debian/rules b/debian/rules
index 4be38fe..c528cb8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,9 +31,8 @@ override_jh_clean:
 	rm -rf $(CURDIR)/doc/html
 
 override_jh_installlibs:
-	jh_installlibs -i --upstream-version=1.1.0 lancet.jar
-	jh_installlibs -i --version-strip=".ds[0-9]*$$" \
-		leiningen-$(DEB_UPSTREAM_VERSION).jar
+	jh_installlibs -i --upstream-version=1.0.1 lancet.jar
+	jh_installlibs -i leiningen-$(DEB_UPSTREAM_VERSION).jar
 
 override_dh_installchangelogs:
 	dh_installchangelogs NEWS

-- 
leiningen packaging



More information about the pkg-java-commits mailing list