38cb80d
# empty debuginfo
38cb80d
%global debug_package %nil
38cb80d
0586c3a
Name:             snappy-java
7c59b4c
Version:          1.1.2.4
8f0f654
Release:          17%{?dist}
0586c3a
Summary:          Fast compressor/decompresser
0586c3a
License:          ASL 2.0
38cb80d
URL:              http://xerial.org/snappy-java/
38cb80d
Source0:          https://github.com/xerial/snappy-java/archive/%{version}.tar.gz
5a9ac4a
# Not able to build snappy-java jni library with sbt:
5a9ac4a
# use sbt = 0.13.8 (use scala 2.11.6) available 0.13.1 (use scala 2.10.4)
5a9ac4a
# Too many missing plugins:
5a9ac4a
# com.etsy:sbt-checkstyle-plugin:0.4.3
5a9ac4a
# com.github.gseitz:sbt-release:1.0.0
5a9ac4a
# com.jsuereth:sbt-pgp:1.0.0
5a9ac4a
# com.typesafe.sbt:sbt-osgi:0.7.0
5a9ac4a
# de.johoop:findbugs4sbt:1.4.0
5a9ac4a
# de.johoop:jacoco4sbt:2.1.5
5a9ac4a
# org.xerial.sbt:sbt-sonatype:0.5.0
5a9ac4a
Source1:          http://central.maven.org/maven2/org/xerial/snappy/%{name}/%{version}/%{name}-%{version}.pom
5a9ac4a
Patch0:           snappy-java-1.1.2-build.patch
b1056ac
Patch1:           snappy-java-1.1.2.4-lsnappy.patch
0586c3a
2981aaa
# Use "javac -h" because "javah" command disappeared in java 11
2981aaa
Patch2:           javah-adaptation.patch
2981aaa
ef64c56
BuildRequires:    make
ef64c56
BuildRequires:    gcc-c++
a062b15
BuildRequires:    libstdc++-static
ef64c56
BuildRequires:    snappy-devel
ef64c56
Stanislav Ochotnicky af1dc69
BuildRequires:    maven-local
ef64c56
BuildRequires:    mvn(com.sun:tools)
da45ad9
BuildRequires:    mvn(org.apache.felix:maven-bundle-plugin)
da45ad9
BuildRequires:    mvn(org.apache.maven.plugins:maven-antrun-plugin)
2fb3050
BuildRequires:    mvn(org.osgi:osgi.core)
ef64c56
a062b15
Requires:         snappy
6ab340b
0586c3a
%description
0586c3a
A Java port of the snappy, a fast compresser/decompresser written in C++.
0586c3a
0586c3a
%package javadoc
e8ed597
Summary:          Javadoc for %{name}
e8ed597
BuildArch:        noarch
0586c3a
0586c3a
%description javadoc
0586c3a
This package contains the API documentation for %{name}.
0586c3a
0586c3a
%prep
0586c3a
%setup -q
a062b15
# Cleanup
a062b15
find -name "*.class" -print -delete
a062b15
find -name "*.jar" -print -delete
5a9ac4a
rm -r ./*sbt* project
a062b15
a062b15
# Remove prebuilt libraries
a062b15
find -name "*.jnilib" -print -delete
a062b15
find -name "*.dll" -print -delete
a062b15
find -name "*.so" -print -delete
5a9ac4a
find -name "*.a" -print -delete
a062b15
find -name "*.h" -print -delete
a062b15
a062b15
%patch0 -p1
b1056ac
%patch1 -p1
2981aaa
%patch2
a062b15
5a9ac4a
cp %{SOURCE1} pom.xml
38cb80d
%pom_xpath_remove "pom:dependency[pom:scope = 'test']"
a062b15
2fb3050
# use osgi-core instead of felix-osgi-core
2fb3050
%pom_change_dep :org.osgi.core org.osgi:osgi.core
2fb3050
a062b15
# Build JNI library
a062b15
%pom_add_plugin org.apache.maven.plugins:maven-antrun-plugin . '
a062b15
<dependencies>
a062b15
 <dependency>
a062b15
  <groupId>com.sun</groupId>
a062b15
  <artifactId>tools</artifactId>
a062b15
  <version>1.8.0</version>
a062b15
 </dependency>
a062b15
</dependencies>
a062b15
a062b15
<executions>
a062b15
  <execution>
a062b15
  <id>compile</id>
a062b15
  <phase>process-classes</phase>
a062b15
    <configuration>
a062b15
      <target>
a062b15
       
a062b15
         srcdir="src/main/java"
2981aaa
         source="${maven.compiler.source}" target="${maven.compiler.target}" debug="on"
a062b15
         classpathref="maven.plugin.classpath">
a062b15
         <include name="**/OSInfo.java"/>
a062b15
       </javac>
df9a2b6
       <exec executable="make" failonerror="true">
6c41602
        <arg line="%{?_smp_mflags}"/>
a062b15
       </exec>
a062b15
      </target>
a062b15
    </configuration>
a062b15
    <goals>
a062b15
      <goal>run</goal>
a062b15
    </goals>
a062b15
  </execution>
a062b15
</executions>'
5a9ac4a
# Add OSGi support
5a9ac4a
%pom_add_plugin org.apache.felix:maven-bundle-plugin:2.5.4 . '
5a9ac4a
<extensions>true</extensions>
5a9ac4a
<configuration>
5a9ac4a
  <instructions>
5a9ac4a
    <Bundle-Activator>org.xerial.snappy.SnappyBundleActivator</Bundle-Activator>
5a9ac4a
    <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
5a9ac4a
    <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
5a9ac4a
    <Bundle-Version>${project.version}</Bundle-Version>
5a9ac4a
    <Import-Package>org.osgi.framework,*</Import-Package>
5a9ac4a
  </instructions>
5a9ac4a
</configuration>
5a9ac4a
<executions>
5a9ac4a
  <execution>
5a9ac4a
    <id>bundle-manifest</id>
5a9ac4a
    <phase>process-classes</phase>
5a9ac4a
    <goals>
5a9ac4a
      <goal>manifest</goal>
5a9ac4a
    </goals>
5a9ac4a
  </execution>
5a9ac4a
</executions>'
5a9ac4a
a062b15
chmod 644 NOTICE README.md
5a9ac4a
# Convert from dos to unix line ending
5a9ac4a
for file in LICENSE NOTICE README.md; do
5a9ac4a
 sed -i.orig 's|\r||g' $file
5a9ac4a
 touch -r $file.orig $file
5a9ac4a
 rm $file.orig
5a9ac4a
done
0586c3a
0586c3a
%build
5a9ac4a
a062b15
CXXFLAGS="${CXXFLAGS:-%optflags}"
a062b15
export CXXFLAGS
5a9ac4a
# No test deps available:
5a9ac4a
#    org.xerial.java:xerial-core:2.1
5a9ac4a
#    org.xerial:xerial-core:3.2.3
5a9ac4a
#    org.scalatest:scalatest_2.11:2.2.0
5a9ac4a
#    com.novocode:junit-interface:0.10
2981aaa
%mvn_build -f -- -Dproject.build.sourceEncoding=UTF-8 -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
0586c3a
0586c3a
%install
e8ed597
%mvn_install
0586c3a
e8ed597
%files -f .mfiles
38cb80d
%doc README.md
38cb80d
%license LICENSE NOTICE
0586c3a
e8ed597
%files javadoc -f .mfiles-javadoc
38cb80d
%license LICENSE NOTICE
0586c3a
0586c3a
%changelog
8f0f654
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2.4-17
8f0f654
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
8f0f654
ed939e5
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 1.1.2.4-16
ed939e5
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
ed939e5
2981aaa
* Fri Jun 19 2020 Mat Booth <mat.booth@redhat.com> - 1.1.2.4-15
2981aaa
- Allow building against Java 11
2981aaa
dbbaa75
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2.4-14
dbbaa75
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
dbbaa75
2fb3050
* Wed Sep 18 2019 Fabio Valentini <decathorpe@gmail.com> - 1.1.2.4-13
2fb3050
- Migrate from the obsolete felix-osgi-core to osgi-core.
2fb3050
413b5a9
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2.4-12
413b5a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
413b5a9
f597c43
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2.4-11
f597c43
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
f597c43
a950ad0
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2.4-10
a950ad0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a950ad0
d82a14b
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2.4-9
d82a14b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
d82a14b
7c932b4
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2.4-8
7c932b4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
7c932b4
59f4959
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2.4-7
59f4959
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
59f4959
6c41602
* Mon Feb 13 2017 Michael Simacek <msimacek@redhat.com> - 1.1.2.4-6
6c41602
- Let the tooling find the JVM
6c41602
ef64c56
* Mon Feb 13 2017 Michael Simacek <msimacek@redhat.com> - 1.1.2.4-5
ef64c56
- Add BR on make and g++
ef64c56
df9a2b6
* Fri Feb 10 2017 Pavel Raiskup <praiskup@redhat.com> 1.1.2.4-4
df9a2b6
- fail the build if the nested 'make' fails (rhbz#1421088)
df9a2b6
b1056ac
* Thu Feb 09 2017 gil cattaneo <puntogil@libero.it> 1.1.2.4-3
b1056ac
- fix for rhbz#1420790 (link correctly against libsnappy.so)
b1056ac
da45ad9
* Mon Jun 20 2016 gil cattaneo <puntogil@libero.it> 1.1.2.4-2
da45ad9
- add missing build requires
da45ad9
7c59b4c
* Wed Mar 09 2016 Ricardo Arguello <ricardo@fedoraproject.org> - 1.1.2.4-1
7c59b4c
- Update to 1.1.2.4
7c59b4c
7c59b4c
* Wed Mar 09 2016 gil cattaneo <puntogil@libero.it> - 1.1.2.1-1
5a9ac4a
- Update to 1.1.2.1
73c957a
7c59b4c
* Mon Sep 21 2015 gil cattaneo <puntogil@libero.it> - 1.0.5-5
38cb80d
- update Url and Source0 fields
38cb80d
- minor changes to adapt to current guideline
38cb80d
- introduce license macro
38cb80d
7fd50fa
* Thu Jul 23 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.0.5-4
7fd50fa
- Build as archful package
7fd50fa
- Resolves: rhbz#1245629
7fd50fa
21d7eb5
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.5-3
21d7eb5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
21d7eb5
61582ad
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.5-2
61582ad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
61582ad
a062b15
* Thu Apr 3 2014 Ricardo Arguello <ricardo@fedoraproject.org> - 1.0.5-1
a062b15
- Update to 1.0.5
a062b15
- Use the snappy package instead of a precompiled library
a062b15
e8ed597
* Mon Mar 31 2014 Ricardo Arguello <ricardo@fedoraproject.org> - 1.0.4.1-8
e8ed597
- Switch to XMvn
e8ed597
- Use pom macros
e8ed597
9e53e93
* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 1.0.4.1-7
9e53e93
- Use Requires: java-headless rebuild (#1067528)
9e53e93
b7e2082
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4.1-6
b7e2082
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
b7e2082
4be556c
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4.1-5
4be556c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
4be556c
Stanislav Ochotnicky af1dc69
* Wed Feb 06 2013 Java SIG <java-devel@lists.fedoraproject.org> - 1.0.4.1-4
Stanislav Ochotnicky af1dc69
- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild
Stanislav Ochotnicky af1dc69
- Replace maven BuildRequires with maven-local
Stanislav Ochotnicky af1dc69
6a89631
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4.1-3
6a89631
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
6a89631
e8ed597
* Sun Mar 4 2012 Ricardo Arguello <ricardo@fedoraproject.org> - 1.0.4.1-2
0586c3a
- Cleanup of the spec file
0586c3a
e8ed597
* Tue Feb 21 2012 Marek Goldmann <mgoldman@redhat.com> - 1.0.4.1-1
0586c3a
- Initial packaging