diff --git a/SOURCES/0_bundle-packaging.patch b/SOURCES/0_bundle-packaging.patch
new file mode 100644
index 0000000..54fe271
--- /dev/null
+++ b/SOURCES/0_bundle-packaging.patch
@@ -0,0 +1,32 @@
+diff --git a/core/pom.xml b/core/pom.xml
+index cd0293e..6d4276e 100644
+--- a/core/pom.xml
++++ b/core/pom.xml
+@@ -46,7 +46,7 @@
+
+
+ encoder
+- jar
++ bundle
+
+ Java Encoder
+
+@@ -67,6 +67,18 @@
+
+
+
++
++ org.apache.felix
++ maven-bundle-plugin
++ 4.2.1
++ true
++
++
++ org.owasp.encoder
++ org.owasp.encoder
++
++
++
+
+
+
diff --git a/SOURCES/0_manifest.patch b/SOURCES/0_manifest.patch
deleted file mode 100644
index 51e7b76..0000000
--- a/SOURCES/0_manifest.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Nur owasp-java-encoder-1.2.1-orig/META-INF/MANIFEST.MF owasp-java-encoder-1.2.1/META-INF/MANIFEST.MF
---- owasp-java-encoder-1.2.1-orig/META-INF/MANIFEST.MF 1969-12-31 19:00:00.000000000 -0500
-+++ owasp-java-encoder-1.2.1/META-INF/MANIFEST.MF 2018-08-07 11:59:15.923471361 -0400
-@@ -0,0 +1,8 @@
-+Manifest-Version: 1.0
-+Bnd-LastModified: 1533328833261
-+Bundle-ManifestVersion: 2
-+Bundle-Name: org.owasp.encoder
-+Bundle-SymbolicName: org.owasp.encoder
-+Created-By: 1.8.0_181 (Oracle Corporation)
-+Export-Package: org.owasp.encoder
-+Tool: Bnd-1.50.0
diff --git a/SOURCES/1_update-compiler-plugin-version.patch b/SOURCES/1_update-compiler-plugin-version.patch
new file mode 100644
index 0000000..fda4c5c
--- /dev/null
+++ b/SOURCES/1_update-compiler-plugin-version.patch
@@ -0,0 +1,15 @@
+diff --git a/pom.xml b/pom.xml
+index d81ad2c..fe27928 100755
+--- a/pom.xml
++++ b/pom.xml
+@@ -261,8 +261,8 @@
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+-
+- 1.5
++
++ 1.8
+
+
+
diff --git a/SPECS/owasp-java-encoder.spec b/SPECS/owasp-java-encoder.spec
index ff3eae6..1ce767a 100644
--- a/SPECS/owasp-java-encoder.spec
+++ b/SPECS/owasp-java-encoder.spec
@@ -1,6 +1,6 @@
Name: owasp-java-encoder
Version: 1.2.2
-Release: 3%{?dist}
+Release: 6%{?dist}.alma
Summary: Collection of high-performance low-overhead contextual encoders
License: BSD
@@ -8,15 +8,17 @@ URL: https://github.com/OWASP/owasp-java-encoder/
Source0: https://github.com/OWASP/owasp-java-encoder/archive/v%{version}.tar.gz
-# add OSGi metadata
-Patch0: 0_manifest.patch
+# package as a bundle instead of a jar
+Patch0: 0_bundle-packaging.patch
+# source/target option of 1.5 not compatible with maven-compiler-plugin 3.8.1 >= in f33
+Patch1: 1_update-compiler-plugin-version.patch
BuildArch: noarch
-ExclusiveArch: x86_64
BuildRequires: maven-local
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
-BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
+BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
+BuildRequires: junit
%description
The OWASP Encoders package is a collection of high-performance low-overhead
@@ -34,9 +36,7 @@ Summary: Javadoc for %{name}
%setup -q
%patch0 -p1
-
-# add version number in OSGi metadata
-sed -i '/^Bundle-SymbolicName: org.owasp.encoder$/a Bundle-Version: %{version}' %{_builddir}/%{name}-%{version}/META-INF/MANIFEST.MF
+%patch1 -p1
%pom_disable_module jsp
%pom_disable_module esapi
@@ -46,12 +46,11 @@ sed -i '/^Bundle-SymbolicName: org.owasp.encoder$/a Bundle-Version: %{version}'
# analysis tool for testing coverage is not required
%pom_remove_plugin :cobertura-maven-plugin
+%pom_remove_parent
+
%build
%mvn_build
-# inject OSGi manifest
-jar ufm %{_builddir}/%{name}-%{version}/core/target/encoder-%{version}.jar %{_builddir}/%{name}-%{version}/META-INF/MANIFEST.MF
-
%install
%mvn_install
@@ -64,8 +63,22 @@ jar ufm %{_builddir}/%{name}-%{version}/core/target/encoder-%{version}.jar %{_bu
%license LICENSE
%changelog
-* Thu Mar 04 2021 Alex Macdonald - 1.2.2-3
-- Add ExclusiveArch: x86_64
+* Tue Mar 01 2021 Eduard Abdullin - 1.2.2-6.alma
+- Add junit to BR
+
+* Fri Apr 16 2021 Mohan Boddu - 1.2.2-6
+- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
+
+* Tue Jan 26 2021 Fedora Release Engineering - 1.2.2-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
+
+* Mon Sep 21 2020 Jie Kang - 1.2.2-4
+- Remove deprecated dependency: sonatype-oss-parent
+
+* Tue Aug 18 2020 Alex Macdonald - 1.2.2-3
+- Remove osgi metadata patch0 that previously added a manifest
+- Include patch (courtesy of jkang) to package as a bundle instead of a jar
+- Update maven-compiler-plugin source/target version for builds in f33
* Tue May 28 2019 Jie Kang -1.2.2-2
- Remove unnecessary javadoc plugin for Fedora builds