%bcond_with arquillian
Name:                openwebbeans
Version:             1.2.8
Release:             1
Summary:             Implementation of the JSR-299 WebBeans
License:             ASL 2.0
URL:                 http://openwebbeans.apache.org/
Source0:             http://www.apache.org/dist/openwebbeans/%{version}/%{name}-%{version}-source-release.zip
Patch0:              %{name}-1.2.0-servlet31.patch
Patch1:              OWB-1309-fix-missing-NoSuchMethodException.patch
BuildRequires:       maven-local mvn(javax.annotation:javax.annotation-api) >= 1.2
BuildRequires:       mvn(javax.el:javax.el-api) mvn(javax.inject:javax.inject)
BuildRequires:       mvn(javax.servlet:javax.servlet-api)
BuildRequires:       mvn(javax.servlet.jsp:javax.servlet.jsp-api) mvn(junit:junit)
BuildRequires:       mvn(org.apache:apache:pom:) mvn(org.apache:apache-jar-resource-bundle)
BuildRequires:       mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires:       mvn(org.apache.geronimo.specs:geronimo-ejb_3.1_spec)
BuildRequires:       mvn(org.apache.geronimo.specs:geronimo-jcdi_1.0_spec)
BuildRequires:       mvn(org.apache.geronimo.specs:geronimo-jms_1.1_spec)
BuildRequires:       mvn(org.apache.geronimo.specs:geronimo-jta_1.1_spec)
BuildRequires:       mvn(org.apache.geronimo.specs:geronimo-validation_1.0_spec)
BuildRequires:       mvn(org.apache.geronimo.specs:specs:pom:)
BuildRequires:       mvn(org.apache.httpcomponents:project:pom:)
BuildRequires:       mvn(org.apache.maven.plugins:maven-dependency-plugin)
BuildRequires:       mvn(org.apache.maven.plugins:maven-release-plugin)
BuildRequires:       mvn(org.apache.maven.plugins:maven-remote-resources-plugin)
BuildRequires:       mvn(org.apache.tomcat:tomcat-catalina) mvn(org.apache.xbean:xbean-finder)
BuildRequires:       mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires:       mvn(org.eclipse.osgi:org.eclipse.osgi)
BuildRequires:       mvn(org.hibernate.javax.persistence:hibernate-jpa-2.0-api)
BuildRequires:       mvn(org.jboss.spec.javax.faces:jboss-jsf-api_2.2_spec)
BuildRequires:       mvn(org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.2_spec)
BuildRequires:       mvn(org.ow2.asm:asm) mvn(org.ow2.asm:asm-commons)
%if %{with arquillian}
BuildRequires:       mvn(org.jboss.arquillian:arquillian-bom)
BuildRequires:       mvn(org.jboss.arquillian.container:arquillian-container-spi)
BuildRequires:       mvn(org.jboss.arquillian.core:arquillian-core-spi)
BuildRequires:       mvn(org.jboss.arquillian.junit:arquillian-junit-container)
BuildRequires:       mvn(org.jboss.arquillian.test:arquillian-test-spi)
BuildRequires:       mvn(org.jboss.arquillian.testenricher:arquillian-testenricher-cdi)
BuildRequires:       mvn(org.jboss.shrinkwrap:shrinkwrap-api)
BuildRequires:       mvn(org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-bom:pom:)
%endif
Obsoletes:           %{name}-arquillian
Obsoletes:           %{name}-cdi11
BuildArch:           noarch
%description
OpenWebBeans is an implementation of the JSR-299, Contexts and
Dependency Injection for the Java EE platform.
It also already incorporates some features which are part of JSR-346
but doesn't need API changes as we still use the JCDI-1.0 API. The
incorporated CDI-1.1 features are mostly parts which are not well defined
in the CDI-1.0 specification, like Serialisation checks, etc.

%package clustering
Summary:             Apache OpenWebBeans Clustering Plugin
%description clustering
Apache OpenWebBeans Clustering plugin.

%package ee
Summary:             Apache OpenWebBeans Java EE plugin
%description ee
Apache OpenWebBeans Java EE Utility.

%package ee-common
Summary:             Apache OpenWebBeans EE Common plugin
%description ee-common
Apache OpenWebBeans Java EE Common.

%package ejb
Summary:             Apache OpenWebBeans EJB plugin
%description ejb
Apache OpenWebBeans Java EE EJB plugin.

%package el22
Summary:             Apache OpenWebBeans EL 2.2 plugin
%description el22
Apache OpenWebBeans EL 2.2 integration.

%package impl
Summary:             Apache OpenWebBeans Core
%description impl
Apache OpenWebBeans Implementation core module.

%package jee5-ejb-resource
Summary:             Apache OpenWebBeans EE Resource plugin
%description jee5-ejb-resource
Apache OpenWebBeans EE 5 Resource Integration.

%package jms
Summary:             Apache OpenWebBeans JMS plugin
%description jms
Apache OpenWebBeans JMS Integration.

%package jsf
Summary:             Apache OpenWebBeans JSF-2 plugin
%description jsf
Apache OpenWebBeans JSF integration.

%package osgi
Summary:             Apache OpenWebBeans OSGi plugin
%description osgi
Apache OpenWebBeans OSGi ClassLoader scanning support.

%package resource
Summary:             Apache OpenWebBeans EE Resource plugin
%description resource
Apache OpenWebBeans EE Resource Integration.

%package spi
Summary:             Apache OpenWebBeans SPI definition
%description spi
Apache OpenWebBeans Service Provider Interfaces.

%package test
Summary:             Apache OpenWebBeans CDI Test Framework
%description test
This package contains testing support for CDI containers and
also provides an implementation for OpenWebBeans.

%package tomcat7
Summary:             Apache OpenWebBeans Tomcat 7 plugin
%description tomcat7
ApacheOpenWebBeans Tomcat 7 Web Profile.

%package web
Summary:             Apache OpenWebBeans Web plugin
%description web
Apache OpenWebBeans Java EE Web and Serlvet plugin.

%package javadoc
Summary:             Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
rm -r DEPENDENCIES
%pom_remove_plugin :maven-checkstyle-plugin
%pom_remove_plugin :findbugs-maven-plugin
%pom_remove_plugin :taglist-maven-plugin
%pom_remove_plugin -r :maven-source-plugin
%pom_disable_module distribution
%pom_disable_module samples
%pom_disable_module webbeans-doc
%pom_disable_module webbeans-el10
%pom_disable_module webbeans-jsf12
%pom_disable_module webbeans-porting
%pom_disable_module webbeans-tck
%pom_disable_module atinject-tck
%pom_disable_module webbeans-tomcat6
%if %{without arquillian}
%pom_disable_module webbeans-arquillian
%pom_remove_dep :arquillian-bom webbeans-arquillian
%endif
%pom_change_dep -r :geronimo-annotation_1.1_spec javax.annotation:javax.annotation-api:1.2
%pom_change_dep -r :geronimo-atinject_1.0_spec javax.inject:javax.inject:1
%pom_change_dep -r :geronimo-el_2.2_spec javax.el:javax.el-api:3.0.0
%pom_change_dep -r :geronimo-interceptor_1.1_spec org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.2_spec:1.0.0.Final
%pom_change_dep -r :geronimo-jpa_2.0_spec org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final
%pom_change_dep -r :geronimo-jsp_2.1_spec javax.servlet.jsp:javax.servlet.jsp-api:2.3.2-b01
%pom_change_dep -r :geronimo-servlet_2.5_spec javax.servlet:javax.servlet-api:3.1.0
%pom_change_dep -r :myfaces-api org.jboss.spec.javax.faces:jboss-jsf-api_2.2_spec:2.2.0
%pom_change_dep -r :org.osgi.core org.eclipse.osgi:org.eclipse.osgi
%pom_change_dep -r org.apache.xbean:xbean-finder-shaded org.apache.xbean:xbean-finder
%pom_change_dep -r org.apache.xbean:xbean-asm5-shaded org.ow2.asm:asm:5.0.3
sed -i "s|org.apache.xbean.asm5|org.objectweb.asm|" \
 webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java \
 webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java \
 webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java \
 webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java
%pom_add_dep org.ow2.asm:asm-commons:5.0.3:test webbeans-impl
rm -r webbeans-impl/src/test/java/org/apache/webbeans/portable/AnnotatedTypeImplTest.java
rm -rf webbeans-clustering/src/test/java/org/apache/webbeans/web/failover/tests/MockServletContext.java \
 webbeans-clustering/src/test/java/org/apache/webbeans/web/failover/tests/MockServletRequest.java
%pom_remove_plugin org.apache.rat:apache-rat-plugin
%mvn_package org.apache.openwebbeans.test: test
%mvn_package :%{name}-impl::tests: %{name}-impl

%build
%mvn_build -s -- -Dmaven.test.failure.ignore=true

%install
%mvn_install

%files -f .mfiles-%{name}
%license LICENSE NOTICE

%files clustering -f .mfiles-%{name}-clustering
%license LICENSE NOTICE

%files ee -f .mfiles-%{name}-ee
%license LICENSE NOTICE

%files ee-common -f .mfiles-%{name}-ee-common
%license LICENSE NOTICE

%files ejb -f .mfiles-%{name}-ejb
%license LICENSE NOTICE

%files el22 -f .mfiles-%{name}-el22
%license LICENSE NOTICE

%files impl -f .mfiles-%{name}-impl
%license LICENSE NOTICE

%files jee5-ejb-resource -f .mfiles-%{name}-jee5-ejb-resource
%license LICENSE NOTICE

%files jms -f .mfiles-%{name}-jms
%license LICENSE NOTICE

%files jsf -f .mfiles-%{name}-jsf
%license LICENSE NOTICE

%files osgi -f .mfiles-%{name}-osgi
%license LICENSE NOTICE

%files resource -f .mfiles-%{name}-resource
%license LICENSE NOTICE

%files spi -f .mfiles-%{name}-spi
%license LICENSE NOTICE

%files test -f .mfiles-test
%license LICENSE NOTICE

%files tomcat7 -f .mfiles-%{name}-tomcat7
%license LICENSE NOTICE

%files web -f .mfiles-%{name}-web
%license LICENSE NOTICE

%files javadoc -f .mfiles-javadoc
%license LICENSE NOTICE

%changelog
* Mon Aug 24 2020 zhanghua <zhanghua40@huawei.com> - 1.2.8-1
- package init
