Blob Blame History Raw
%global project felix
%global bundle org.apache.felix.gogo.command
%global groupId org.apache.felix
%global artifactId %{bundle}

%{!?scl:%global pkg_name %{name}}
%{?scl:%scl_package %{project}-gogo-command}
%{!?maven_scl:%global maven_scl_prefix %{nil}}

Name:           %{?scl_prefix}%{project}-gogo-command
Version:        0.12.0
Release:        9%{?dist}
Summary:        Apache Felix Gogo Command

Group:          Development/Libraries
License:        ASL 2.0
URL:            http://felix.apache.org
Source0:        http://www.apache.org/dist/felix/%{bundle}-%{version}-project.tar.gz

Patch0:         felix-gogo-command-pom.xml.patch
Patch1:         java7compatibility.patch

BuildArch:      noarch

BuildRequires:  java
# This is to ensure we get OpenJDK and not GCJ
BuildRequires:  java-1.7.0-openjdk-devel >= 1:1.7.0
BuildRequires:  %{maven_scl_prefix}maven-local
BuildRequires:  %{maven_scl_prefix}maven-dependency-plugin
BuildRequires:  %{maven_scl_prefix}maven-surefire-plugin
BuildRequires:  %{maven_scl_prefix}maven-surefire-provider-junit
BuildRequires:  %{maven_scl_prefix}jpackage-utils
BuildRequires:  %{maven_scl_prefix}maven-install-plugin
#BuildRequires:  mockito

BuildRequires:  %{maven_scl_prefix}felix-osgi-core
BuildRequires:  %{maven_scl_prefix}felix-framework
BuildRequires:  %{maven_scl_prefix}felix-osgi-compendium
BuildRequires:  %{?scl_prefix}felix-gogo-runtime
BuildRequires:  %{?scl_prefix}felix-gogo-parent
BuildRequires:   %{maven_scl_prefix}felix-bundlerepository
%{?scl:BuildRequires:	  %{?scl_prefix}build}

Requires:       felix-framework
Requires:       felix-osgi-compendium
Requires:       %{?scl_prefix}felix-gogo-runtime
Requires:       felix-bundlerepository
%{?scl:Requires: %scl_runtime}

%description
Provides basic shell commands for Gogo.

%package javadoc
Group:          Documentation
Summary:        Javadoc for %{pkg_name}
Requires:       jpackage-utils

%description javadoc
API documentation for %{pkg_name}.

%global POM %{_mavenpomdir}/JPP.%{project}-%{bundle}.pom

%prep
%setup -q -n %{bundle}-%{version} 
%patch0 -p1
%patch1 -p1

%build
scl enable %{scl} - <<EOF
%mvn_build
EOF

%install
scl enable %{scl} - <<EOF
%mvn_install
EOF

jdir=target/site/apidocs
install -dm755 %{buildroot}%{_javadocdir}/%{pkg_name}
touch %{_builddir}/.mfiles-javadoc
for f in `ls $jdir | grep -E "html|css"`; do
  cp $jdir/$f %{buildroot}%{_javadocdir}/%{pkg_name}/;
  echo %{_javadocdir}/%{pkg_name}/$f >> %{_builddir}/%{bundle}-%{version}/.mfiles-javadoc;
done

%files -f .mfiles
%doc LICENSE

%files javadoc -f .mfiles-javadoc
%doc LICENSE

%changelog
* Sat May 17 2014 Sami Wagiaalla <swagiaal@redhat.com> 0.12.0-9
- Use pkg_name instead of name for javadoc location.

* Sat May 17 2014 Sami Wagiaalla <swagiaal@redhat.com> 0.12.0-8
- Build for DTS 3 build
- Install javadoc manually
- Use java-1.7.0-openjdk-devel for java-devel req.

* Fri May 16 2014 Sami Wagiaalla <swagiaal@redhat.com> 0.12.0-8
- Prepare for DTS 3 build
- Copy mvn_rpmbuild fix from rawhide.
- Use maven scl for maven packages.
- enable maven scl for maven commands.

* Wed Feb 13 2013 Krzysztof Daniel <kdaniel@redhat.com> 0.12.0-7
- Make the package noarch.

* Fri Dec 7 2012 Krzysztof Daniel <kdaniel@redhat.com> 0.12.0-6
- Remove unnecessary runtime dependencies.

* Wed Nov 21 2012 Krzysztof Daniel <kdaniel@redhat.com> 0.12.0-5
- Added Exclusive arch.

* Fri Nov 9 2012 Krzysztof Daniel <kdaniel@redhat.com> 0.12.0-1
- Initial contribution to SCL.