f2b4954
# Copyright (c) 2000-2008, JPackage Project
f2b4954
# All rights reserved.
f2b4954
#
f2b4954
# Redistribution and use in source and binary forms, with or without
f2b4954
# modification, are permitted provided that the following conditions
f2b4954
# are met:
f2b4954
#
f2b4954
# 1. Redistributions of source code must retain the above copyright
f2b4954
#    notice, this list of conditions and the following disclaimer.
f2b4954
# 2. Redistributions in binary form must reproduce the above copyright
f2b4954
#    notice, this list of conditions and the following disclaimer in the
f2b4954
#    documentation and/or other materials provided with the
f2b4954
#    distribution.
f2b4954
# 3. Neither the name of the JPackage Project nor the names of its
f2b4954
#    contributors may be used to endorse or promote products derived
f2b4954
#    from this software without specific prior written permission.
f2b4954
#
f2b4954
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
f2b4954
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
f2b4954
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
f2b4954
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
f2b4954
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
f2b4954
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
f2b4954
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
f2b4954
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
f2b4954
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
f2b4954
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
f2b4954
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f2b4954
#
f2b4954
f2b4954
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
f2b4954
f2b4954
%define section   free
f2b4954
f2b4954
Name:           aqute-bndlib
f2b4954
Version:        0.0.203
3b6469f
Release:        4.1%{?dist}
f2b4954
Epoch:          0
f2b4954
Summary:        BND Library
f2b4954
License:        ASL 2.0
f2b4954
Group:          Development/Java
f2b4954
URL:            http://www.aQute.biz/Code/Bnd
f2b4954
Source0:        http://www.aqute.biz/repo/biz/aQute/bnd/0.0.203/bnd-0.0.203.jar
f2b4954
Source1:        http://www.aqute.biz/repo/biz/aQute/bnd/0.0.203/bnd-0.0.203.pom
f2b4954
Patch0:         aQute-bndlib-Filter.patch
f2b4954
f2b4954
f2b4954
%if %{gcj_support}
f2b4954
BuildRequires:    java-gcj-compat-devel
f2b4954
Requires(post):   java-gcj-compat
f2b4954
Requires(postun): java-gcj-compat
f2b4954
%endif
f2b4954
f2b4954
f2b4954
%if ! %{gcj_support}
f2b4954
BuildArch:      noarch
f2b4954
%endif
f2b4954
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
f2b4954
f2b4954
BuildRequires:  jpackage-utils >= 0:1.7.2
f2b4954
BuildRequires:  java-devel >= 0:1.5.0
f2b4954
BuildRequires:  ant >= 0:1.6.5
f2b4954
#BuildRequires:  ecj
f2b4954
BuildRequires:  eclipse-ecj
f2b4954
BuildRequires:  eclipse-jdt
f2b4954
f2b4954
Requires:  java >= 0:1.5.0
f2b4954
Requires(post):    jpackage-utils >= 0:1.7.2
f2b4954
Requires(postun):  jpackage-utils >= 0:1.7.2
f2b4954
f2b4954
%description
f2b4954
The bnd tool helps you create and diagnose OSGi R4 bundles.
f2b4954
The key functions are: 
f2b4954
- Show the manifest and JAR contents of a bundle 
f2b4954
- Wrap a JAR so that it becomes a bundle 
f2b4954
- Create a Bundle from a specification and a class path 
f2b4954
- Verify the validity of the manifest entries 
f2b4954
The tool is capable of acting as: 
f2b4954
- Command line tool 
f2b4954
- File format 
f2b4954
- Directives 
f2b4954
- Use of macros 
f2b4954
f2b4954
%package javadoc
f2b4954
Summary:        Javadoc for %{name}
f2b4954
Group:          Development/Documentation
f2b4954
f2b4954
%description javadoc
f2b4954
Javadoc for %{name}.
f2b4954
f2b4954
f2b4954
%prep
f2b4954
%setup -q -c
f2b4954
mkdir -p target/site/apidocs/
f2b4954
mkdir -p target/classes/
f2b4954
mkdir -p src/main/
f2b4954
mv OSGI-OPT/src src/main/java
f2b4954
%patch0 -b .sav0
f2b4954
f2b4954
%build
f2b4954
export LANG=en_US.utf8
f2b4954
export OPT_JAR_LIST=:
f2b4954
export CLASSPATH=$(build-classpath ant)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.osgi_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.osgi.services_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.jface_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.ui_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.core.jobs_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.core.runtime_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.core.resources_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.ui.workbench_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/dropins/jdt/plugins/org.eclipse.jdt.core_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.equinox.common_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.equinox.registry_*.jar)
f2b4954
CLASSPATH=${CLASSPATH}:$(ls %{_libdir}/eclipse/plugins/org.eclipse.swt.*.jar)
f2b4954
f2b4954
%{javac} -d target/classes $(find src/main/java -type f -name "*.java")
f2b4954
%{javadoc} -d target/site/apidocs -sourcepath src/main/java aQute.lib.header aQute.lib.osgi aQute.lib.qtokens aQute.lib.filter
f2b4954
cp -p LICENSE maven-dependencies.txt plugin.xml pom.xml target/classes
f2b4954
for f in $(find aQute/ -type f -not -name "*.class"); do
f2b4954
    cp -p $f target/classes/$f
f2b4954
done
f2b4954
pushd target/classes
f2b4954
%{jar} cmf ../../META-INF/MANIFEST.MF ../%{name}-%{version}.jar *
f2b4954
popd
f2b4954
f2b4954
%install
f2b4954
rm -rf $RPM_BUILD_ROOT
f2b4954
f2b4954
# jars
f2b4954
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
f2b4954
install -pm 644 target/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
f2b4954
%add_to_maven_depmap biz.aQute bndlib %{version} JPP %{name}
f2b4954
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
f2b4954
f2b4954
# pom
f2b4954
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
f2b4954
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom
f2b4954
f2b4954
# javadoc
f2b4954
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
f2b4954
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
f2b4954
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
f2b4954
f2b4954
%if %{gcj_support}
f2b4954
%{_bindir}/aot-compile-rpm
f2b4954
%endif
f2b4954
f2b4954
%clean
f2b4954
rm -rf $RPM_BUILD_ROOT
f2b4954
f2b4954
%post
f2b4954
%update_maven_depmap
f2b4954
%if %{gcj_support}
f2b4954
if [ -x %{_bindir}/rebuild-gcj-db ]
f2b4954
then
f2b4954
  %{_bindir}/rebuild-gcj-db
f2b4954
fi
f2b4954
%endif
f2b4954
f2b4954
%postun
f2b4954
%update_maven_depmap
f2b4954
%if %{gcj_support}
f2b4954
if [ -x %{_bindir}/rebuild-gcj-db ]
f2b4954
then
f2b4954
  %{_bindir}/rebuild-gcj-db
f2b4954
fi
f2b4954
%endif
f2b4954
f2b4954
%files
f2b4954
%defattr(0644,root,root,0755)
f2b4954
%{_javadir}/%{name}-%{version}.jar
f2b4954
%{_javadir}/%{name}.jar
f2b4954
%{_datadir}/maven2/poms/JPP-aqute-bndlib.pom
f2b4954
%{_mavendepmapfragdir}/aqute-bndlib
f2b4954
%if %{gcj_support}
f2b4954
%dir %{_libdir}/gcj/%{name}
f2b4954
%attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}-%{version}.jar.db
f2b4954
%attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}-%{version}.jar.so
f2b4954
%endif
f2b4954
f2b4954
%files javadoc
f2b4954
%defattr(0644,root,root,0755)
f2b4954
%{_javadocdir}/%{name}-%{version}
f2b4954
%{_javadocdir}/%{name}
f2b4954
f2b4954
%changelog
3b6469f
* Wed May 20 2009 Fernando Nasser <fnasser@redhat.com> 0.0.203-4.1
3b6469f
- Remove unedded BRs at Andrew Overholt's recommendation
3b6469f
f2b4954
* Fri Mar 20 2009 Yong Yang <yyang@redhat.com> 0.0.203-4
f2b4954
- rebuild with new maven2 2.0.8 built in bootstrap mode
f2b4954
- merge from JPP-6
f2b4954
f2b4954
* Tue Jan 15 2009 David Walluck <dwalluck@redhat.com> 0:0.0.203-3
f2b4954
- fix build
f2b4954
f2b4954
* Thu Jan 15 2009 Yong Yang <yyang@redhat.com> 0.0.203-3jpp.1
f2b4954
- Imported from dbhole's maven 2.0.8 packages, initial building
f2b4954
f2b4954
* Tue Mar 11 2008 Deepak Bhole <dbhole@redhat.com> 0.0.203-2jpp.1
f2b4954
- Import from JPackage + change per Fedora requirements
f2b4954
f2b4954
* Thu Feb 14 2008 Ralph Apel <r.apel@r-apel.de> - 0:0.0.203-2jpp
f2b4954
- Add several non class files to jar
f2b4954
f2b4954
* Mon Jan 07 2008 Ralph Apel <r.apel@r-apel.de> - 0:0.0.203-1jpp
f2b4954
- First release
f2b4954