# # spec file for package snappy-java # # Copyright (c) 2025 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 bitshuffle_version 0.5.2 %global soname snappyjava Name: snappy-java Version: 1.1.10.7 Release: 0 Summary: Snappy compressor/decompressor for Java License: Apache-2.0 Group: Development/Libraries/Java URL: https://github.com/xerial/%{name} Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: https://repo1.maven.org/maven2/org/xerial/snappy/%{name}/%{version}/%{name}-%{version}.pom Source2: https://github.com/kiyo-masui/bitshuffle/archive/refs/tags/%{bitshuffle_version}.tar.gz#/bitshuffle-%{bitshuffle_version}.tar.gz BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: maven-local BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.osgi:osgi.core) BuildRequires: snappy-devel %description %{name} is a Java port of the snappy, a fast C++ compresser/decompresser developed by Google. %package javadoc Summary: API documentation for %{name} Group: Documentation/HTML BuildArch: noarch %description javadoc API documentation for %{name}. %prep %autosetup chmod 0644 NOTICE README.md cat <<__VERSION__ >src/main/resources/org/xerial/snappy/VERSION SNAPPY_VERSION=%{pkg_version snappy-devel} BITSHUFFLE_VERSION=%{bitshuffle_version} __VERSION__ rm -rf src/main/resources/org/xerial/snappy/native cp %{SOURCE1} pom.xml mkdir -p target/classes tar -Ctarget -xf %{SOURCE2} %pom_change_dep org.osgi:org.osgi.core :osgi.core %pom_add_plugin org.apache.felix:maven-bundle-plugin \ 'true lazy org.xerial.snappy.SnappyBundleActivator http://www.xerial.org/ http://www.apache.org/licenses/LICENSE-2.0.txt snappy-java: A fast compression/decompression library org.xerial.snappy.snappy-java xerial.org %{name} %{url} org.xerial.snappy xerial.org %{version} snappy-java xerial.org %{version} bundle-manifest process-classes manifest ' %{mvn_file} : %{name} %build g++ %{optflags} \ -fPIC -fpermissive -fvisibility=hidden -std=c++11 \ -I%{_jvmdir}/java/include{,/linux} \ -Itarget/bitshuffle-%{bitshuffle_version}/src \ target/bitshuffle-%{bitshuffle_version}/src/{bitshuffle_core,iochain}.c \ src/main/java/org/xerial/snappy/{Snappy,BitShuffle}Native.{cpp,h} \ -lsnappy -shared -Wl,-soname,%{soname} -otarget/lib%{soname}.so cat <<__PROPERTIES__ >target/classes/org-xerial-snappy.properties org.xerial.snappy.use.systemlib=true __PROPERTIES__ %{mvn_build} -f -- \ -Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) %install %mvn_install %fdupes %{buildroot}%{_javadocdir}/%{name} install -dm0755 %{buildroot}%{_libdir} install -pm0755 target/lib%{soname}.so %{buildroot}%{_libdir} %files -f .mfiles %license NOTICE LICENSE %doc {SECURITY,README}.md %{_libdir}/lib%{soname}.so %files javadoc -f .mfiles-javadoc %license NOTICE LICENSE %changelog