%global namedreltag .Final
%global namedversion %{version}%{?namedreltag}
# Conditionals to help breaking hibernate <-> infinispan dependency cycle
%if 0%{?fedora}
%bcond_with infinispan
# Use geolatte-geom 1.0.1 but 1.x series is no compatible with the 0.1x
%bcond_with spatial
%endif
%global pom_url http://repo1.maven.org/maven2/org/hibernate
Name: hibernate
Version: 5.0.10
Release: 7%{?dist}
Summary: Relational persistence and query service
License: LGPLv2+ and ASL 2.0
URL: http://www.hibernate.org/
Source0: https://github.com/hibernate/hibernate-orm/archive/%{version}/%{name}-%{namedversion}.tar.gz
Source1: %{pom_url}/hibernate-c3p0/%{namedversion}/hibernate-c3p0-%{namedversion}.pom
Source2: %{pom_url}/hibernate-core/%{namedversion}/hibernate-core-%{namedversion}.pom
Source3: %{pom_url}/hibernate-ehcache/%{namedversion}/hibernate-ehcache-%{namedversion}.pom
Source4: %{pom_url}/hibernate-entitymanager/%{namedversion}/hibernate-entitymanager-%{namedversion}.pom
Source5: %{pom_url}/hibernate-envers/%{namedversion}/hibernate-envers-%{namedversion}.pom
Source6: %{pom_url}/hibernate-hikaricp/%{namedversion}/hibernate-hikaricp-%{namedversion}.pom
Source7: %{pom_url}/hibernate-infinispan/%{namedversion}/hibernate-infinispan-%{namedversion}.pom
Source8: %{pom_url}/hibernate-java8/%{namedversion}/hibernate-java8-%{namedversion}.pom
Source9: %{pom_url}/hibernate-osgi/%{namedversion}/hibernate-osgi-%{namedversion}.pom
Source10: %{pom_url}/hibernate-proxool/%{namedversion}/hibernate-proxool-%{namedversion}.pom
Source11: %{pom_url}/hibernate-spatial/%{namedversion}/hibernate-spatial-%{namedversion}.pom
Source12: %{pom_url}/hibernate-testing/%{namedversion}/hibernate-testing-%{namedversion}.pom
# http://repo1.maven.org/maven2/org/hibernate/hibernate-jpamodelgen/5.0.10.Final/hibernate-jpamodelgen-5.0.10.Final.pom
# Custom hibernate-parent POM
Source50: hibernate-parent-%{namedversion}.pom
# hibernate package don't include ASL license file
Source60: http://www.apache.org/licenses/LICENSE-2.0.txt
BuildRequires: maven-local
BuildRequires: mvn(antlr:antlr)
BuildRequires: mvn(com.experlog:xapool)
BuildRequires: mvn(com.fasterxml:classmate)
BuildRequires: mvn(com.mchange:c3p0)
BuildRequires: mvn(com.zaxxer:HikariCP)
BuildRequires: mvn(dom4j:dom4j)
BuildRequires: mvn(java_cup:java_cup)
BuildRequires: mvn(javax.enterprise:cdi-api)
BuildRequires: mvn(javax.validation:validation-api)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(net.sf.ehcache:ehcache-core)
BuildRequires: mvn(org.apache.ant:ant)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.geronimo.specs:geronimo-jta_1.1_spec)
BuildRequires: mvn(org.apache.geronimo.specs:specs-parent:pom:)
BuildRequires: mvn(org.bsc.maven:maven-processor-plugin)
BuildRequires: mvn(org.codehaus.mojo:antlr-maven-plugin)
#BuildRequires: mvn(org.eclipse.osgi:org.eclipse.osgi)
%if %{with spatial}
BuildRequires: mvn(org.geolatte:geolatte-geom)
BuildRequires: mvn(postgresql:postgresql)
%endif
BuildRequires: mvn(org.hibernate.common:hibernate-commons-annotations)
BuildRequires: mvn(org.hibernate.javax.persistence:hibernate-jpa-2.1-api)
%if %{without infinispan}
BuildRequires: mvn(org.infinispan:infinispan-core) >= 7.2.1
%endif
BuildRequires: mvn(org.javassist:javassist)
BuildRequires: mvn(org.jboss:jandex)
BuildRequires: mvn(org.jboss.byteman:byteman)
BuildRequires: mvn(org.jboss.byteman:byteman-bmunit)
BuildRequires: mvn(org.jboss.byteman:byteman-install)
BuildRequires: mvn(org.jboss.logging:jboss-logging)
BuildRequires: mvn(org.jboss.logging:jboss-logging-annotations)
BuildRequires: mvn(org.jboss.logging:jboss-logging-processor)
BuildRequires: mvn(org.jboss.narayana.jta:jta)
BuildRequires: mvn(org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec)
BuildRequires: mvn(org.jvnet.jaxb2.maven2:maven-jaxb22-plugin)
BuildRequires: mvn(org.jvnet.jaxb2_commons:jaxb2-basics)
BuildRequires: mvn(org.rhq.helpers:rhq-pluginAnnotations)
BuildRequires: mvn(proxool:proxool)
BuildArch: noarch
%description
Hibernate is a powerful, ultra-high performance
object/relational persistence and query service
for Java. Hibernate lets you develop persistent
objects following common Java idiom - including
association, inheritance, polymorphism, composition
and the Java collections framework. Extremely
fine-grained, richly typed object models are
possible. The Hibernate Query Language, designed
as a "minimal" object-oriented extension to SQL,
provides an elegant bridge between the object and
relational worlds. Hibernate is now the most
popular ORM solution for Java.
%package core
Summary: Hibernate Core
%description core
Core Hibernate O/RM functionality
%package c3p0
Summary: Hibernate C3P0 ConnectionProvider
%description c3p0
C3P0-based implementation of the Hibernate ConnectionProvder contract.
%package ehcache
Summary: Hibernate Ehcache Integration
%description ehcache
Integration of Hibernate with Ehcache.
%package entitymanager
Summary: Hibernate Entity Manager
%description entitymanager
Hibernate Entity Manager.
%package envers
Summary: Hibernate Envers
%description envers
Support for entity auditing.
%package hikaricp
Summary: Hibernate HikariCP Integration
%description hikaricp
Integration of Hibernate with HikariCP.
%package infinispan
Summary: Hibernate Infinispan Integration
%description infinispan
Integration of Hibernate with Infinispan.
%package java8
Summary: Hibernate Java8-specific functionality
%description java8
Support for Java8-specific features - mainly Java8 Date/Time (JSR 310).
%package osgi
Summary: Hibernate OSGi Support
%description osgi
Support for running Hibernate O/RM in OSGi environments.
%package parent
Summary: Hibernate Parent POM
%description parent
Hibernate Parent POM.
%package proxool
Summary: Hibernate Proxool ConnectionProvider
%description proxool
Proxool-based implementation of the Hibernate ConnectionProvder contract.
%package spatial
Summary: Hibernate Spatial/GIS Integration
%description spatial
Integrate support for Spatial/GIS data into Hibernate.
%package testing
Summary: Hibernate Testing
%description testing
Hibernate JUnit test utilities.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n %{name}-orm-%{version}
find . -name "*.jar" -delete
find . -name "*.class" -delete
rm -r documentation/*
cp -p %{SOURCE1} hibernate-c3p0/pom.xml
cp -p %{SOURCE2} hibernate-core/pom.xml
cp -p %{SOURCE3} hibernate-ehcache/pom.xml
cp -p %{SOURCE4} hibernate-entitymanager/pom.xml
cp -p %{SOURCE5} hibernate-envers/pom.xml
cp -p %{SOURCE6} hibernate-hikaricp/pom.xml
cp -p %{SOURCE7} hibernate-infinispan/pom.xml
cp -p %{SOURCE8} hibernate-java8/pom.xml
cp -p %{SOURCE9} hibernate-osgi/pom.xml
cp -p %{SOURCE10} hibernate-proxool/pom.xml
cp -p %{SOURCE11} hibernate-spatial/pom.xml
cp -p %{SOURCE12} hibernate-testing/pom.xml
cp -p %{SOURCE50} pom.xml
cp -p %{SOURCE60} .
sed -i 's/\r//' LICENSE-2.0.txt
for m in entitymanager envers core; do
%pom_add_plugin org.bsc.maven:maven-processor-plugin:2.2.4 hibernate-${m} "
\${project.build.directory}/generated-sources/logging
org.jboss.logging.processor.apt.LoggingToolsProcessor
process
generate-sources
process
org.jboss.logging
jboss-logging-processor
2.0.1.Final
"
done
pushd hibernate-core
%pom_add_plugin "org.jvnet.jaxb2.maven2:maven-jaxb22-plugin:0.12.3" . "
hibernate-configuration
generate
cfg/legacy-configuration-4.0.xsd
hbm-configuration-bindings.xjb
org.hibernate.boot.jaxb.cfg.spi
\${project.build.directory}/generated-sources/hibernate-configuration
hibernate-mapping
generate
mapping/legacy-mapping-4.0.xsd
hbm-mapping-bindings.xjb
org.hibernate.boot.jaxb.hbm.spi
\${project.build.directory}/generated-sources/hibernate-mapping
-Xinheritance
-Xsimplify
src/main/resources/org/hibernate/xsd
src/main/xjb
true
org.jvnet.jaxb2_commons
jaxb2-basics
0.6.3
"
%pom_add_plugin "org.codehaus.mojo:antlr-maven-plugin:2.2" . "
*
generate
"
%pom_add_plugin "org.apache.maven.plugins:maven-compiler-plugin:3.3" . "
1.6
true"
%pom_add_plugin org.apache.felix:maven-bundle-plugin:2.5.4 . "
true
hibernate core
org.hibernate.core
hibernate-core
Hibernate.org
\${project.version}
bundle-manifest
process-classes
manifest
"
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin:2.6 . "
\${project.build.outputDirectory}/META-INF/MANIFEST.MF
false
org.hibernate.Version
http://hibernate.org
Hibernate.org
org.hibernate
\${project.version}
"
# Add missing deps
%pom_add_dep "com.fasterxml:classmate:1.1.0"
%pom_add_dep "javax.validation:validation-api:1.1.0.Final"
%pom_add_dep "org.apache.ant:ant:1.9.4:provided"
#%% pom_add_dep "org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.5_spec:1.0.0.Final"
%pom_add_dep "org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:1.0.2.Final"
%pom_add_dep "junit:junit:4.12:test"
%pom_add_dep "org.hibernate:hibernate-testing:%{namedversion}:test"
popd
%pom_add_dep "javax.enterprise:cdi-api:1.2" hibernate-entitymanager
# Fix HikariCP aId
%pom_change_dep "com.zaxxer:HikariCP-java6" "com.zaxxer:HikariCP:2.4.0" hibernate-hikaricp
# Use eclipse apis only
%pom_change_dep "org.osgi:org.osgi.core" "org.eclipse.osgi:org.eclipse.osgi:3.10.102.v20160416-2200" hibernate-osgi
%pom_remove_dep "org.osgi:org.osgi.compendium" hibernate-osgi
# Use narayana instead of old jboss-jts
%pom_change_dep "org.jboss.jbossts:jbossjta" "org.jboss.narayana.jta:jta" hibernate-testing
for m in c3p0 ehcache entitymanager envers hikaricp infinispan java8 osgi proxool spatial testing; do
%pom_add_plugin org.apache.felix:maven-bundle-plugin:2.5.4 hibernate-${m} "
true
hibernate ${m}
org.hibernate.${m}
hibernate-${m}
Hibernate.org
\${project.version}
bundle-manifest
process-classes
manifest
"
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin:2.6 hibernate-${m} "
\${project.build.outputDirectory}/META-INF/MANIFEST.MF
http://hibernate.org
Hibernate.org
org.hibernate
\${project.version}
"
done
# fix non ASCII chars
for f in $(grep -e 'Pedersen\|Lichtmaier\|Chanfreau\|Benke\|Carlos\|CREATE\ SCHEMA' --include *.java -r -l | sort | uniq); do
native2ascii -encoding UTF8 ${f} ${f}
done
%if %{with infinispan}
%pom_disable_module hibernate-infinispan
%endif
%if %{without spatial}
%pom_disable_module hibernate-spatial
%endif
%build
# Disabled beacuse of cyclic dep between core and testing modules
%mvn_build -s -f -- -Dproject.build.sourceEncoding=UTF-8
%install
%mvn_install
%files core -f .mfiles-hibernate-core
%doc changelog.txt README.md migration-guide.adoc
%license lgpl.txt LICENSE-2.0.txt
%files c3p0 -f .mfiles-hibernate-c3p0
%files ehcache -f .mfiles-hibernate-ehcache
%files entitymanager -f .mfiles-hibernate-entitymanager
%files envers -f .mfiles-hibernate-envers
%files hikaricp -f .mfiles-hibernate-hikaricp
%if %{without infinispan}
%files infinispan -f .mfiles-hibernate-infinispan
%endif
%files java8 -f .mfiles-hibernate-java8
%files osgi -f .mfiles-hibernate-osgi
%doc hibernate-osgi/README.md
%files parent -f .mfiles-hibernate-parent
%license lgpl.txt LICENSE-2.0.txt
%files proxool -f .mfiles-hibernate-proxool
%if %{with spatial}
%files spatial -f .mfiles-hibernate-spatial
%license hibernate-spatial/COPYRIGHT
%endif
%files testing -f .mfiles-hibernate-testing
%files javadoc -f .mfiles-javadoc
%license lgpl.txt LICENSE-2.0.txt
%changelog
* Thu Jul 25 2019 Fedora Release Engineering - 5.0.10-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering - 5.0.10-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering - 5.0.10-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering - 5.0.10-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering - 5.0.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering - 5.0.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Sun Aug 21 2016 gil cattaneo 5.0.10-1
- update to 5.0.10.Final
* Fri Jul 08 2016 gil cattaneo 5.0.7-1
- update to 5.0.7.Final
* Wed Jun 15 2016 gil cattaneo 4.3.5-9
- Add missing BR on maven-plugin-bundle
* Mon Jun 13 2016 Mikolaj Izdebski - 4.3.5-8
- Add missing BR on java_cup
* Wed Feb 03 2016 Fedora Release Engineering - 4.3.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering - 4.3.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Feb 27 2015 Michal Srb - 4.3.5-5
- Remove superfluous BR: istack-commons
* Thu Feb 05 2015 gil cattaneo 4.3.5-4
- introduce license macro
* Sun Nov 30 2014 gil cattaneo 4.3.5-3
- fix for rhbz#1169171
- minor changes to adapt to current guideline
* Sat Jun 07 2014 Fedora Release Engineering - 4.3.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu Apr 24 2014 Marek Goldmann - 4.3.5-1
- Upstream release 4.3.5.Final
* Fri Mar 28 2014 Michael Simacek - 4.3.1-2
- Use Requires: java-headless rebuild (#1067528)
* Fri Feb 14 2014 Marek Goldmann - 4.3.1-1
- Upstream release 4.3.1.Final
* Mon Nov 18 2013 Marek Goldmann - 4.3.0-0.6.Beta4
- Use processor to generate the _logger classes
- Fixed ASCII chars in some files
* Fri Nov 15 2013 Marek Goldmann - 4.3.0-0.5.Beta4
- Rebuild
* Mon Nov 11 2013 gil cattaneo 4.3.0-0.4.Beta4
- fix manifest entries
* Mon Nov 11 2013 Stanislav Ochotnicky - 4.3.0-0.3.Beta4
- Expand variables in manifest properly (#1028931)
* Fri Nov 08 2013 Marek Goldmann - 4.3.0-0.2.Beta4
- Added osgi and maven-plugin modules
- Added OSGi manifests to files
* Thu Nov 07 2013 Marek Goldmann - 4.3.0-0.1.Beta4
- Upstream release 4.3.0.Beta4
- Switched from Gradle to Maven for easier maintenance
- Switched to XMvn
- Latest guidelines
* Sat Aug 03 2013 Fedora Release Engineering - 4.1.7-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Apr 11 2013 gil cattaneo 4.1.7-7
- use full-stacktrace option (-S)
* Thu Feb 14 2013 Fedora Release Engineering - 4.1.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Nov 08 2012 gil cattaneo 4.1.7-5
- fixed changelog
* Mon Oct 29 2012 gil cattaneo 4.1.7-4
- fix license field
- added ASL license txt file
- renamed the "hibernate-core" package as "hibernate"
* Wed Oct 17 2012 gil cattaneo 4.1.7-3
- removed gradle maven plugin references
- update buildrequires list
- fix jboss-jts aId
* Tue Oct 16 2012 gil cattaneo 4.1.7-2
- update PATCH0
* Fri Sep 21 2012 gil cattaneo 4.1.7-1
- update to 4.1.7.Final
* Mon Aug 27 2012 gil cattaneo 4.1.6-1
- update to 4.1.6.Final
* Thu Aug 02 2012 gil cattaneo 4.1.5-1.SP1
- initial rpm