File maven.spec of Package maven
#
# spec file for package maven
#
# Copyright (c) 2015 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# 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/
#
Name: maven
Version: 3.3.9
Release: 0
Summary: Maven is a software project management and comprehension tool
License: Apache-2.0
Group: Development/Tools/Building
Url: http://maven.apache.org
Source: http://www.eu.apache.org/dist/maven/maven-3/%{version}/binaries/apache-maven-%{version}-bin.tar.gz
Source1: mvn-bash-completion.sh
Source2: https://www.eu.apache.org/dist/maven/maven-3/%{version}/binaries/apache-maven-%{version}-bin.tar.gz.asc
Source3: https://www.apache.org/dist/maven/KEYS#/%{name}.keyring
BuildRequires: dos2unix
BuildRequires: unzip
%if 0%{?suse_version}
BuildRequires: fdupes
%endif
Requires: java >= 1.6
# Bugfix broken dependencies
%if 0%{?centos_version} == 505 || 0%{?rhel_version} == 505
# maven needs /usr/bin/which to run, but that is not in util-linux on centos5
Requires: which
%endif
%if 0%{?suse_version} == 1110
# SLES-11: maven-wagon needs /usr/lib/libnss3.so, which is not installed by default
Requires: libnss3.so
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
A software project management and comprehension tool.
Based on the concept of a project object model (POM), Maven can
manage a project's build, reporting and documentation from a
central piece of information
%prep
%setup -q -n apache-maven-%{version}
for winfile in conf/settings.xml bin/m2.conf lib/ext/README.txt; do
dos2unix $winfile
chmod a-x $winfile
done
%build
%install
%if 0%{?suse_version} == 1110
# SLE11: https://en.opensuse.org/openSUSE:Packaging_Java#bytecode_version_error
export NO_BRP_CHECK_BYTECODE_VERSION=true
%endif
install -d %{buildroot}%{_datadir}/java/maven/bin
install -p bin/m2.conf %{buildroot}%{_datadir}/java/maven/bin
install -p bin/mvn %{buildroot}%{_datadir}/java/maven/bin
install -p bin/mvnDebug %{buildroot}%{_datadir}/java/maven/bin
install -p bin/mvnyjp %{buildroot}%{_datadir}/java/maven/bin
install -d %{buildroot}%{_datadir}/java/maven/lib
cp -R lib/* %{buildroot}%{_datadir}/java/maven/lib
%if 0%{?suse_version}
# create hardlinks for license files to avoid rpmlint error:E: files-duplicated-waste
%fdupes %{buildroot}%{_datadir}/java/maven/lib
%endif
install -d %{buildroot}%{_datadir}/java/maven/conf
cp -R conf/* %{buildroot}%{_datadir}/java/maven/conf
install -d %{buildroot}%{_datadir}/java/maven/boot
install -p boot/* %{buildroot}%{_datadir}/java/maven/boot
install -d %{buildroot}%{_prefix}/bin
for binary in mvn mvnDebug mvnyjp; do
ln -s %{_datadir}/java/maven/bin/$binary %{buildroot}%{_bindir}/
done
install -d %{buildroot}%{_sysconfdir}/bash_completion.d/
install -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/bash_completion.d/mvn.sh
%files
%defattr(-,root,root)
%{_datadir}/java/maven/
%{_bindir}/mvn
%{_bindir}/mvnDebug
%{_bindir}/mvnyjp
%config %{_sysconfdir}/bash_completion.d/mvn.sh
%changelog