Update to current packaging guidelines

- Resolves: rhbz#976723
This commit is contained in:
Mikolaj Izdebski 2014-05-12 14:33:25 +02:00
parent 3cb8bec128
commit 46cf7cc7a4

View File

@ -1,51 +1,17 @@
# Copyright (c) 2000-2005, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "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 COPYRIGHT
# OWNER OR CONTRIBUTORS 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.
#
%global full_name jakarta-%{name}
Name: regexp
Version: 1.5
Release: 14%{dist}
Epoch: 0
Release: 15%{dist}
Summary: Simple regular expressions API
License: ASL 2.0
Group: Development/Libraries/Java
Url: http://jakarta.apache.org/%{name}/
Source0: http://www.apache.org/dist/jakarta/regexp/jakarta-regexp-%{version}.tar.gz
Source1: http://repo.maven.apache.org/maven2/%{full_name}/%{full_name}/1.4/%{full_name}-1.4.pom
BuildRequires: jpackage-utils >= 0:1.6
Requires: java-headless
BuildRequires: ant >= 1.6
URL: http://jakarta.apache.org/%{name}/
BuildArch: noarch
Source0: http://archive.apache.org/dist/jakarta/%{name}/jakarta-%{name}-%{version}.tar.gz
BuildRequires: ant
Requires: java-headless
%description
Regexp is a 100% Pure Java Regular Expression package that was
graciously donated to the Apache Software Foundation by Jonathan Locke.
@ -55,21 +21,19 @@ It includes complete Javadoc documentation as well as a simple Applet
for visual debugging and testing suite for compatibility.
%package javadoc
Group: Development/Java
Summary: Javadoc for %{name}
%description javadoc
Javadoc for %{name}.
%prep
%setup -q -n %{full_name}-%{version}
%setup -q -n jakarta-%{name}-%{version}
# remove all binary libs
find . -name "*.jar" -exec rm -f {} \;
%build
mkdir lib
ant -Djakarta-site2.dir=. jar javadocs
%ant -Djakarta-site2.dir=. jar javadocs
%install
# jars
@ -77,29 +41,32 @@ install -d -m 755 %{buildroot}%{_javadir}
install -m 644 build/*.jar %{buildroot}%{_javadir}/%{name}.jar
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
cp -r docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr docs/api/* %{buildroot}%{_javadocdir}/%{name}
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -p -m 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap -a regexp:regexp
%add_maven_depmap jakarta-%{name}:jakarta-%{name}:%{version} -a %{name}:%{name} %{name}.jar
%check
ant -Djakarta-site2.dir=. test
%ant -Djakarta-site2.dir=. test
%files
# Workaround for RPM bug #646523 - can't change symlink to directory
# TODO: Remove this in F-23
%pretrans javadoc -p <lua>
dir = "%{_javadocdir}/%{name}"
dummy = posix.readlink(dir) and os.remove(dir)
%files -f .mfiles
%doc LICENSE
%{_javadir}/%{name}.jar
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%files javadoc
%doc LICENSE
%{_javadocdir}/%{name}-%{version}
%doc %{_javadocdir}/%{name}
%{_javadocdir}/%{name}
%changelog
* Mon May 12 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5-15
- Update to current packaging guidelines
- Resolves: rhbz#976723
* Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0:1.5-14
- Use Requires: java-headless rebuild (#1067528)