From 5ee2f9329868bbfa36aa89d645fb20a86432486b Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 8 Aug 2022 12:39:41 -0400 Subject: [PATCH] Import rpm: 7fbb89dac4c4701add68b8449dcbecacfb42ace2 --- .gitignore | 1 + 0_bundle-packaging.patch | 32 +++++++++++ 0_manifest.patch | 12 ++++ 1_update-compiler-plugin-version.patch | 15 +++++ README.md | 3 + owasp-java-encoder.spec | 77 ++++++++++++++++++++++++++ sources | 1 + 7 files changed, 141 insertions(+) create mode 100644 .gitignore create mode 100644 0_bundle-packaging.patch create mode 100644 0_manifest.patch create mode 100644 1_update-compiler-plugin-version.patch create mode 100644 README.md create mode 100644 owasp-java-encoder.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..43119d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/v1.2.2.tar.gz diff --git a/0_bundle-packaging.patch b/0_bundle-packaging.patch new file mode 100644 index 0000000..54fe271 --- /dev/null +++ b/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/0_manifest.patch b/0_manifest.patch new file mode 100644 index 0000000..51e7b76 --- /dev/null +++ b/0_manifest.patch @@ -0,0 +1,12 @@ +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/1_update-compiler-plugin-version.patch b/1_update-compiler-plugin-version.patch new file mode 100644 index 0000000..fda4c5c --- /dev/null +++ b/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.5 ++ 1.8 ++ 1.8 + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..cfaa5bc --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# owasp-java-encoder + +The owasp-java-encoder package \ No newline at end of file diff --git a/owasp-java-encoder.spec b/owasp-java-encoder.spec new file mode 100644 index 0000000..ff3eae6 --- /dev/null +++ b/owasp-java-encoder.spec @@ -0,0 +1,77 @@ +Name: owasp-java-encoder +Version: 1.2.2 +Release: 3%{?dist} +Summary: Collection of high-performance low-overhead contextual encoders + +License: BSD +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 + +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:) + +%description +The OWASP Encoders package is a collection of high-performance low-overhead +contextual encoders, that when utilized correctly, is an effective tool in +preventing Web Application security vulnerabilities such as +Cross-Site Scripting. + +%package javadoc +Summary: Javadoc for %{name} + +%description javadoc +%{summary}. + +%prep +%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 + +%pom_disable_module jsp +%pom_disable_module esapi + +%pom_remove_plugin org.apache.maven.plugins:maven-javadoc-plugin + +# analysis tool for testing coverage is not required +%pom_remove_plugin :cobertura-maven-plugin + +%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 + +%files -f .mfiles +%doc README.md +%license LICENSE + +%files javadoc -f .mfiles-javadoc +%doc README.md +%license LICENSE + +%changelog +* Thu Mar 04 2021 Alex Macdonald - 1.2.2-3 +- Add ExclusiveArch: x86_64 + +* Tue May 28 2019 Jie Kang -1.2.2-2 +- Remove unnecessary javadoc plugin for Fedora builds + +* Fri Nov 16 2018 Salman Siddiqui - 1.2.2-1 +- Version update + +* Wed Aug 08 2018 Salman Siddiqui - 1.2.1-1 +- Initial packaging diff --git a/sources b/sources new file mode 100644 index 0000000..e008967 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA1 (v1.2.2.tar.gz) = 73bd33ad45dac8f353ab3ab30093bc4a60e9c2c4