Blame SPECS/mongo-java-driver.spec

3c86a0
%{?scl:%scl_package mongo-java-driver}
3c86a0
%{!?scl:%global pkg_name %{name}}
3c86a0
3c86a0
# Exclude generation of osgi() style provides, since they are not
3c86a0
# SCL-namespaced and may conflict with base RHEL packages.
3c86a0
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1046029
3c86a0
%if 0%{?rhel} < 7
3c86a0
# get proper auto provides/requires
3c86a0
%{?scl: %mongodb24_find_provides_and_requires}
3c86a0
%filter_from_provides /^osgi(.*)$/d
3c86a0
%else
3c86a0
%global __provides_exclude ^osgi(.*)$
3c86a0
%endif
3c86a0
3c86a0
Name:		%{?scl_prefix}mongo-java-driver
3c86a0
Version:	2.11.4
3c86a0
Release:	2%{?dist}
3c86a0
Summary:	A Java driver for MongoDB
3c86a0
3c86a0
Group:		Development/Libraries
3c86a0
BuildArch:	noarch
3c86a0
License:	ASL 2.0
3c86a0
URL:		http://www.mongodb.org/display/DOCS/Java+Language+Center
3c86a0
Source0:	https://github.com/mongodb/%{pkg_name}/archive/r%{version}.tar.gz
3c86a0
%if 0%{?rhel} < 7
3c86a0
Patch0:		disable_testng.patch
3c86a0
%endif
3c86a0
3c86a0
BuildRequires:	jpackage-utils
3c86a0
BuildRequires:	java-devel
3c86a0
%if 0%{?rhel} < 7
3c86a0
# This provides the maven macros and files the
3c86a0
# provides/requires generator uses internally
3c86a0
BuildRequires:	javapackages-tools
3c86a0
BuildRequires:	ant-apache-regexp
3c86a0
%else
3c86a0
BuildRequires:	testng
3c86a0
%endif
3c86a0
BuildRequires:	ant
3c86a0
BuildRequires:	ant-contrib
3c86a0
BuildRequires:	git
3c86a0
3c86a0
Requires:	jpackage-utils
3c86a0
Requires:	java
3c86a0
%{?scl:Requires:%scl_runtime}
3c86a0
3c86a0
%description
3c86a0
This is the Java driver for MongoDB.
3c86a0
3c86a0
%package bson
3c86a0
Summary:	A Java-based BSON implementation
3c86a0
Group:		Development/Libraries
3c86a0
Requires:	jpackage-utils
3c86a0
Requires:	java
3c86a0
%{?scl:Requires:%scl_runtime}
3c86a0
3c86a0
%description bson
3c86a0
This is the Java implementation of BSON that the Java driver for
3c86a0
MongoDB ships with.  It can be used separately by Java applications
3c86a0
that require BSON.
3c86a0
# Upstream has hinted that eventually, their bson implementation will
3c86a0
# be better separated out: http://bsonspec.org/#/implementation
3c86a0
# To make things easier for when that does happen, for now the jar
3c86a0
# and javadocs for this are in separate subpackages.
3c86a0
3c86a0
%package javadoc
3c86a0
Summary:	Javadoc for %{name}
3c86a0
Group:		Documentation
3c86a0
Requires:	jpackage-utils
3c86a0
%{?scl:Requires:%scl_runtime}
3c86a0
3c86a0
%description javadoc
3c86a0
This package contains the API documentation for %{name}.
3c86a0
3c86a0
%package bson-javadoc
3c86a0
Summary:	Javadoc for %{name}-bson
3c86a0
Group:		Documentation
3c86a0
Requires:	jpackage-utils
3c86a0
%{?scl:Requires:%scl_runtime}
3c86a0
3c86a0
%description bson-javadoc
3c86a0
This package contains the API documentation for %{name}-bson.
3c86a0
3c86a0
%prep
3c86a0
%setup -qn %{pkg_name}-r%{version}
3c86a0
3c86a0
find -name '*.class' -exec rm -f '{}' \;
3c86a0
find -name '*.jar' -exec rm -f '{}' \;
3c86a0
3c86a0
%if 0%{?rhel} < 7
3c86a0
# Tests are not run, disable TestNG task defn.
3c86a0
%patch0
3c86a0
%endif
3c86a0
3c86a0
%build
3c86a0
%if 0%{?rhel} < 7
3c86a0
# We need net/sf/antcontrib/antcontrib.properties in the class path. Otherwise
3c86a0
# the propertyregex task is not defined. The properties file comes from
3c86a0
# the ant-contrib jar. This is on the CP by default on rhel-7
3c86a0
export CLASSPATH=%{_root_datadir}/java/ant/ant-contrib.jar
3c86a0
ant -Dfile.encoding=UTF-8 -Denv.JAVA_HOME=/usr/lib/jvm/java -Dplatforms.JDK_1.5.home=/usr/lib/jvm/java jar javadocs
3c86a0
%else
3c86a0
(
3c86a0
  ln -s $(build-classpath testng) lib/testng-6.3.1.jar
3c86a0
  ant -Dfile.encoding=UTF-8 -Denv.JAVA_HOME=/usr/lib/jvm/java -Dplatforms.JDK_1.5.home=/usr/lib/jvm/java jar javadocs
3c86a0
)
3c86a0
%endif
3c86a0
sed -i -e "s|@VERSION@|%{version}|g" maven/maven-bson.xml maven/maven-mongo-java-driver.xml
3c86a0
3c86a0
%install
3c86a0
# Jars
3c86a0
install -d -m 755       %{buildroot}%{_javadir}
3c86a0
install -p -m 644 *.jar %{buildroot}%{_javadir}/
3c86a0
3c86a0
# poms
3c86a0
%if 0%{?rhel} < 7
3c86a0
install -d -m 755 %{buildroot}%{_datadir}/maven-poms
3c86a0
%endif
3c86a0
install -Dpm 644 maven/maven-mongo-java-driver.xml %{buildroot}%{_mavenpomdir}/JPP-mongo.pom
3c86a0
install -Dpm 644 maven/maven-bson.xml              %{buildroot}%{_mavenpomdir}/JPP-bson.pom
3c86a0
%add_maven_depmap JPP-mongo.pom mongo.jar
3c86a0
%add_maven_depmap -f bson JPP-bson.pom bson.jar
3c86a0
3c86a0
# Java-docs
3c86a0
install -d -m 755                 %{buildroot}%{_javadocdir}/%{name}
3c86a0
install -d -m 755                 %{buildroot}%{_javadocdir}/%{name}-bson
3c86a0
cp -r -p docs/mongo-java-driver/* %{buildroot}%{_javadocdir}/%{name}
3c86a0
cp -r -p docs/bson/*              %{buildroot}%{_javadocdir}/%{name}-bson
3c86a0
3c86a0
%files
3c86a0
%{_javadir}/mongo.jar
3c86a0
%doc README.md LICENSE.txt
3c86a0
%{_mavenpomdir}/JPP-mongo.pom
3c86a0
%{_mavendepmapfragdir}/%{?scl_prefix}%{pkg_name}
3c86a0
3c86a0
%files bson
3c86a0
%{_javadir}/bson.jar
3c86a0
%doc README.md LICENSE.txt
3c86a0
%{_mavenpomdir}/JPP-bson.pom
3c86a0
%{_mavendepmapfragdir}/%{name}-bson
3c86a0
3c86a0
%files javadoc
3c86a0
%{_javadocdir}/%{name}
3c86a0
%doc README.md LICENSE.txt
3c86a0
3c86a0
%files bson-javadoc
3c86a0
%{_javadocdir}/%{name}-bson
3c86a0
%doc README.md LICENSE.txt
3c86a0
3c86a0
%changelog
3c86a0
* Fri Mar 28 2014 Jan Pacner <jpacner@redhat.com> - 2.11.4-2
3c86a0
- Resolves: #1075025 (Leftovers files after mongodb packages removal)
3c86a0
3c86a0
* Wed Jan 29 2014 Jan Pacner <jpacner@redhat.com> - 2.11.4-1
3c86a0
- Resolves: #1059170 (new release 2.11.4)
3c86a0
3c86a0
* Fri Jan 10 2014 Jan Pacner <jpacner@redhat.com> - 2.11.3-8
3c86a0
- Related: RHBZ#1046029; unify el6 and el7 branch
3c86a0
3c86a0
* Tue Jan 07 2014 Honza Horak <hhorak@redhat.com> 2.11.3-7
3c86a0
- Filter properly in RHEL-6 and lower
3c86a0
  Related: RHBZ#1046029
3c86a0
3c86a0
* Fri Jan 03 2014 Severin Gehwolf <sgehwolf@redhat.com> 2.11.3-6
3c86a0
- Don't generate osgi() style provides.
3c86a0
- Resolves: RHBZ#1046029.
3c86a0
3c86a0
* Thu Nov 14 2013 Severin Gehwolf <sgehwolf@redhat.com> - 2.11.3-5
3c86a0
- Fix auto-requires/provides.
3c86a0
3c86a0
* Thu Nov 14 2013 Severin Gehwolf <sgehwolf@redhat.com> - 2.11.3-4
3c86a0
- Disable macro for auto-requires/provides.
3c86a0
- Fix bson maven provides.
3c86a0
- Expand @VERSION@ in poms.
3c86a0
3c86a0
* Wed Nov 13 2013 Severin Gehwolf <sgehwolf@redhat.com> - 2.11.3-3
3c86a0
- Remove unneeded testng BR.
3c86a0
- Make package build with ant-contrib (custom classpath)
3c86a0
- Don't use maven* macros.
3c86a0
3c86a0
* Thu Oct  3 2013 Honza Horak <hhorak@redhat.com> - 2.11.3-2
3c86a0
- Port to SCL
3c86a0
3c86a0
* Tue Sep 24 2013 Severin Gehwolf <sgehwolf@redhat.com> - 2.11.3-1
3c86a0
- Update to latest upstream release.
3c86a0
3c86a0
* Thu Sep 05 2013 Omair Majid <omajid@redhat.com> - 2.11.2-2
3c86a0
- Do not require -bson subpackage. The classes are present in both jars.
3c86a0
3c86a0
* Fri Aug 30 2013 Omair Majid <omajid@redhat.com> - 2.11.2-1
3c86a0
- Update to 2.11.2
3c86a0
- Generate tarball from commit tag, according to packaging guidelines
3c86a0
3c86a0
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.3-4
3c86a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
3c86a0
3c86a0
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.3-3
3c86a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
3c86a0
3c86a0
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.3-2
3c86a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3c86a0
3c86a0
* Tue Apr 24 2012 Jon VanAlten <jon.vanalten@redhat.com> 2.7.3-1
3c86a0
- Bump to 2.7.3.
3c86a0
3c86a0
* Mon Jan 16 2012 Alexander Kurtakov <akurtako@redhat.com> 2.6.5-4
3c86a0
- Add depmap/pom.
3c86a0
3c86a0
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.5-3
3c86a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
3c86a0
3c86a0
* Tue Nov 29 2011 Jon VanAlten <jon.vanalten@redhat.com> - 2.6.5-2
3c86a0
- Sources moved to lookaside cache where they belong
3c86a0
3c86a0
* Tue Nov 29 2011 Jon VanAlten <jon.vanalten@redhat.com> - 2.6.5-1
3c86a0
- Add missing BuildDep: git (git-hash is used during build)
3c86a0
3c86a0
* Tue Oct 11 2011 Jon VanAlten <jon.vanalten@redhat.com> - 2.6.5-1
3c86a0
- Initial packaging of mongo-java-driver for Fedora.