Accepting request 871432 from Java:packages

Add OSGi manifest

OBS-URL: https://build.opensuse.org/request/show/871432
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/apache-commons-cli?expand=0&rev=13
This commit is contained in:
Dominique Leuenberger 2021-02-15 22:16:23 +00:00 committed by Git OBS Bridge
commit b510b4b6bf
4 changed files with 144 additions and 16 deletions

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="commons-cli" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property name="build.finalName" value="commons-cli-1.4"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir" value="."/>
<property name="build.testOutputDir" value="${build.dir}/test-classes"/>
<property name="build.testDir" value="src/test/java"/>
<property name="build.testResourceDir" value="src/test/resources"/>
<property name="test.reports" value="${build.dir}/test-reports"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
<!-- Defining classpaths -->
<!-- ====================================================================== -->
<path id="build.classpath"/>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
<!-- ====================================================================== -->
<target name="clean" description="Clean the output directory">
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Compilation target -->
<!-- ====================================================================== -->
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
encoding="iso-8859-1"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="6"
verbose="false"
fork="false"
source="6">
<src>
<pathelement location="${build.srcDir}"/>
</src>
<classpath refid="build.classpath"/>
</javac>
<mkdir dir="${build.outputDir}/META-INF"/>
<copy todir="${build.outputDir}/META-INF">
<fileset dir="${build.resourceDir}">
<include name="NOTICE.txt"/>
<include name="LICENSE.txt"/>
</fileset>
</copy>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${build.srcDir}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
old="false"
verbose="false"
encoding="iso-8859-1"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
charset="ISO-8859-1"
source="6"
linksource="true"
breakiterator="false">
<link href="http://java.sun.com/javase/6/docs/api/"/>
</javadoc>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="compile" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html">
<manifest>
<attribute name="Bundle-Description" value="Apache Commons CLI provides a simple API for presenting, processing and validating a command line interface."/>
<attribute name="Bundle-DocURL" value="http://commons.apache.org/proper/commons-cli/"/>
<attribute name="Bundle-License" value="https://www.apache.org/licenses/LICENSE-2.0.txt"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="Apache Commons CLI"/>
<attribute name="Bundle-SymbolicName" value="org.apache.commons.cli"/>
<attribute name="Bundle-Vendor" value="The Apache Software Foundation"/>
<attribute name="Bundle-Version" value="1.4.0"/>
<attribute name="Export-Package" value="org.apache.commons.cli;version=&quot;1.4&quot;"/>
<attribute name="Implementation-Title" value="Apache Commons CLI"/>
<attribute name="Implementation-Vendor-Id" value="org.apache"/>
<attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Version" value="1.4"/>
<attribute name="Include-Resource" value="META-INF/NOTICE.txt=NOTICE.txt,META-INF/LICENSE.txt=LICENSE.txt"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=1.6))&quot;"/>
<attribute name="Specification-Title" value="Apache Commons CLI"/>
<attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<attribute name="Specification-Version" value="1.4"/>
</manifest>
</jar>
</target>
</project>

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Feb 12 12:54:07 UTC 2021 - Fridrich Strba <fstrba@suse.com>
- Add OSGi manifest to the build files.
- Set java source/target levels to 6
-------------------------------------------------------------------
Mon Mar 25 17:19:16 UTC 2019 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package apache-commons-cli
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -26,17 +26,15 @@ License: Apache-2.0
Group: Development/Libraries/Java
URL: http://commons.apache.org/%{base_name}/
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
Source1: build.xml.tar.bz2
Source1: %{name}-build.xml
Patch0: CLI-253-workaround.patch
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
Requires: java >= 1.8
Provides: jakarta-%{short_name} = %{version}-%{release}
Obsoletes: jakarta-%{short_name} < %{version}
Provides: apache-cli = %{version}
Obsoletes: apache-cli < %{version}
Obsoletes: jakarta-%{short_name} < %{version}-%{release}
Provides: apache-cli = %{version}-%{release}
Obsoletes: apache-cli < %{version}-%{release}
BuildArch: noarch
%description
@ -46,22 +44,21 @@ command line arguments and options.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
Provides: jakarta-%{short_name}-javadoc = %{version}
Obsoletes: jakarta-%{short_name}-javadoc < %{version}
Provides: jakarta-%{short_name}-javadoc = %{version}-%{release}
Obsoletes: jakarta-%{short_name}-javadoc < %{version}-%{release}
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{short_name}-%{version}-src -a1
%setup -q -n %{short_name}-%{version}-src
cp %{SOURCE1} build.xml
%patch0 -p1
%pom_remove_parent
%build
ant -Dmaven.mode.offline=true package javadoc \
-Dmaven.test.skip=true \
-lib %{_datadir}/java
%ant package javadoc
%install
# jars

View File

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