Blame jakarta-server-pages.spec

bfe61b8
%global srcname jsp-api
bfe61b8
bfe61b8
Name:           jakarta-server-pages
bfe61b8
Version:        2.3.6
028ba11
Release:        2%{?dist}
bfe61b8
Summary:        Jakarta Server Pages (JSP)
bfe61b8
# some files have Apache-2.0 license headers
bfe61b8
# https://github.com/eclipse-ee4j/jsp-api/issues/180
bfe61b8
License:        (EPL-2.0 or GPLv2 with exceptions) and ASL 2.0
bfe61b8
bfe61b8
# there's no code changes in jsp-api between 2.3.6 and IMPL-2.3.6 releases,
bfe61b8
# so we're using the more recent one
bfe61b8
%global upstream_version IMPL-%{version}-RELEASE
bfe61b8
bfe61b8
URL:            https://github.com/eclipse-ee4j/jsp-api
bfe61b8
Source0:        %{url}/archive/%{upstream_version}/%{srcname}-%{upstream_version}.tar.gz
bfe61b8
bfe61b8
# build with support for JDTJavaCompiler (for eclipse) and AntJavaCompiler
bfe61b8
Patch1:         0001-enable-support-for-JDTJavaCompiler-and-AntJavaCompil.patch
bfe61b8
# fix compilation errors due to unimplemented interfaces in newer servlet APIs
bfe61b8
Patch2:         0002-Port-to-latest-version-of-Servlet-API.patch
bfe61b8
bfe61b8
BuildArch:      noarch
bfe61b8
bfe61b8
BuildRequires:  maven-local
bfe61b8
BuildRequires:  mvn(jakarta.el:jakarta.el-api)
bfe61b8
BuildRequires:  mvn(jakarta.servlet:jakarta.servlet-api)
bfe61b8
BuildRequires:  mvn(javax.servlet:javax.servlet-api)
bfe61b8
BuildRequires:  mvn(org.apache.ant:ant)
bfe61b8
BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
bfe61b8
BuildRequires:  mvn(org.codehaus.mojo:build-helper-maven-plugin)
bfe61b8
BuildRequires:  mvn(org.eclipse.jdt:core)
bfe61b8
BuildRequires:  mvn(org.glassfish:javax.el)
bfe61b8
bfe61b8
# package renamed in fedora 33, remove in fedora 35
bfe61b8
Provides:       glassfish-jsp = %{version}-%{release}
bfe61b8
Obsoletes:      glassfish-jsp < 2.3.4-9
bfe61b8
bfe61b8
%description
bfe61b8
Jakarta Server Pages provides a container-independent implementation of
bfe61b8
the JSP API.
bfe61b8
bfe61b8
bfe61b8
%package api
bfe61b8
Summary:        Jakarta Server Pages (JSP) API
bfe61b8
bfe61b8
# package renamed in fedora 33, remove in fedora 35
bfe61b8
Provides:       glassfish-jsp-api = %{version}-%{release}
bfe61b8
Obsoletes:      glassfish-jsp-api < 2.3.3-6
bfe61b8
bfe61b8
%description api
bfe61b8
Jakarta Server Pages provides a container-independent implementation of
bfe61b8
the JSP API. This package contains the API only.
bfe61b8
bfe61b8
bfe61b8
%package javadoc
bfe61b8
Summary:        Javadoc for %{name}
bfe61b8
bfe61b8
# package renamed in fedora 33, remove in fedora 35
bfe61b8
Provides:       glassfish-jsp-javadoc = %{version}-%{release}
bfe61b8
Obsoletes:      glassfish-jsp-javadoc < 2.3.4-9
bfe61b8
Provides:       glassfish-jsp-api-javadoc = %{version}-%{release}
bfe61b8
Obsoletes:      glassfish-jsp-api-javadoc < 2.3.3-6
bfe61b8
bfe61b8
%description javadoc
bfe61b8
This package contains the API documentation for %{name}.
bfe61b8
bfe61b8
bfe61b8
%prep
bfe61b8
%autosetup -n %{srcname}-%{upstream_version} -p1
bfe61b8
bfe61b8
# remove unnecessary dependency on parent POM
bfe61b8
%pom_remove_parent . api impl
bfe61b8
bfe61b8
# do not build specification documentation
bfe61b8
%pom_disable_module spec
bfe61b8
bfe61b8
# do not install useless parent POM
bfe61b8
%mvn_package org.eclipse.ee4j.jsp:jsp-parent __noinstall
bfe61b8
bfe61b8
# reset jsp-api version from 2.3.7-SNAPSHOT to 2.3.6 (no code changes)
bfe61b8
sed -i "s/2\.3\.7-SNAPSHOT/2.3.6/" api/pom.xml
bfe61b8
028ba11
# ant and ecj should be optional OSGi requirements
028ba11
%pom_xpath_inject "pom:dependency[pom:groupId='org.apache.ant']" "<optional>true</optional>" impl
028ba11
%pom_xpath_inject "pom:dependency[pom:groupId='org.eclipse.jdt']" "<optional>true</optional>" impl
028ba11
bfe61b8
# this source file is excluded by maven-compiler-plugin configuration;
bfe61b8
# remove it entirely to fix building javadocs
bfe61b8
rm impl/src/main/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
bfe61b8
bfe61b8
# add aliases for old maven artifact coordinates
bfe61b8
%mvn_alias org.glassfish.web:jakarta.servlet.jsp \
bfe61b8
    org.eclipse.jetty.orbit:org.apache.jasper.glassfish \
bfe61b8
    org.glassfish.web:javax.servlet.jsp
bfe61b8
bfe61b8
%mvn_alias jakarta.servlet.jsp:jakarta.servlet.jsp-api \
bfe61b8
    javax.servlet.jsp:javax.servlet.jsp-api \
bfe61b8
    javax.servlet:jsp-api
bfe61b8
bfe61b8
# add compat symlinks for the old classpaths
bfe61b8
%mvn_file :jakarta.servlet.jsp     %{name}/jakarta.servlet.jsp     glassfish-jsp     javax.servlet.jsp
bfe61b8
%mvn_file :jakarta.servlet.jsp-api %{name}/jakarta.servlet.jsp-api glassfish-jsp-api
bfe61b8
bfe61b8
bfe61b8
%build
bfe61b8
%mvn_build -s
bfe61b8
bfe61b8
bfe61b8
%install
bfe61b8
%mvn_install
bfe61b8
bfe61b8
bfe61b8
%files -f .mfiles-jakarta.servlet.jsp
bfe61b8
%license LICENSE.md NOTICE.md
bfe61b8
%doc README.md
bfe61b8
bfe61b8
%files api -f .mfiles-jakarta.servlet.jsp-api
bfe61b8
%license LICENSE.md NOTICE.md
bfe61b8
bfe61b8
%files javadoc -f .mfiles-javadoc
bfe61b8
%license LICENSE.md NOTICE.md
bfe61b8
bfe61b8
bfe61b8
%changelog
028ba11
* Wed Aug 26 2020 Mat Booth <mat.booth@redhat.com> - 2.3.6-2
028ba11
- Make the OSGi dep on ant and ecj optional, jsp can be used without these
028ba11
bfe61b8
* Tue Aug 25 2020 Fabio Valentini <decathorpe@gmail.com> - 2.3.6-1
bfe61b8
- Initial package produced by merging glassfish-jsp and glassfish-jsp-api.
bfe61b8