commit c2314a67c0c285530889a3b3f60350572b3fd1fb4f2eaeb4af653e066461cd78 Author: Fridrich Strba Date: Fri Mar 8 08:19:12 2019 +0000 OBS-URL: https://build.opensuse.org/package/show/Java:packages/plexus-archiver?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Remove-support-for-snappy.patch b/0001-Remove-support-for-snappy.patch new file mode 100644 index 0000000..561fa5f --- /dev/null +++ b/0001-Remove-support-for-snappy.patch @@ -0,0 +1,55 @@ +From bd1055a190a1a64374f4aeb3bfde138d9c3d965f Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Sat, 23 Sep 2017 11:43:45 +0200 +Subject: [PATCH] Remove support for snappy + +--- + src/main/java/org/codehaus/plexus/archiver/tar/TarArchiver.java | 3 +-- + src/main/java/org/codehaus/plexus/archiver/tar/TarUnArchiver.java | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/main/java/org/codehaus/plexus/archiver/tar/TarArchiver.java b/src/main/java/org/codehaus/plexus/archiver/tar/TarArchiver.java +index 398ecf1..0d46cfc 100644 +--- a/src/main/java/org/codehaus/plexus/archiver/tar/TarArchiver.java ++++ b/src/main/java/org/codehaus/plexus/archiver/tar/TarArchiver.java +@@ -38,7 +38,6 @@ + import org.codehaus.plexus.components.io.resources.PlexusIoResource; + import org.codehaus.plexus.util.IOUtil; + import org.codehaus.plexus.util.StringUtils; +-import org.iq80.snappy.SnappyOutputStream; + import static org.codehaus.plexus.archiver.util.Streams.bufferedOutputStream; + + /** +@@ -489,7 +488,7 @@ else if ( TarCompressionMethod.bzip2.equals( tarCompressionMethod ) ) + } + else if ( TarCompressionMethod.snappy.equals( tarCompressionMethod ) ) + { +- return new SnappyOutputStream( bufferedOutputStream( ostream ) ); ++ throw new UnsupportedOperationException( "This version of plexus-archiver does not support snappy compression" ); + } + else if ( TarCompressionMethod.xz.equals( tarCompressionMethod ) ) + { +diff --git a/src/main/java/org/codehaus/plexus/archiver/tar/TarUnArchiver.java b/src/main/java/org/codehaus/plexus/archiver/tar/TarUnArchiver.java +index 4bc94a4..15f0494 100644 +--- a/src/main/java/org/codehaus/plexus/archiver/tar/TarUnArchiver.java ++++ b/src/main/java/org/codehaus/plexus/archiver/tar/TarUnArchiver.java +@@ -30,7 +30,6 @@ + import org.codehaus.plexus.archiver.ArchiverException; + import org.codehaus.plexus.archiver.util.Streams; + import org.codehaus.plexus.util.IOUtil; +-import org.iq80.snappy.SnappyInputStream; + + /** + * @author Emmanuel Venisse +@@ -153,7 +152,7 @@ else if ( compression == UntarCompressionMethod.BZIP2 ) + } + else if ( compression == UntarCompressionMethod.SNAPPY ) + { +- return new SnappyInputStream( istream, true ); ++ throw new UnsupportedOperationException( "This version of plexus-archiver does not support snappy compression" ); + } + else if ( compression == UntarCompressionMethod.XZ ) + { +-- +2.13.5 + diff --git a/logger-level.patch b/logger-level.patch new file mode 100644 index 0000000..ce1636f --- /dev/null +++ b/logger-level.patch @@ -0,0 +1,11 @@ +--- plexus-archiver-plexus-archiver-3.6.0/src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java 2018-05-06 14:13:22.000000000 +0200 ++++ plexus-archiver-plexus-archiver-3.6.0/src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java 2019-03-08 07:35:58.658910163 +0100 +@@ -31,7 +31,7 @@ + throws Exception + { + super.setUp(); +- getContainer().getLoggerManager().setThreshold( Logger.LEVEL_DEBUG ); ++ ((org.codehaus.plexus.DefaultPlexusContainer)getContainer()).getLoggerManager().setThreshold( Logger.LEVEL_DEBUG ); + } + + public void testZipArchiver() diff --git a/plexus-archiver-3.6.0.tar.gz b/plexus-archiver-3.6.0.tar.gz new file mode 100644 index 0000000..e5f892c --- /dev/null +++ b/plexus-archiver-3.6.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c023487c261e07d11c874bc437a33e2fdefccf679af55cf8c579aa819a9e4f4 +size 564479 diff --git a/plexus-archiver-build.xml b/plexus-archiver-build.xml new file mode 100644 index 0000000..9b84544 --- /dev/null +++ b/plexus-archiver-build.xml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================================== WARNING =================================== + JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed. + =============================================================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plexus-archiver.changes b/plexus-archiver.changes new file mode 100644 index 0000000..d5011ab --- /dev/null +++ b/plexus-archiver.changes @@ -0,0 +1,15 @@ +------------------------------------------------------------------- +Fri Mar 8 07:53:43 UTC 2019 - Fridrich Strba + +- Initial packaging of plexus-archiver 3.6.0 +- Generate and customize ant build file +- Make running of tests optional +- Added patches: + * 0001-Remove-support-for-snappy.patch + + When built without snappy support and trying to use Snappy, + throw UnsupportedOperationException + * logger-level.patch + + Cast the result of getContainer() call, because the + getLoggerManager() method is not a method of the + PlexusContainer interface, but of the DefaultPlexusContainer + implementation diff --git a/plexus-archiver.spec b/plexus-archiver.spec new file mode 100644 index 0000000..00b02af --- /dev/null +++ b/plexus-archiver.spec @@ -0,0 +1,125 @@ +# +# spec file for package plexus-archiver +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# 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/ +# + + +%bcond_with tests +%bcond_with snappy +Name: plexus-archiver +Version: 3.6.0 +Release: 0 +Summary: Plexus Archiver Component +License: Apache-2.0 +Group: Development/Libraries/Java +URL: http://codehaus-plexus.github.io/plexus-archiver +Source0: https://github.com/codehaus-plexus/plexus-archiver/archive/plexus-archiver-%{version}.tar.gz +Source1: %{name}-build.xml +Patch0: 0001-Remove-support-for-snappy.patch +Patch1: logger-level.patch +BuildRequires: ant +BuildRequires: apache-commons-compress +BuildRequires: apache-commons-io +BuildRequires: fdupes +BuildRequires: javapackages-local +BuildRequires: jsr-305 +BuildRequires: plexus-containers-container-default +BuildRequires: plexus-io +BuildRequires: plexus-utils +BuildRequires: xz-java +Requires: mvn(org.apache.commons:commons-compress) +Requires: mvn(org.codehaus.plexus:plexus-io) +Requires: mvn(org.codehaus.plexus:plexus-utils) +Requires: mvn(org.tukaani:xz) +BuildArch: noarch +%if %{with snappy} +BuildRequires: mvn(org.iq80.snappy:snappy) +%endif +%if %{with tests} +BuildRequires: ant-junit +BuildRequires: guava20 +BuildRequires: plexus-classworlds +BuildRequires: xbean +BuildRequires: xz-java +%endif + +%description +The Plexus project seeks to create end-to-end developer tools for +writing applications. At the core is the container, which can be +embedded or for a full scale application server. There are many +reusable components for hibernate, form processing, jndi, i18n, +velocity, etc. Plexus also includes an application server which +is like a J2EE application server, without all the baggage. + +%package javadoc +Summary: Javadoc for %{name} +Group: Documentation/HTML + +%description javadoc +Javadoc for %{name}. + +%prep +%setup -q -n %{name}-%{name}-%{version} +cp %{SOURCE1} build.xml + +%if %{without snappy} +%patch0 -p1 +%pom_remove_dep org.iq80.snappy:snappy +rm -rf src/main/java/org/codehaus/plexus/archiver/snappy +rm -rf src/test/java/org/codehaus/plexus/archiver/snappy +rm -f src/main/java/org/codehaus/plexus/archiver/tar/SnappyTarFile.java +rm -f src/main/java/org/codehaus/plexus/archiver/tar/PlexusIoTarSnappyFileResourceCollection.java +rm -r src/test/java/org/codehaus/plexus/archiver/tar/TarSnappyUnArchiverTest.java +%endif +%patch1 -p1 + +%pom_remove_plugin :maven-enforcer-plugin + +%pom_remove_parent . +%pom_xpath_inject "pom:project" "org.codehaus.plexus" . + +%build +mkdir -p lib +build-jar-repository -s lib plexus-containers/plexus-container-default jsr-305 commons-compress commons-io plexus/utils plexus/io +%if %{with tests} +build-jar-repository -s lib plexus/classworlds guava20/guava-20.0 xbean/xbean-reflect xz-java +%endif +%{ant} \ +%if %{without tests} + -Dtest.skip=true \ +%endif + jar javadoc + +%install +# jar +install -dm 0755 %{buildroot}%{_javadir}/plexus +install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/plexus/archiver.jar +# pom +install -dm 0755 %{buildroot}%{_mavenpomdir}/plexus +install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/plexus/archiver.pom +%add_maven_depmap plexus/archiver.pom plexus/archiver.jar +# javadoc +install -dm 0755 %{buildroot}%{_javadocdir}/%{name} +cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/ +%fdupes -s %{buildroot}%{_javadocdir} + +%files -f .mfiles +%license LICENSE + +%files javadoc +%license LICENSE +%{_javadocdir}/%{name} + +%changelog