%global namedreltag .Final
%global namedversion %{version}%{?namedreltag}
%global pom_url http://repo1.maven.org/maven2/org/hibernate
Name: hibernate4
Version: 4.3.11
Release: 8%{?dist}
Summary: Relational persistence and query service
# Incorrect Free Software Foundation address https://hibernate.atlassian.net/browse/HHH-10961
License: LGPLv2+ and ASL 2.0
URL: http://www.hibernate.org/
Source0: https://github.com/hibernate/hibernate-orm/archive/%{namedversion}/hibernate-%{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/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-proxool/%{namedversion}/hibernate-proxool-%{namedversion}.pom
Source9: %{pom_url}/hibernate-testing/%{namedversion}/hibernate-testing-%{namedversion}.pom
Source10: %{pom_url}/hibernate-osgi/%{namedversion}/hibernate-osgi-%{namedversion}.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
# Add missing method
Patch0: hibernate-4.3.11.Final-hibernate-commons-annotations5.patch
# Infinispan 8 is not compatible with this release of Hibernate
# this is a only build fix
Patch1: hibernate-4.3.11.Final-infinispan8.patch
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.bsc.maven:maven-processor-plugin)
BuildRequires: mvn(org.codehaus.mojo:antlr-maven-plugin)
BuildRequires: mvn(org.eclipse.osgi:org.eclipse.osgi)
BuildRequires: mvn(org.hibernate.common:hibernate-commons-annotations)
BuildRequires: mvn(org.hibernate.javax.persistence:hibernate-jpa-2.1-api)
BuildRequires: mvn(org.infinispan:infinispan-core)
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.jboss.spec.javax.transaction:jboss-transaction-api_1.2_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)
BuildRequires: xmvn
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 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 osgi
Summary: Hibernate OSGi Support
%description osgi
Support for running Hibernate O/RM in OSGi environments.
%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 hibernate-orm-%{namedversion}
find . -name "*.jar" -delete
find . -name "*.class" -delete
rm -r documentation/*
%patch0 -p1
%patch1 -p1
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-proxool/pom.xml
cp -p %{SOURCE9} hibernate-testing/pom.xml
cp -p %{SOURCE10} hibernate-osgi/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
1.2.0.Beta1
"
done
pushd hibernate-core
%pom_add_plugin "org.jvnet.jaxb2.maven2:maven-jaxb22-plugin:0.12.3" . "
hibernate-configuration
generate
hibernate-configuration-4.0.xsd
hbm-configuration-bindings.xjb
org.hibernate.internal.jaxb.cfg
\${project.build.directory}/generated-sources/hibernate-configuration
hibernate-mapping
generate
hibernate-mapping-4.0.xsd
hbm-mapping-bindings.xjb
org.hibernate.internal.jaxb.mapping.hbm
\${project.build.directory}/generated-sources/hibernate-mapping
hibernate-orm
generate
jpa/orm_2_0.xsd
orm-bindings.xjb
org.hibernate.internal.jaxb.mapping.orm
\${project.build.directory}/generated-sources/hibernate-orm
src/main/resources/org/hibernate
src/main/xjb
true
org.jvnet.jaxb2_commons
jaxb2-basics
0.6.3
-Xinheritance
"
%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.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 :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 osgi proxool 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
sed -i.jandex1.2.2 "s|classDotName, superName, access_flag, interfaces, map|classDotName, superName, access_flag, interfaces, map, true|" \
hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/xml/mocker/IndexBuilder.java
%mvn_compat_version : %{namedversion} %{version} 4
%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
%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
%files infinispan -f .mfiles-hibernate-infinispan
%files osgi -f .mfiles-hibernate-osgi
%files parent -f .mfiles-hibernate-parent
%license lgpl.txt LICENSE-2.0.txt
%files proxool -f .mfiles-hibernate-proxool
%files testing -f .mfiles-hibernate-testing
%files javadoc -f .mfiles-javadoc
%license lgpl.txt LICENSE-2.0.txt
%changelog
* Fri Feb 01 2019 Fedora Release Engineering - 4.3.11-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering - 4.3.11-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering - 4.3.11-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering - 4.3.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering - 4.3.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Aug 09 2016 gil cattaneo 4.3.11-3
- add missing build requires: xmvn
- add build fix for infinispan 8.x
* Thu Aug 04 2016 gil cattaneo 4.3.11-2
- apply hibernate-commons-annotations 5.x build fix
* Thu Jul 07 2016 gil cattaneo 4.3.11-1
- initial rpm