Sync from SUSE:SLFO:Main felix-bundlerepository revision 6ec4cc2ec564e95f2d02e7ca07f9fb9f

This commit is contained in:
Adrian Schröter 2024-05-03 12:26:29 +02:00
commit ebad38b19c
7 changed files with 384 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,53 @@
From 0dbf23a1e17d88b06bd6a7b39d686f1efe6179a6 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 30 Apr 2012 20:25:01 +0200
Subject: [PATCH 1/2] Unbundle libraries
---
pom.xml | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/pom.xml b/pom.xml
index 745b6f7..a111f55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,13 +69,6 @@
<groupId>net.sf.kxml</groupId>
<artifactId>kxml2</artifactId>
<version>2.3.0</version>
- <optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>xmlpull</groupId>
- <artifactId>xmlpull</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
@@ -123,18 +116,16 @@
org.osgi.service.repository,
org.apache.felix.bundlerepository;version="2.1"
</Export-Package>
- <Private-Package>
- org.kxml2.io,
- org.xmlpull.v1,
- org.apache.felix.bundlerepository.impl.*,
- org.apache.felix.utils.*
- </Private-Package>
<!-- The org.osgi.service.repository;resolution:=mandatory seems strange below, but otherwise the maven-bundle-plugin
will make that import optional, which we don't want... -->
<!-- The version range on org.osgi.service.repository is required as we are a provider of the 1.0.0 API. -->
<Import-Package>
!javax.xml.parsers,
!org.xml.sax,
+ org.kxml2.io;resolution=mandatory,
+ org.xmlpull.v1;resolution=mandatory,
+ org.apache.felix.utils.*;resolution=mandatory,
+ org.apache.felix.bundlerepository.impl.*;resolution:=mandatory,
org.osgi.service.repository;resolution:=mandatory;version="[1.0,1.1)",
org.osgi.service.log;resolution:=optional,
org.osgi.service.obr;resolution:=optional,
--
2.9.3

View File

@ -0,0 +1,45 @@
From 6c8fc9626ef548192849fe8a4dc12f188614027b Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Fri, 18 Nov 2016 16:04:38 +0100
Subject: [PATCH 2/2] Compatibility with osgi r6
---
.../felix/bundlerepository/impl/OSGiRepositoryImpl.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/main/java/org/apache/felix/bundlerepository/impl/OSGiRepositoryImpl.java b/src/main/java/org/apache/felix/bundlerepository/impl/OSGiRepositoryImpl.java
index 38d9cab..9e523e0 100644
--- a/src/main/java/org/apache/felix/bundlerepository/impl/OSGiRepositoryImpl.java
+++ b/src/main/java/org/apache/felix/bundlerepository/impl/OSGiRepositoryImpl.java
@@ -42,7 +42,11 @@ import org.osgi.resource.Capability;
import org.osgi.resource.Namespace;
import org.osgi.resource.Requirement;
import org.osgi.service.repository.ContentNamespace;
+import org.osgi.service.repository.ExpressionCombiner;
import org.osgi.service.repository.Repository;
+import org.osgi.service.repository.RequirementBuilder;
+import org.osgi.service.repository.RequirementExpression;
+import org.osgi.util.promise.Promise;
class OSGiRepositoryImpl implements Repository
{
@@ -179,4 +183,16 @@ class OSGiRepositoryImpl implements Repository
}
return sb.toString();
}
+
+ public Promise<Collection<org.osgi.resource.Resource>> findProviders(RequirementExpression re) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public ExpressionCombiner getExpressionCombiner() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public RequirementBuilder newRequirementBuilder(String string) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
--
2.9.3

View File

@ -0,0 +1,9 @@
-------------------------------------------------------------------
Fri Mar 18 15:00:55 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Intial packaging of felix-bundlerepository 2.0.10
- Added patches:
* 0001-Unbundle-libraries.patch
+ Use system jars instead of bundling them in a fat jar
* 0002-Compatibility-with-osgi-r6.patch
+ Allow building with newer osgi-core/osgi-compendium

110
felix-bundlerepository.spec Normal file
View File

@ -0,0 +1,110 @@
#
# spec file for package felix-bundlerepository
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%global bundle org.apache.felix.bundlerepository
Name: felix-bundlerepository
Version: 2.0.10
Release: 0
Summary: Bundle repository service
License: Apache-2.0 AND MIT
URL: https://felix.apache.org/documentation/subprojects/apache-felix-osgi-bundle-repository.html
Source0: https://archive.apache.org/dist/felix/%{bundle}-%{version}-source-release.tar.gz
Source1: %{bundle}-build.xml
Patch1: 0001-Unbundle-libraries.patch
Patch2: 0002-Compatibility-with-osgi-r6.patch
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: felix-gogo-runtime
BuildRequires: felix-osgi-obr
BuildRequires: felix-shell
BuildRequires: felix-utils
BuildRequires: javapackages-local
BuildRequires: kxml
BuildRequires: osgi-compendium
BuildRequires: osgi-core
BuildRequires: xpp3
Requires: mvn(net.sf.kxml:kxml2)
Requires: mvn(org.apache.felix:org.apache.felix.utils)
Requires: mvn(org.osgi:osgi.cmpn)
Requires: mvn(org.osgi:osgi.core)
Requires: mvn(xpp3:xpp3)
BuildArch: noarch
%description
Bundle repository service
%package javadoc
Summary: API documentation for %{name}
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{bundle}-%{version}
cp %{SOURCE1} build.xml
%patch1 -p1
%patch2 -p1
%pom_remove_plugin :maven-source-plugin
# Unbundle xpp3
%pom_add_dep "xpp3:xpp3:1.1.3.4.O" pom.xml
# Make felix utils mandatory dep
%pom_xpath_remove "pom:dependency[pom:artifactId[text()='org.apache.felix.utils']]/pom:optional"
%pom_change_dep :easymock :::test
# Removing and adding is necessary (order matters)
%pom_remove_dep :org.osgi.core
%pom_add_dep org.osgi:osgi.core
%pom_remove_dep :org.osgi.compendium
%pom_add_dep org.osgi:osgi.cmpn
%pom_remove_parent
%pom_xpath_inject pom:project "<groupId>org.apache.felix</groupId>"
%build
mkdir -p lib
build-jar-repository -s lib osgi-core osgi-compendium xpp3 kxml felix
%{ant} package javadoc
%install
# jar
install -d -m 755 %{buildroot}%{_javadir}/felix
install -m 644 target/%{bundle}-%{version}.jar %{buildroot}%{_javadir}/felix/%{bundle}.jar
# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}/felix
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/felix/%{bundle}.pom
%add_maven_depmap felix/%{bundle}.pom felix/%{bundle}.jar
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -r target/site/apidocs/* %{buildroot}/%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
%license LICENSE LICENSE.kxml2 NOTICE
%doc DEPENDENCIES
%files javadoc
%{_javadocdir}/%{name}
%license LICENSE LICENSE.kxml2 NOTICE
%changelog

Binary file not shown.

View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="org.apache.felix.bundlerepository" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property file="build.properties"/>
<property name="project.groupId" value="org.apache.felix"/>
<property name="project.artifactId" value="org.apache.felix.bundlerepository"/>
<property name="project.version" value="2.0.10"/>
<property name="compiler.source" value="1.8"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
<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="src/main/resources"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
<!-- Defining classpaths -->
<!-- ====================================================================== -->
<path id="build.classpath">
<fileset dir="lib">
<include name="**/*"/>
</fileset>
</path>
<!-- ====================================================================== -->
<!-- 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="UTF-8"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
</src>
<classpath refid="build.classpath"/>
</javac>
<copy todir="${build.outputDir}">
<fileset dir="${build.resourceDir}"/>
</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"
verbose="false"
encoding="UTF-8"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
charset="UTF-8"
linksource="false"
breakiterator="false"
source="${compiler.source}">
<classpath refid="build.classpath"/>
</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-Activator" value="org.apache.felix.bundlerepository.impl.Activator"/>
<attribute name="Bundle-Description" value="Bundle-Description Bundle repository service."/>
<attribute name="Bundle-DocURL" value="http://felix.apache.org/site/apache-felix-osgi-bundle-repository.html"/>
<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 Felix Bundle Repository"/>
<attribute name="Bundle-Source" value="http://felix.apache.org/site/downloads.cgi"/>
<attribute name="Bundle-SymbolicName" value="${project.artifactId}"/>
<attribute name="Bundle-Url" value="http://felix.apache.org/site/downloads.cgi"/>
<attribute name="Bundle-Vendor" value="The Apache Software Foundation"/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="DynamicImport-Package" value="org.apache.felix.service.command,org.apache.felix.shell"/>
<attribute name="Export-Package" value="org.apache.felix.bundlerepository;uses:=&quot;org.osgi.framework&quot;;version=&quot;2.1&quot;,org.osgi.service.repository;uses:=&quot;org.osgi.resource,org.osgi.util.promise&quot;;version=&quot;1.1&quot;"/>
<attribute name="Export-Service" value="org.apache.felix.bundlerepository.RepositoryAdmin,org.osgi.service.obr.RepositoryAdmin"/>
<attribute name="Import-Package" value="java.io,java.lang,java.lang.reflect,java.net,java.security,java.text,java.util,java.util.concurrent,java.util.jar,java.util.regex,java.util.zip,javax.xml.stream;resolution:=optional,org.apache.felix.bundlerepository;version=&quot;[2.1,3)&quot;,org.apache.felix.service.command;resolution:=optional;version=&quot;[1.0,2)&quot;,org.apache.felix.shell;resolution:=optional;version=&quot;[1.0,2)&quot;,org.apache.felix.utils.collections;resolution=mandatory,org.apache.felix.utils.filter;resolution=mandatory,org.apache.felix.utils.log;resolution=mandatory,org.apache.felix.utils.manifest;resolution=mandatory,org.apache.felix.utils.version;resolution=mandatory,org.kxml2.io;resolution=mandatory;version=&quot;[2.3,3)&quot;,org.osgi.framework.wiring;version=&quot;[1.2,2)&quot;,org.osgi.framework;version=&quot;[1.10,1.11)&quot;,org.osgi.resource;version=&quot;[1.0,2)&quot;,org.osgi.service.log;resolution:=optional;version=&quot;[1.4,2)&quot;,org.osgi.service.obr;resolution:=optional;version=&quot;[1.0,2)&quot;,org.osgi.service.repository;resolution:=mandatory;version=&quot;[1.0,1.1)&quot;,org.osgi.service.url;version=&quot;[1.0,2)&quot;,org.osgi.util.promise;version=&quot;[1.1,2)&quot;,org.xmlpull.v1;resolution=mandatory"/>
<attribute name="JavaPackages-ArtifactId" value="${project.artifactId}"/>
<attribute name="JavaPackages-GroupId" value="${project.groupId}"/>
<attribute name="JavaPackages-Version" value="${project.version}"/>
<attribute name="Provide-Capability" value="osgi.implementation;uses:=&quot;org.osgi.service.repository&quot;;osgi.implementation=&quot;osgi.repository&quot;;version=&quot;1.1&quot;,osgi.service;uses:=&quot;org.osgi.service.repository&quot;;objectClass=&quot;org.osgi.service.repository.Repository&quot;"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=${compiler.target}))&quot;"/>
</manifest>
</jar>
</target>
<!-- ====================================================================== -->
<!-- A dummy target for the package named after the type it creates -->
<!-- ====================================================================== -->
<target name="jar" depends="package" description="Builds the jar for the application"/>
</project>