Blame SPECS/jgraphx.spec

623e46
%{?scl:%scl_package jgraphx}
623e46
%{!?scl:%global pkg_name %{name}}
623e46
623e46
# Use java common's requires/provides generator
623e46
%{?java_common_find_provides_and_requires}
623e46
623e46
%if 0%{?rhel}
623e46
623e46
%if 0%{?rhel} <= 6
623e46
  # EL 6
623e46
  %global custom_release 60
623e46
%else
623e46
  # EL 7
623e46
  %global custom_release 70
623e46
%endif
623e46
623e46
%else
623e46
623e46
%global custom_release 1
623e46
623e46
%endif
623e46
623e46
Name:           %{?scl_prefix}jgraphx
623e46
Version:        3.1.2.0
38c2e5
Release:        %{custom_release}.3%{?dist}
623e46
Summary:        Java Graph Drawing Component
623e46
623e46
Group:          Development/Libraries
623e46
License:        BSD
623e46
URL:            http://www.jgraph.com/jgraph.html
623e46
Source0:        http://www.jgraph.com/downloads/jgraphx/archive/%{pkg_name}-%(echo %{version} |sed 's/\./_/g').zip
623e46
Source1:        bnd.properties
623e46
623e46
BuildRequires:  %{?scl_prefix_maven}javapackages-local
623e46
BuildRequires:  %{?scl_prefix_java_common}ant
623e46
BuildRequires:  %{?scl_prefix_maven}aqute-bnd
623e46
623e46
BuildArch:      noarch
623e46
623e46
%description
623e46
JGraphX is the a powerful, easy-to-use and feature-rich graph drawing
623e46
component for Java. It is a rewrite of JGraph, also known as JGraph 6.
623e46
623e46
%package javadoc
623e46
Summary:        API Documentation for %{name}
623e46
Group:          Documentation
623e46
623e46
%description javadoc
623e46
JavaDoc documentation for %{name}
623e46
623e46
%prep
623e46
%setup -q -n %{pkg_name}
623e46
find -name '*.jar' -delete
623e46
rm -rf docs/api
623e46
623e46
%build
623e46
%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"}
623e46
set -x
623e46
ant build maven-jar
623e46
623e46
#Convert to OSGi bundle
623e46
pushd lib
623e46
# Make versions 3 parts only. That is: A.B.C.D => A.B.C
623e46
VER=$(echo %{version} | sed 's/^\([0-9]\+\.[0-9]\+\.[0-9]\+\)\.[0-9]\+$/\1/')
623e46
sed "s/__VERSION__/$VER/g" %{SOURCE1} > bnd.props
623e46
%if 0%{?fedora}
623e46
  bnd wrap --output %{pkg_name}.bar --properties bnd.props \
623e46
           --version $VER %{pkg_name}.jar
623e46
%else
623e46
  java -jar $(build-classpath aqute-bnd) wrap -output jgraphx.bar -properties bnd.props %{pkg_name}.jar
623e46
%endif
623e46
mv %{pkg_name}.bar %{pkg_name}.jar
623e46
popd
623e46
%{?scl:EOF}
623e46
623e46
%install
623e46
%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"}
623e46
%mvn_artifact pom.xml lib/%{pkg_name}.jar
623e46
%mvn_install -J docs/api/
623e46
%{?scl:EOF}
623e46
623e46
%files -f .mfiles
623e46
%dir %{_javadir}/%{pkg_name}
623e46
%dir %{_mavenpomdir}/%{pkg_name}
623e46
%if 0%{?rhel} <= 6
623e46
  %doc license.txt
623e46
%else
623e46
  %license license.txt
623e46
%endif
623e46
623e46
%files javadoc -f .mfiles-javadoc
623e46
%if 0%{?rhel} <= 6
623e46
  %doc license.txt
623e46
%else
623e46
  %license license.txt
623e46
%endif
623e46
623e46
%changelog
38c2e5
* Tue Jan 17 2017 Jie Kang <jkang@redhat.com> - 3.1.2.0-3
38c2e5
- Rebuild for RHSCL 2.4.
38c2e5
623e46
* Mon Jun 27 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.1.2.0-2
623e46
- Be sure to use 3 parts in BSN only.
623e46
623e46
* Fri Jun 24 2016 Severin Gehwolf <sgehwolf@redhat.com> - 3.1.2.0-1
623e46
- Initial package.