%global commit 4bc0180d1e1ba60f553f21a83851b4704d66c890 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %bcond_with javadoc Name: leveldb-java Version: 0.7 Release: 1%{?dist} Summary: Pure java implementation of LevelDB License: ASL 2.0 URL: https://github.com/dain/leveldb Source0: https://github.com/dain/leveldb/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz Patch0: %{name}-xerial-snappy.patch BuildArch: noarch BuildRequires: java-headless BuildRequires: joda-time BuildRequires: junit BuildRequires: maven-local BuildRequires: maven-shade-plugin BuildRequires: snappy-java %description A rewrite (port) of LevelDB written in Java. The goal is to have a feature complete implementation that is within 10% of the performance of the C++ original and produces byte-for-byte exact copies of the C++ code. %if %{with javadoc} %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains the API documentation for %{name}. %endif %prep %setup -qn leveldb-%{commit} %patch0 -p1 %pom_remove_plugin com.github.wvengen:proguard-maven-plugin leveldb # Remove/Disable missing dep/tests %pom_remove_dep org.fusesource.leveldbjni:leveldbjni-all leveldb rm -f leveldb/src/test/java/org/iq80/leveldb/impl/NativeInteropTest.java # Add junit dep missing in the leveldb pom %pom_add_dep junit:junit leveldb # Dep isn't packaged, only used for javadoc generation %pom_xpath_remove "pom:project/pom:build/pom:pluginManagement/pom:plugins/pom:plugin[pom:artifactId='maven-javadoc-plugin']/pom:configuration/pom:docletArtifact" %pom_xpath_remove "pom:project/pom:build/pom:pluginManagement/pom:plugins/pom:plugin[pom:artifactId='maven-javadoc-plugin']/pom:configuration/pom:doclet" sed -i "/hdf/d" pom.xml chmod -x license.txt %build %if %{without javadoc} args="-j" %endif # Tests are inconsistent and take a long time to run %mvn_build $args -- -DskipTests %install %mvn_install %files -f .mfiles %doc license.txt README.md %if %{with javadoc} %files -f .mfiles-javadoc javadoc %doc license.txt %endif %changelog * Tue Apr 22 2014 Robert Rati - 0.7-1 - Initial packaging