7
0
forked from pool/leiningen

- Update to 2.9.1:

* Fix a bug where provided namespace compilation order was overridden. (Phil Hagelberg)
  * Don't emit namespaced maps when merging data readers for uberjar. (Joel Kaasinen)
- Install to correct bash completions path
- Remove suse macros
- Use standalone leiningen
- Add files from upstream:
  * bash_completion.bash
  * zsh_completion.bash
  * lein.1 manpage
  * lein-pkg script

- Remove PKGBUILD

OBS-URL: https://build.opensuse.org/package/show/devel:languages:clojure/leiningen?expand=0&rev=2
This commit is contained in:
2019-07-16 15:03:27 +00:00
committed by Git OBS Bridge
parent d5da0ca780
commit 90488299fe
9 changed files with 425 additions and 83 deletions

View File

@@ -1,23 +0,0 @@
# Maintainer: Kristoffer Gronlund <kgronlund at suse dot com>
pkgname=leiningen
pkgver=2.5.1
pkgrel=1
epoch=1
pkgdesc="Automating Clojure projects without setting your hair on fire."
arch=('any')
url="http://github.com/technomancy/leiningen"
license=("EPL-1.0")
depends=('java-environment')
optdepends=('rlwrap: for readline support')
# https://raw.github.com/technomancy/leiningen/stable/bin/lein
# https://raw.github.com/technomancy/leiningen/stable/doc/lein.1
source=("${pkgname}-${pkgver}.tar.xz")
sha1sums=('a162e301089a66d05a9047987d20e3b205e6bc97')
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
install -m 0755 -D ./bin/lein "${pkgdir}/usr/bin/lein"
install -m 0644 -D ./doc/lein.1 "${pkgdir}/usr/share/man/man1/lein.1"
install -m 0644 -D ./zsh_completion.zsh "${pkgdir}/usr/share/zsh/site-functions/_lein"
install -m 0644 -D ./bash_completion.bash "${pkgdir}/usr/share/bash-completion/completions/lein"
}

View File

@@ -3,10 +3,10 @@ _lein_completion() {
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
tasks="check classpath clean compile deploy deps help install jar javac new pom repl retest run search swank test trampoline uberjar upgrade version with-profile"
tasks="change check classpath clean compile deploy deps do help install jar javac new plugin pom release repl retest run search show-profiles test trampoline uberjar update-in upgrade vcs version with-profile"
case "${prev}" in
check | classpath | clean | deploy | deps | install | jar | javac | new | pom | repl | swank | uberjar | version)
change | check | classpath | clean | deploy | deps | do | install | jar | javac | new | plugin | pom | release | repl | show-profiles | uberjar | update-in | vcs | version)
COMPREPLY=()
;;
help)

147
lein-pkg Normal file
View File

@@ -0,0 +1,147 @@
#!/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 a source checkout and self-install/upgrading.
export LEIN_VERSION="2.9.1"
# cd to the project root, if applicable
NOT_FOUND=1
ORIGINAL_PWD="$PWD"
while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]; do
cd ..
if [ "$(dirname "$PWD")" = "/" ]; then
NOT_FOUND=0
cd "$ORIGINAL_PWD"
fi
done
if [[ "$CLASSPATH" != "" ]]; then
echo "WARNING: You have \$CLASSPATH set, probably by accident."
echo "It is strongly recommended to unset this before proceeding."
fi
# User init
export LEIN_HOME="${LEIN_HOME:-"$HOME/.lein"}"
# Support $JAVA_OPTS for backwards-compatibility.
JVM_OPTS=${JVM_OPTS:-"$JAVA_OPTS"}
JAVA_CMD=${JAVA_CMD:-"java"}
for f in "/etc/leinrc" "$LEIN_HOME/leinrc" ".leinrc"; do
if [ -e "$f" ]; then
source "$f"
fi
done
export LEIN_JVM_OPTS="${LEIN_JVM_OPTS-"-Xverify:none -XX:+TieredCompilation -XX:TieredStopAtLevel=1"}"
grep -E -q '^\s*:eval-in\s+:classloader\s*$' project.clj 2> /dev/null &&
LEIN_JVM_OPTS="${LEIN_JVM_OPTS:-'-Xms64m -Xmx512m'}"
# If you're not using an uberjar you'll need to list each dependency
# and add them individually to the classpath/bootclasspath as well.
LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar
# Do not use installed leiningen jar during self-compilation
if ! { [ "$1" = "compile" ] &&
grep -qsE 'defproject leiningen[[:space:]]+"[[:digit:].]+"' \
project.clj ;}; then
CLASSPATH="$CLASSPATH":"$LEIN_JAR"
if [ "$LEIN_USE_BOOTCLASSPATH" != "no" ]; then
LEIN_JVM_OPTS="-Xbootclasspath/a:$LEIN_JAR $LEIN_JVM_OPTS"
fi
fi
# apply context specific CLASSPATH entries
if [ -f .lein-classpath ]; then
CLASSPATH="$(cat .lein-classpath):$CLASSPATH"
fi
if [ -n "$DEBUG" ]; then
echo "Leiningen's classpath: $CLASSPATH"
fi
# Which Java?
export JAVA_CMD="${JAVA_CMD:-"java"}"
export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-$JAVA_CMD}"
if [[ "$(basename "$LEIN_JAVA_CMD")" == *drip* ]]; then
export DRIP_INIT="$(printf -- '-e\n(require (quote leiningen.repl))')"
fi
# Support $JAVA_OPTS for backwards-compatibility.
export JVM_OPTS="${JVM_OPTS:-"$JAVA_OPTS"}"
function command_not_found {
>&2 echo "Leiningen couldn't find $1 in your \$PATH ($PATH), which is required."
exit 1
}
if [ -r .lein-fast-trampoline ]; then
export LEIN_FAST_TRAMPOLINE='y'
fi
if [ "$LEIN_FAST_TRAMPOLINE" != "" ] && [ -r project.clj ]; then
INPUTS="$* $(cat project.clj) $(test -f "$LEIN_HOME/profiles.clj" && cat "$LEIN_HOME/profiles.clj")"
if command -v shasum >/dev/null 2>&1; then
SUM="shasum"
elif command -v sha1sum >/dev/null 2>&1; then
SUM="sha1sum"
else
command_not_found "sha1sum or shasum"
fi
INPUT_CHECKSUM=$(echo "$INPUTS" | $SUM | cut -f 1 -d " ")
# Just don't change :target-path in project.clj, mkay?
TRAMPOLINE_FILE="target/trampolines/$INPUT_CHECKSUM"
else
TRAMPOLINE_FILE="$(mktemp /tmp/lein-trampoline-XXXXXXXXXXXXX)"
trap 'rm -f $TRAMPOLINE_FILE' EXIT
fi
if [ "$1" = "upgrade" ]; then
echo "This version of Leiningen was installed with a package manager, but"
echo "the upgrade task is intended for manual installs. Please use your"
echo "package manager's built-in upgrade facilities instead."
exit 1
fi
if [ "$INPUT_CHECKSUM" != "" ] && [ -r "$TRAMPOLINE_FILE" ]; then
if [ -n "$DEBUG" ]; then
echo "Fast trampoline with $TRAMPOLINE_FILE."
fi
exec sh -c "exec $(cat $TRAMPOLINE_FILE)"
else
export TRAMPOLINE_FILE
"$LEIN_JAVA_CMD" \
-Dfile.encoding=UTF-8 \
-Dmaven.wagon.http.ssl.easy=false \
-Dmaven.wagon.rto=10000 \
$LEIN_JVM_OPTS \
-Dleiningen.input-checksum="$INPUT_CHECKSUM" \
-Dleiningen.original.pwd="$ORIGINAL_PWD" \
-Dleiningen.script="$0" \
-classpath "$CLASSPATH" \
clojure.main -m leiningen.core.main "$@"
EXIT_CODE=$?
if [ -r "$TRAMPOLINE_FILE" ] && [ "$LEIN_TRAMPOLINE_WARMUP" = "" ]; then
TRAMPOLINE="$(cat "$TRAMPOLINE_FILE")"
if [ "$INPUT_CHECKSUM" = "" ]; then # not using fast trampoline
rm "$TRAMPOLINE_FILE"
fi
if [ "$TRAMPOLINE" = "" ]; then
exit $EXIT_CODE
else
exec sh -c "exec $TRAMPOLINE"
fi
else
exit $EXIT_CODE
fi
fi

195
lein.1 Normal file
View File

@@ -0,0 +1,195 @@
.\"to render: groff -Tascii -man doc/lein.1 > lein.man"
.TH LEININGEN 1 "2017 August 10"
.SH NAME
lein \- Automate Clojure projects
.SH SYNOPSIS
.B lein
[\fB\-o\fR] [\fB\-U\fR] [\fITASK\fR [\fIARGS\fR]]
.br
.B lein
[\fB\-h\fR|\fB\-\-help\fR]
.br
.B lein
[\fB\-v\fR|\fB\-\-version\fR]
.SH DESCRIPTION
Leiningen is for automating Clojure projects without setting your hair
on fire.
Working on Clojure projects with tools designed for Java can be an
exercise in frustration. With Leiningen, you just write Clojure.
.SH TASKS
.B lein help
will show the complete list of tasks, while
.B lein help TASK
shows usage for a specific one.
.B lein help tutorial
has a detailed walk-through of the various tasks, but the most
commonly-used are:
.RS
.TP
.B lein new NAME
generate a new project skeleton
.TP
.B lein test [TESTS]
run the tests in the TESTS namespaces, or all tests
.TP
.B lein repl
launch an interactive REPL session in a networked REPL server
.TP
.B lein uberjar
package up the project and its dependencies as a standalone .jar file
.TP
.B lein install
install a project into your local repository
.TP
.B lein deploy [REPOSITORY]
deploy a library to a remote repository
.RE
.TP
Other tasks available include:
.RS
.TP
.B lein change
Rewrite project.clj by applying a function.
.TP
.B lein check
Check syntax and warn on reflection.
.TP
.B lein classpath
Print the classpath of the current project.
.TP
.B lein clean
Remove all files from project's target-path.
.TP
.B lein compile
Compile Clojure source into .class files.
.TP
.B lein deps
Download all dependencies.
.TP
.B lein do [TASK], ...
Higher-order task to perform other tasks in succession.
.TP
.B lein jar
Package up all the project's files into a jar file.
.TP
.B lein javac
Compile Java source files.
.TP
.B lein pom
Write a pom.xml file to disk for Maven interoperability.
.TP
.B lein release
Perform :release-tasks.
.TP
.B lein retest
Run only the test namespaces which failed last time around.
.TP
.B lein run
Run a -main function with optional command-line arguments.
.TP
.B lein search
Search remote maven repositories for matching jars.
.TP
.B lein show-profiles
List all available profiles or display one if given an argument.
.TP
.B lein trampoline [TASK]
Run a task without nesting the project's JVM inside Leiningen's.
.TP
.B lein update-in
Perform arbitrary transformations on your project map.
.TP
.B lein vcs
Interact with the version control system.
.TP
.B lein version
Print version for Leiningen and the current JVM.
.TP
.B lein with-profile [PROFILE] [TASK]
Apply the given task with the profile(s) specified.
.RE
.SH OPTIONS
.TP
.BI \-o
Run a task offline.
.TP
.BI \-U
Run a task after forcing update of snapshots.
.TP
.BR \-h ", " \-\-help
Print this help or help for a specific task.
.TP
.BR \-v ", " \-\-version
Print Leiningen's version.
.SH CONFIGURATION
Leiningen reads its configuration from the
.B project.clj
file in your project root. Either use
.B lein new
to create a fresh project from which to work, or see the exhaustive
list of configuration options with
\fBlein help sample\fR.
You can customize your project map further with profiles; see
\fBlein help profiles\fR.
.SH BUGS
Check https://github.com/technomancy/leiningen/issues to see if your
problem is a known issue. If not, please open a new issue on that site
or join the mailing list at
https://www.freelists.org/list/leiningen. Please include the output of
.B lein version
as well as your
.B project.clj
file and as much of the relevant code from your project as possible.
.SH COPYING
Copyright
.if t \(co
.if n (C)
2009-2017 Phil Hagelberg and contributors.
Distributed under the Eclipse Public License, the same as Clojure
uses. See the file /usr/share/doc/leiningen/copyright.
.SH AUTHOR
This manpage is written by Phil Hagelberg <technomancy@gmail.com>

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2fd63f41ae1c688eb1af6c6332dfa2f1314fce23340c0177b14c4b4c0f934846
size 631144

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea7c831a4f5c38b6fc3926c6ad32d1d4b9b91bf830a715ecff5a70a18bda55f8
size 14621704

View File

@@ -1,3 +1,23 @@
-------------------------------------------------------------------
Tue Jul 16 15:00:46 UTC 2019 - mvetter@suse.com
- Update to 2.9.1:
* Fix a bug where provided namespace compilation order was overridden. (Phil Hagelberg)
* Don't emit namespaced maps when merging data readers for uberjar. (Joel Kaasinen)
- Install to correct bash completions path
- Remove suse macros
- Use standalone leiningen
- Add files from upstream:
* bash_completion.bash
* zsh_completion.bash
* lein.1 manpage
* lein-pkg script
-------------------------------------------------------------------
Tue Jul 16 14:06:52 UTC 2019 - mvetter@suse.com
- Remove PKGBUILD
-------------------------------------------------------------------
Thu Feb 19 13:24:55 UTC 2015 - kgronlund@suse.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package leiningen
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,28 +12,28 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# See also http://en.opensuse.org/openSUSE:Specfile_guidelines
Name: leiningen
Version: 2.5.1
Version: 2.9.1
Release: 0
Summary: Automating Clojure projects without setting your hair on fire
License: EPL-1.0
Group: Development/Tools/Building
Url: http://leiningen.org/
Source0: %{name}-%{version}.tar.xz
%if 0%{?suse_version} > 01020
URL: http://leiningen.org/
Source0: https://github.com/technomancy/leiningen/releases/download/%{version}/leiningen-%{version}-standalone.zip
# Following files are taken from the upstream repo in the `doc` and `bin` subfolders:
Source1: lein-pkg
Source2: bash_completion.bash
Source3: zsh_completion.zsh
Source4: lein.1
BuildRequires: fdupes
%endif
Requires: java >= 1.7.0
Requires: clojure >= 1.5.1
%if 0%{?suse_version} > 1110
BuildRequires: unzip
Requires: clojure >= 1.10.0
Requires: java >= 1.8.0
BuildArch: noarch
%endif
%description
Working on Clojure projects with tools designed for Java can be an
@@ -43,26 +43,25 @@ packaging your projects and can be easily extended with a number of
plugins.
%prep
%setup -q
%build
%install
install -m 0755 -D ./bin/lein %{buildroot}%{_bindir}/lein
install -m 0644 -D ./doc/lein.1 %{buildroot}%{_mandir}/man1/lein.1
install -m 0644 -D ./zsh_completion.zsh %{buildroot}%{_sysconfdir}/zsh_completion.d/_lein
install -m 0644 -D ./bash_completion.bash %{buildroot}%{_sysconfdir}/bash_completion.d/lein.sh
#LEIN_JAR=
mkdir -p %{buildroot}%{_datadir}/java/
install -m 0644 -D %{SOURCE0} %{buildroot}%{_datadir}/java/leiningen-%{version}-standalone.jar
install -m 0755 -D %{SOURCE1} %{buildroot}%{_bindir}/lein
install -m 0644 -D %{SOURCE2} %{buildroot}%{_datadir}/bash-completion/completions/lein
install -m 0644 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/zsh_completion.d/_lein
install -m 0644 -D %{SOURCE4} %{buildroot}%{_mandir}/man1/lein.1
%if 0%{?suse_version} > 01020
%fdupes %{buildroot}
%endif
%files
%defattr(-,root,root)
%{_bindir}/lein
%doc %{_mandir}/man1/lein*
%config %{_sysconfdir}/bash_completion.d/*.sh
%config %{_sysconfdir}/zsh_completion.d
%{_mandir}/man1/lein*
%{_datadir}/bash-completion/completions/lein
%{_sysconfdir}/zsh_completion.d
%{_datadir}/java/leiningen-2.9.1-standalone.jar
%changelog

View File

@@ -13,32 +13,35 @@ _lein() {
_call_function 1 _lein_${words[1]}
else
_values "lein command" \
"check[Check syntax and warn on reflection.]" \
"classpath[Print the classpath of the current project.]" \
"clean[Remove all files from project's target-path.]" \
"compile[Compile Clojure source into \.class files.]" \
"deploy[Build jar and deploy to remote repository.]" \
"deps[Download :dependencies.]" \
"help[Display a list of tasks or help for a given task.]" \
"install[Install current project to the local repository.]" \
"jack-in[Jack in to a Clojure SLIME session from Emacs.]" \
"jar[Package up all the project's files into a jar file.]" \
"javac[Compile Java source files.]" \
"new[Create a new project skeleton.]" \
"plugin[Manage user-level plugins.]" \
"pom[Write a pom.xml file to disk for Maven interoperability.]" \
"profiles[List all available profiles or display one if given an argument.]" \
"repl[Start a repl session either with the current project or standalone.]" \
"retest[Run only the test namespaces which failed last time around.]" \
"run[Run the project's -main function.]" \
"search[Search remote repositories.]" \
"swank[Launch swank server for Emacs to connect.]" \
"test[Run the project's tests.]" \
"trampoline[Run a task without nesting the project's JVM inside Leiningen's.]" \
"uberjar[Package up the project files and all dependencies into a jar file.]" \
"upgrade[Upgrade Leiningen to the latest stable release.]" \
"version[Print version for Leiningen and the current JVM.]" \
"with-profile[Apply the given task with the profile(s) specified.]"
"change[Rewrite project.clj by applying a function.]" \
"check[Check syntax and warn on reflection.]" \
"classpath[Print the classpath of the current project.]" \
"clean[Remove all files from project's target-path.]" \
"compile[Compile Clojure source into .class files.]" \
"deploy[Build and deploy jar to remote repository.]" \
"deps[Download all dependencies.]" \
"do[Higher-order task to perform other tasks in succession.]" \
"help[Display a list of tasks or help for a given task.]" \
"install[Install the current project to the local repository.]" \
"jar[Package up all the project's files into a jar file.]" \
"javac[Compile Java source files.]" \
"new[Generate project scaffolding based on a template.]" \
"plugin[DEPRECATED. Please use the :user profile instead.]" \
"pom[Write a pom.xml file to disk for Maven interoperability.]" \
"release[Perform :release-tasks.]" \
"repl[Start a repl session either with the current project or standalone.]" \
"retest[Run only the test namespaces which failed last time around.]" \
"run[Run a -main function with optional command-line arguments.]" \
"search[Search remote maven repositories for matching jars.]" \
"show-profiles[List all available profiles or display one if given an argument.]" \
"test[Run the project's tests.]" \
"trampoline[Run a task without nesting the project's JVM inside Leiningen's.]" \
"uberjar[Package up the project files and dependencies into a jar file.]" \
"update-in[Perform arbitrary transformations on your project map.]" \
"upgrade[Upgrade Leiningen to specified version or latest stable.]" \
"vcs[Interact with the version control system.]" \
"version[Print version for Leiningen and the current JVM.]" \
"with-profile[Apply the given task with the profile(s) specified.]"
fi
}
@@ -50,12 +53,13 @@ _lein_plugin() {
_lein_namespaces() {
if [ -d test ]; then
_values "lein valid namespaces" $(find $1 -type f -name "*.clj" -exec grep -E \
'^\(ns[[:space:]]+\w+' '{}' ';' | awk '/\(ns[ ]*([A-Za-z\.]+)/ {print $2}')
fi
if [ -f "./project.clj" -a -d "$1" ]; then
_values "lein valid namespaces" \
$(find "$1" -type f -name "*.clj" -exec awk '/^\(ns */ {gsub("\\)", "", $2); print $2}' '{}' '+')
fi
}
_lein_run() {
_lein_namespaces "src/"
}