Blob Blame History Raw
# Copyright (c) 2000-2005, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the JPackage Project nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

%define _with_gcj_support 1

%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}

%define base_name	modeler
%define short_name	commons-%{base_name}
%define name		jakarta-%{short_name}
%define version		1.1
%define release		6jpp_1fc
%define	section		free

Name:		%{name}
Version:	%{version}
Release:	%{release}
Epoch:		0
Summary:	Jakarta Commons Modeler Package
License:	Apache Software License
Group:		Development/Libraries/Java
Source0:	%{base_name}-%{version}-src.tar.gz
#Patch:		%{name}.no-licence.build.patch
Url:		http://jakarta.apache.org/commons/%{base_name}
BuildRequires:	ant
BuildRequires:	jaxp_parser_impl
BuildRequires:	xml-commons-apis
BuildRequires:	jaxp_transform_impl
BuildRequires:	jmxri
BuildRequires:	junit >= 0:3.7
BuildRequires:	jakarta-commons-beanutils >= 0:1.3
BuildRequires:	jakarta-commons-collections >= 0:2.0
BuildRequires:	jakarta-commons-digester >= 0:1.2
BuildRequires:	jakarta-commons-logging >= 0:1.0
Requires:	jaxp_parser_impl
Requires:	xml-commons-apis
Requires:	jaxp_transform_impl
Requires:	jmxri
Requires:	jakarta-commons-beanutils >= 0:1.3
Requires:	jakarta-commons-collections >= 0:2.0
Requires:	jakarta-commons-digester >= 0:1.2
Requires:	jakarta-commons-logging >= 0:1.0
%if ! %{gcj_support}
BuildArch:	noarch
%endif
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot
Provides:	%{short_name}
Obsoletes:	%{short_name}

%if %{gcj_support}
BuildRequires:		java-gcj-compat-devel
Requires(post):		java-gcj-compat
Requires(postun):	java-gcj-compat
%endif

%description
The Modeler project shall create and maintain a set of Java
classes to provide the facilities described in the preceeding section, plus
unit tests and small examples of using these facilities to instrument
Java classes with Model MBean support.

%package javadoc
Summary:	Javadoc for %{name}
Group:		Development/Documentation

%description javadoc
Javadoc for %{name}.

%prep
%setup -n %{short_name}-%{version}-src
#%%patch
# remove all binary libs
find . -name "*.jar" -exec rm -f {} \;

%build
export CLASSPATH=$(build-classpath xml-commons-apis jaxp_parser_impl jaxp_transform_impl jmxri junit commons-beanutils commons-collections commons-digester commons-logging)
%ant dist

%install
# jars
%__mkdir_p %{buildroot}%{_javadir}
%__cp -a dist/%{short_name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %__ln_s ${jar} `echo $jar| %__sed  "s|jakarta-||g"`; done)
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %__ln_s ${jar} `echo $jar| %__sed  "s|-%{version}||g"`; done)
# javadoc
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
%__cp -a dist/docs/* %{buildroot}%{_javadocdir}/%{name}-%{version}
(cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-%{version} %{name})

%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif

%clean
%__rm -rf %{buildroot}

%post javadoc
%__rm -f %{_javadocdir}/%{name}
%__ln_s %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ $1 -eq 0 ]; then
  %__rm -f %{_javadocdir}/%{name}
fi

%post
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
  %{_bindir}/rebuild-gcj-db
fi
%endif

%postun
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
  %{_bindir}/rebuild-gcj-db
fi
%endif

%files
%defattr(0644,root,root,0755)
%doc STATUS.html RELEASE-NOTES.txt PROPOSAL.html
%{_javadir}/*

%if %{gcj_support}
%attr(-,root,root) %{_libdir}/gcj/%{name}/jakarta-commons-modeler-1.1.jar.*
%endif

%files javadoc
%defattr(0644,root,root,0755)
%dir %{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}-%{version}/*
%ghost %dir %{_javadocdir}/%{name}

%changelog
* Mon Jul 17 2006 Matt Wringe <mwringe at redhat.com> - 0:1.1-6jpp_1fc
- Added contional native compilation.
- Merge with upstream version.

* Wed Apr 26 2006 Fernando Nasser <fnasser@redhat.com> - 0:1.1-5jpp
- First JPP 1.7 build

* Thu Feb 24 2005 David Walluck <david@jpackage.org> 0:1.1-4jpp
- add missing epochs to dependencies
- add non-versioned javadoc symlink
- fix file permissions

* Sun Aug 23 2004 Randy Watler <rwatler at finali.com> - 0:1.1-3jpp
- Rebuild with ant-1.6.2
* Thu Oct 09 2003 Henri Gomez <hgomez at users.sourceforge.net> 0:1.1-2jpp
- fix junit typo (reported by Kaj J. Niemi)

* Wed Oct 08 2003 Henri Gomez <hgomez at users.sourceforge.net> 0:1.1-1jpp
- modeler 1.1

* Tue Mar 25 2003 Nicolas Mailhot <Nicolas.Mailhot (at) JPackage.org> 1.0-6jpp
- for jpackage-utils 1.5

* Thu Feb 27 2003 Henri Gomez <hgomez@users.sourceforge.net> 1.0-5jpp
- fix ASF license

* Thu Feb 27 2003 Henri Gomez <hgomez@users.sourceforge.net> 1.0-4jpp
- fix missing packager tag
- fix new mx4j jar name (mx4j-jmx.jar)

* Fri Jul 12 2002 Henri Gomez <hgomez@users.sourceforge.net> 1.0-3jpp
- updated requires for jaxp_parser_impl and xml-commons-apis

* Mon Jun 10 2002 Henri Gomez <hgomez@users.sourceforge.net> 1.0-2jpp
- use sed instead of bash 2.x extension in link area to make spec compatible
  with distro using bash 1.1x

* Fri Jun 07 2002 Henri Gomez <hgomez@users.sourceforge.net> 1.0-1jpp 
- 1.0
- added short names in %{_javadir}, as does jakarta developpers
- first jPackage release