Blob Blame History Raw
%global namedreltag %{nil}
%global _version %(echo %version | tr . _)
%global namedversion %{_version}%{?namedreltag}

# Conditionals to help breaking grizzly <-> jersey dependency cycle
%if 0%{?fedora}
%bcond_with jersey
%bcond_with jaxws
%endif

Name:          grizzly
Version:       2.3.24
Release:       9%{?dist}
Summary:       Java NIO Server Framework
# see Grizzly_THIRDPARTYLICENSEREADME.txt
License:       (CDDL or GPLv2 with exceptions) and BSD and ASL 2.0 and Public Domain
URL:           http://grizzly.java.net/
# git clone git://java.net/grizzly~git
# (cd grizzly~git/ && git archive --format=tar --prefix=grizzly-2.3.6/ 2_3_6 | xz > ../grizzly-2.3.6.tar.xz)
Source0:       https://github.com/GrizzlyNIO/grizzly-mirror/archive/%{namedversion}.tar.gz

BuildRequires: maven-local
BuildRequires: mvn(com.sun.istack:istack-commons-maven-plugin)
%if %{with jersey}
BuildRequires: mvn(com.sun.jersey:jersey-client)
BuildRequires: mvn(com.sun.jersey:jersey-server)
BuildRequires: mvn(com.sun.jersey:jersey-servlet)
%endif
%if %{with jaxws}
BuildRequires: mvn(com.sun.xml.ws:rt)
%endif
BuildRequires: mvn(javax.servlet:javax.servlet-api)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(net.java:jvnet-parent:pom:)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires: mvn(org.codehaus.mojo:exec-maven-plugin)
BuildRequires: mvn(org.glassfish.gmbal:gmbal)
BuildRequires: mvn(org.glassfish.gmbal:gmbal-api-only)
BuildRequires: mvn(org.glassfish.grizzly:grizzly-npn-api)
BuildRequires: mvn(org.glassfish.grizzly:grizzly-npn-bootstrap)
BuildRequires: mvn(org.glassfish.hk2:hk2-inhabitant-generator)
BuildRequires: mvn(org.glassfish.hk2:osgiversion-maven-plugin)
BuildRequires: mvn(org.mockito:mockito-all)
BuildRequires: mvn(org.osgi:osgi.cmpn)
BuildRequires: mvn(org.osgi:osgi.core)

BuildArch:     noarch

%description
Writing scalable server applications in the Java programming
language has always been difficult. Before the advent of the
Java New I/O API (NIO), thread management issues made it
impossible for a server to scale to thousands of users. The
Grizzly framework has been designed to help developers to take
advantage of the Java NIO API. Originally developed under the
GlassFish umbrella, the framework is now available as a
standalone project. Grizzly goals is to help developers to
build scalable and robust servers using NIO.

%package samples
Summary:       Grizzly samples

%description samples
This package contains samples for %{name}.

%package javadoc
Summary:       Javadoc for %{name}

%description javadoc
This package contains javadoc for %{name}.

%prep
%setup -q -n %{name}-mirror-%{namedversion}
find . -name '*.class' -delete
find . -name '*.jar' -print -delete
find . -name '*.js' -print -delete

# unavailable deps
# org.jvnet.maven-antrun-extended-plugin maven-antrun-extended-plugin
%pom_disable_module bundles extras
%pom_disable_module bundles modules

# use latest OSGi implementation
%pom_change_dep -r :org.osgi.core org.osgi:osgi.core
%pom_change_dep -r :org.osgi.compendium org.osgi:osgi.cmpn

# org.ops4j maven-pax-plugin  1.5
%pom_disable_module grizzly-httpservice extras
# Unsupport war extension
%pom_disable_module comet samples
%pom_disable_module websockets/chat samples
%pom_disable_module websockets/chat-ssl samples

%pom_remove_dep :maven-bundle-plugin
%pom_remove_dep :maven-plugin-tools-api
%pom_remove_dep org.glassfish.hk2:config-types
%pom_remove_dep org.glassfish.hk2:core
%pom_remove_dep org.glassfish.hk2:hk2-config
%pom_remove_dep org.glassfish.hk2:hk2-locator
%pom_remove_dep org.glassfish.hk2:osgi-adapter

# wagon-webdav & wagon-ssh-external
%pom_xpath_remove "pom:build/pom:extensions"

# org.glassfish.grizzly:grizzly-npn-bootstrap:1.0
%pom_xpath_inject "pom:dependency[pom:artifactId = 'grizzly-spdy']" '<version>${project.version}</version>' samples/spdy-samples

#%% pom_remove_dep org.glassfish.grizzly:documentation bom
%pom_remove_dep org.glassfish.grizzly:grizzly-comet-server bom
%pom_remove_dep org.glassfish.grizzly:grizzly-compression bom
%pom_remove_dep org.glassfish.grizzly:grizzly-core bom
%pom_remove_dep org.glassfish.grizzly:grizzly-http-all bom
%pom_remove_dep org.glassfish.grizzly:grizzly-http-server-core bom
%pom_remove_dep org.glassfish.grizzly:grizzly-http-server-jaxws bom
%pom_remove_dep org.glassfish.grizzly:grizzly-http-servlet-server bom
%pom_remove_dep org.glassfish.grizzly:grizzly-websockets-server bom
%pom_remove_dep org.glassfish.grizzly.osgi:grizzly-httpservice bom
%pom_remove_dep org.glassfish.grizzly.osgi:grizzly-httpservice-bundle bom
%pom_remove_plugin :maven-antrun-extended-plugin bom
%pom_remove_plugin :glassfish-copyright-maven-plugin bom

%pom_remove_plugin :findbugs-maven-plugin
%pom_remove_plugin :glassfish-copyright-maven-plugin
%pom_remove_plugin :nexus-maven-plugin
%pom_remove_plugin :maven-source-plugin
%pom_xpath_remove "pom:plugin[pom:artifactId='maven-javadoc-plugin']/pom:executions"

%if %{without jersey}
%pom_remove_dep com.sun.jersey: modules/http-servlet
rm -rf modules/http-servlet/src/test/java/filter/*
%else
%pom_add_dep com.sun.jersey:jersey-servlet:'${jersey-version}':test modules/http-servlet
%endif

cp -p modules/grizzly/src/main/resources/Grizzly_THIRDPARTYLICENSEREADME.txt .
sed -i 's/\r//' LICENSE.txt Grizzly_THIRDPARTYLICENSEREADME.txt

%pom_xpath_set -r "pom:plugin[pom:groupId='com.sun.istack']/pom:artifactId" istack-commons-maven-plugin

# Force servlet 3.1 apis
%pom_change_dep -r javax.servlet:servlet-api javax.servlet:javax.servlet-api:'${servlet-version}'

%if %{without jaxws}
%pom_disable_module http-server-jaxws extras
%pom_disable_module http-jaxws-samples samples
%else
%pom_change_dep com.sun.xml.ws: :rt extras/http-server-jaxws
%pom_change_dep com.sun.xml.ws: :rt samples/http-jaxws-samples
%endif

for m in http2 spdy ; do
%pom_xpath_remove "pom:plugin[pom:artifactId='maven-jar-plugin']/pom:configuration/pom:useDefaultManifestFile" modules/${m}
%pom_xpath_inject "pom:plugin[pom:artifactId='maven-jar-plugin']/pom:configuration" '
  <archive>
    <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  </archive>' modules/${m}
done

%mvn_package org.glassfish.grizzly.samples: samples

%build
# forcing the use of required glassfish-servlet-api 3.1 apis
# test skipped on arm builder
# https://bugzilla.redhat.com/show_bug.cgi?id=991712
%mvn_build \
%ifarch %{arm}
 -f -- \
%else
 -- -Dmaven.test.failure.ignore=true \
%endif
 -Dmaven.local.depmap.file="%{_mavendepmapfragdir}/glassfish-servlet-api.xml"

%install
%mvn_install

(
  cd %{buildroot}%{_javadir}/%{name}
  ln -sf %{name}-framework.jar %{name}.jar
)

%files -f .mfiles
%{_javadir}/%{name}/%{name}.jar
%license LICENSE.txt Grizzly_THIRDPARTYLICENSEREADME.txt

%files samples -f .mfiles-samples
%license LICENSE.txt Grizzly_THIRDPARTYLICENSEREADME.txt

%files javadoc -f .mfiles-javadoc
%license LICENSE.txt Grizzly_THIRDPARTYLICENSEREADME.txt

%changelog
* Tue Oct 08 2019 Fabio Valentini <decathorpe@gmail.com> - 2.3.24-9
- Migrate away from the retired felix OSGi implementation.

* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.24-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.24-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.24-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.24-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.24-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.24-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Fri Jun 24 2016 gil cattaneo <puntogil@libero.it> 2.3.24-2
- disable jaxws support

* Thu Feb 18 2016 gil cattaneo <puntogil@libero.it> 2.3.24-1
- update to 2.3.24

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.23-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Oct 04 2015 gil cattaneo <puntogil@libero.it> 2.3.23-1
- update to 2.3.23

* Tue Aug 11 2015 gil cattaneo <puntogil@libero.it> 2.3.21-1
- update to 2.3.21

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.19-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon May 04 2015 gil cattaneo <puntogil@libero.it> 2.3.19-1
- update to 2.3.19

* Tue Feb 03 2015 gil cattaneo <puntogil@libero.it> 2.3.6-3
- introduce license macro

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Oct 04 2013 gil cattaneo <puntogil@libero.it> 2.3.6-1
- update to 2.3.6

* Fri Aug 09 2013 gil cattaneo <puntogil@libero.it> 2.3.4-1
- update to 2.3.4

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Jul 10 2013 gil cattaneo <puntogil@libero.it> 2.3.3-1
- update to 2.3.3
- built with XMvn
- enable glassfish-jaxws support

* Sat May 18 2013 gil cattaneo <puntogil@libero.it> 2.3.2-2
- fix aId for new istack-commons maven plugin

* Sat May 04 2013 gil cattaneo <puntogil@libero.it> 2.3.2-1
- update to 2.3.2

* Sat Apr 20 2013 gil cattaneo <puntogil@libero.it> 2.3.1-2
- fix License tag

* Wed Apr 17 2013 gil cattaneo <puntogil@libero.it> 2.3.1-1
- update to 2.3.1

* Thu Apr 11 2013 gil cattaneo <puntogil@libero.it> 2.3-1
- update to 2.3

* Wed Mar 13 2013 gil cattaneo <puntogil@libero.it> 2.3-0.1.rc4
- update to 2.3-rc4

* Fri Feb 22 2013 gil cattaneo <puntogil@libero.it> 2.3-0.1.beta9
- update to 2.3-beta9

* Thu Dec 13 2012 gil cattaneo <puntogil@libero.it> 2.3-0.1.beta8
- update to 2.3-beta8

* Wed Oct 24 2012 gil cattaneo <puntogil@libero.it> 2.3-0.1.beta6
- update to 2.3-beta6

* Mon Oct 22 2012 gil cattaneo <puntogil@libero.it> 2.2.19-1
- update to 2.2.19

* Wed Sep 19 2012 gil cattaneo <puntogil@libero.it> 2.2.18-1
- initial rpm