Browse Source

d/apache-maven: Added apache-maven-3.3.9.

slackware-14.2
Damien Goutte-Gattat 5 years ago
parent
commit
87d8a9f6de
  1. 1
      d/apache-maven/apache-maven-3.3.9-src.zip.sha1
  2. 99
      d/apache-maven/apache-maven.SlackBuild
  3. 6
      d/apache-maven/m2.conf
  4. 43
      d/apache-maven/mvn.sh
  5. 12
      d/apache-maven/slack-desc

1
d/apache-maven/apache-maven-3.3.9-src.zip.sha1

@ -0,0 +1 @@
2b783992afcba54255f46508d582fe656e2c37dc apache-maven-3.3.9-src.zip

99
d/apache-maven/apache-maven.SlackBuild

@ -0,0 +1,99 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2017 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest apache-maven sourcecode is available at:
# <http://maven.apache.org/>.
#
# Depends: d/apache-ant
# Source package infos
NAMESRC=${NAMESRC:-apache-maven}
VERSION=${VERSION:-3.3.9}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION-src.zip}
WGET=${WGET:-http://wwwftp.ciril.fr/pub/apache/maven/maven-3/$VERSION/source/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-apache-maven}
BUILD=${BUILD:-1GGD}
ARCH=noarch
EXT=${EXT:-txz}
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMEPKG}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
# Sanity checks
if [ $UID -eq 0 ]; then
echo "You should NOT run this script as ROOT!"
exit 1
fi
if [ ! -d $TMP ]; then
echo "$TMP does not exists or is not a directory!"
exit 1
fi
# Get and verify the source archive
if [ ! -r $ARCHIVE ]; then
wget -c -O $ARCHIVE.part "$WGET"
mv $ARCHIVE.part $ARCHIVE
fi
sha1sum -c $ARCHIVE.sha1
NAME=$NAMESRC-$VERSION
# Compile
cd $TMP
echo "Building $ARCHIVE..."
unzip $CWD/$ARCHIVE
cd $NAME
ant -Dmaven.home=$PKG/usr/lib/apache-maven
rm -rf $PKG/usr/lib/apache-maven/bin
install -m 644 $CWD/m2.conf $PKG/usr/lib/apache-maven/m2.conf
install -D -m 755 $CWD/mvn.sh $PKG/usr/bin/mvn
# Install the documentation
mkdir -p $PKG/usr/doc/$NAME
mv $PKG/usr/lib/apache-maven/{LICENSE,NOTICE,README.txt} $PKG/usr/doc/$NAME
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# Package the tree
cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
rm -rf $PKG
rm -rf $TMP/$NAME
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi

6
d/apache-maven/m2.conf

@ -0,0 +1,6 @@
main is org.apache.maven.cli.MavenCli from plexus.core
[plexus.core]
optionally /usr/lib/apache-maven/lib/ext/*.jar
load /usr/lib/apache-maven/lib/*.jar
load /usr/lib/apache-maven/conf/logging

43
d/apache-maven/mvn.sh

@ -0,0 +1,43 @@
#!/bin/bash
# Helper functions
find_maven_basedir() {
local basedir
local wdir
basedir="$(pwd)"
wdir="$(pwd)"
while [ "$wdir" != '/' ]; do
if [ -d "$wdir"/.mvn ]; then
basedir=$wdir
break
fi
wdir="$(cd "$wdir/.."; pwd)"
done
echo "${basedir}"
}
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
# Look for RC files in XDG directories
for dir in $(echo ${XDG_CONFIG_DIRS:-/etc/xdg} | tr ':' ' ') ${XDG_CONFIG_HOME:-$HOME/.config} ; do
if [ -f $dir/maven/maven.rc ]; then
. $dir/maven/maven.rc
fi
done
MAVEN_PROJECTBASEDIR="${MAVEN_PROJECTBASEDIR:-$(find_maven_basedir)}"
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
export MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
exec java \
$MAVEN_OPTS $MAVEN_DEBUG_OPTS \
-classpath /usr/lib/apache-maven/boot/plexus-classworlds-*.jar \
-Dclassworlds.conf=/usr/lib/apache-maven/m2.conf \
-Dmaven.home=/usr/lib/apache-maven \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
org.codehaus.plexus.classworlds.launcher.Launcher \
"$@"

12
d/apache-maven/slack-desc

@ -0,0 +1,12 @@
|-----handy-ruler-----------------------------------------------------|
apache-maven: apache-maven (software project management tool)
apache-maven:
apache-maven: Apache Maven is a software project management and comprehension
apache-maven: tool. Based on the concept of a project object model (POM), Maven
apache-maven: can manage a project's build, report and documentation from a
apache-maven: central piece of information.
apache-maven:
apache-maven:
apache-maven:
apache-maven:
apache-maven:
Loading…
Cancel
Save