Permaine Cheung 2f7cab9
# Copyright (c) 2000-2007, JPackage Project
Permaine Cheung 54e2ebb
# All rights reserved.
Permaine Cheung 54e2ebb
#
Permaine Cheung 54e2ebb
# Redistribution and use in source and binary forms, with or without
Permaine Cheung 54e2ebb
# modification, are permitted provided that the following conditions
Permaine Cheung 54e2ebb
# are met:
Permaine Cheung 54e2ebb
#
Permaine Cheung 54e2ebb
# 1. Redistributions of source code must retain the above copyright
Permaine Cheung 54e2ebb
#    notice, this list of conditions and the following disclaimer.
Permaine Cheung 54e2ebb
# 2. Redistributions in binary form must reproduce the above copyright
Permaine Cheung 54e2ebb
#    notice, this list of conditions and the following disclaimer in the
Permaine Cheung 54e2ebb
#    documentation and/or other materials provided with the
Permaine Cheung 54e2ebb
#    distribution.
Permaine Cheung 54e2ebb
# 3. Neither the name of the JPackage Project nor the names of its
Permaine Cheung 54e2ebb
#    contributors may be used to endorse or promote products derived
Permaine Cheung 54e2ebb
#    from this software without specific prior written permission.
Permaine Cheung 54e2ebb
#
Permaine Cheung 54e2ebb
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Permaine Cheung 54e2ebb
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Permaine Cheung 54e2ebb
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Permaine Cheung 54e2ebb
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Permaine Cheung 54e2ebb
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Permaine Cheung 54e2ebb
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Permaine Cheung 54e2ebb
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Permaine Cheung 54e2ebb
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Permaine Cheung 54e2ebb
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Permaine Cheung 54e2ebb
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Permaine Cheung 54e2ebb
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Permaine Cheung 54e2ebb
#
Permaine Cheung 54e2ebb
Permaine Cheung 2f7cab9
%define gcj_support 1
Permaine Cheung 2f7cab9
Permaine Cheung 54e2ebb
Name:           xmlunit
Permaine Cheung 54e2ebb
Version:        1.0
c5eb55c
Release:        6jpp.1%{?dist}
Permaine Cheung 54e2ebb
Epoch:          0
Permaine Cheung 2f7cab9
Summary:        Provides classes to do asserts on xml
Permaine Cheung 2f7cab9
License:        BSD
Permaine Cheung 54e2ebb
Source0:        http://download.sourceforge.net/xmlunit/xmlunit1.0.zip
Permaine Cheung 2f7cab9
Source1:        http://repo1.maven.org/maven2/xmlunit/xmlunit/1.0/xmlunit-1.0.pom
Permaine Cheung 54e2ebb
Patch0:         xmlunit-build_xml.patch
Permaine Cheung 54e2ebb
URL:            http://xmlunit.sourceforge.net/
Permaine Cheung 2f7cab9
BuildRequires:  jpackage-utils >= 0:1.7.3
Permaine Cheung 2f7cab9
BuildRequires:  java-devel >= 1.4.2
Permaine Cheung 2f7cab9
BuildRequires:  ant >= 0:1.6.5
Permaine Cheung 2f7cab9
BuildRequires:  ant-junit
Permaine Cheung 2f7cab9
BuildRequires:  ant-trax
Permaine Cheung 2f7cab9
BuildRequires:  junit >= 0:3.8.1
Permaine Cheung 54e2ebb
BuildRequires:  xalan-j2
Permaine Cheung 54e2ebb
BuildRequires:  xerces-j2
Permaine Cheung 54e2ebb
BuildRequires:  xml-commons-apis
Permaine Cheung 54e2ebb
Requires:       junit >= 0:3.8
Permaine Cheung 54e2ebb
Requires:       xalan-j2
Permaine Cheung 54e2ebb
Requires:       xml-commons-apis
Permaine Cheung 54e2ebb
Requires:       jaxp_parser_impl
Permaine Cheung 54e2ebb
Group:          Development/Testing
Permaine Cheung 2f7cab9
%if ! %{gcj_support}
Permaine Cheung 54e2ebb
BuildArch:      noarch
Permaine Cheung 2f7cab9
%endif
Permaine Cheung 2f7cab9
%if %{gcj_support}
Permaine Cheung 2f7cab9
BuildRequires:    java-gcj-compat-devel
Permaine Cheung 2f7cab9
Requires(post):   java-gcj-compat
Permaine Cheung 2f7cab9
Requires(postun): java-gcj-compat
Permaine Cheung 2f7cab9
%endif
Permaine Cheung 54e2ebb
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
%description
Permaine Cheung 54e2ebb
XMLUnit extends JUnit to simplify unit testing of XML. It compares a control
Permaine Cheung 54e2ebb
XML document to a test document or the result of a transformation, validates
Permaine Cheung 54e2ebb
documents against a DTD, and (from v0.5) compares the results of XPath
Permaine Cheung 54e2ebb
expressions.
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
%package        javadoc
Permaine Cheung 54e2ebb
Summary:        Javadoc for %{name}
Permaine Cheung 54e2ebb
Group:          Development/Documentation
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
%description    javadoc
Permaine Cheung 54e2ebb
Javadoc for %{name}
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
%prep
Permaine Cheung 54e2ebb
%setup -q -n %{name}
Permaine Cheung 54e2ebb
# remove all binary libs and javadocs
Permaine Cheung 54e2ebb
find . -name "*.jar" -exec rm -f {} \;
Permaine Cheung 54e2ebb
rm -rf doc
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
cat >build.properties <
Permaine Cheung 2f7cab9
junit.lib=$(build-classpath junit)
Permaine Cheung 54e2ebb
xmlxsl.lib=$(build-classpath xalan-j2 xerces-j2)
Permaine Cheung 54e2ebb
test.report.dir=test
Permaine Cheung 54e2ebb
EOF
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
%patch0
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
#Fix wrong-file-end-of-line-encoding
Permaine Cheung 54e2ebb
sed -i 's/\r//g' README.txt example.html LICENSE.txt
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
%build
Permaine Cheung 54e2ebb
ant -Dbuild.compiler=modern jar test docs
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
%install
Permaine Cheung 54e2ebb
rm -rf $RPM_BUILD_ROOT
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
mkdir -p $RPM_BUILD_ROOT%{_javadir}
Permaine Cheung 2f7cab9
install -m 0644 lib/%{name}%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
Permaine Cheung 2f7cab9
%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
# Jar versioning
Permaine Cheung 54e2ebb
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
Permaine Cheung 2f7cab9
# poms
Permaine Cheung 2f7cab9
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
Permaine Cheung 2f7cab9
Permaine Cheung 2f7cab9
install -m 644 %{SOURCE1} \
Permaine Cheung 2f7cab9
    $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom
Permaine Cheung 2f7cab9
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
# Javadoc
Permaine Cheung 54e2ebb
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
Permaine Cheung 54e2ebb
cp -pr doc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
Permaine Cheung 54e2ebb
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
Permaine Cheung 54e2ebb
Permaine Cheung 2f7cab9
%if %{gcj_support}
Permaine Cheung 2f7cab9
export CLASSPATH=$(build-classpath gnu-crypto)
Permaine Cheung 2f7cab9
%{_bindir}/aot-compile-rpm
Permaine Cheung 2f7cab9
%endif
Permaine Cheung 2f7cab9
Permaine Cheung 54e2ebb
%clean
Permaine Cheung 54e2ebb
rm -rf $RPM_BUILD_ROOT
Permaine Cheung 54e2ebb
Permaine Cheung 2f7cab9
%post
Permaine Cheung 2f7cab9
%update_maven_depmap
Permaine Cheung 2f7cab9
%if %{gcj_support}
Permaine Cheung 2f7cab9
if [ -x %{_bindir}/rebuild-gcj-db ]
Permaine Cheung 2f7cab9
then
Permaine Cheung 2f7cab9
  %{_bindir}/rebuild-gcj-db
Permaine Cheung 2f7cab9
fi
Permaine Cheung 2f7cab9
%endif
Permaine Cheung 2f7cab9
Permaine Cheung 2f7cab9
%postun
Permaine Cheung 2f7cab9
%update_maven_depmap
Permaine Cheung 2f7cab9
%if %{gcj_support}
Permaine Cheung 2f7cab9
if [ -x %{_bindir}/rebuild-gcj-db ]
Permaine Cheung 2f7cab9
then
Permaine Cheung 2f7cab9
  %{_bindir}/rebuild-gcj-db
Permaine Cheung 2f7cab9
fi
Permaine Cheung 2f7cab9
%endif
Permaine Cheung 2f7cab9
Permaine Cheung 54e2ebb
%files
Permaine Cheung 54e2ebb
%defattr(0644,root,root,0755)
Permaine Cheung 54e2ebb
%{_javadir}/*
Permaine Cheung 54e2ebb
%doc README.txt LICENSE.txt XMLUnit.pdf example.html
Permaine Cheung 2f7cab9
%{_datadir}/maven2/poms/*
Permaine Cheung 2f7cab9
%{_mavendepmapfragdir}
Permaine Cheung 2f7cab9
%if %{gcj_support}
Permaine Cheung 2f7cab9
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
Permaine Cheung 2f7cab9
%attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
Permaine Cheung 2f7cab9
%endif
Permaine Cheung 2f7cab9
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
%files javadoc
Permaine Cheung 54e2ebb
%defattr(0644,root,root,0755)
Permaine Cheung 54e2ebb
%doc %{_javadocdir}/%{name}-%{version}
Permaine Cheung 54e2ebb
%doc %{_javadocdir}/%{name}
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
%changelog
c5eb55c
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0:1.0-6jpp.1
c5eb55c
- Autorebuild for GCC 4.3
c5eb55c
Permaine Cheung 2f7cab9
* Thu Jan 17 2008 Permaine Cheung <pcheung@redhat.com> - 0:1.0-5jpp.1
Permaine Cheung 2f7cab9
- Update to the same version as upstream
Permaine Cheung 2f7cab9
Permaine Cheung 2f7cab9
 Tue Dec 18 2007 Ralph Apel <r.apel at r-apel.de> - 0:1.0-5jpp
Permaine Cheung 2f7cab9
- Add poms and depmap frags
Permaine Cheung 2f7cab9
- Make Vendor, Distribution based on macro
Permaine Cheung 2f7cab9
- Add gcj_support option
Permaine Cheung 2f7cab9
Permaine Cheung 54e2ebb
* Mon Mar 12 2007 Permaine Cheung <pcheung@redhat.com> - 0:1.0-4jpp.1
Permaine Cheung 54e2ebb
- Add missing BR, patch to build javadoc, and other rpmlint issues
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
* Mon May 08 2006 Ralph Apel <r.apel at r-apel.de> - 0:1.0-4jpp
Permaine Cheung 54e2ebb
- First JPP-1.7 release
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
* Thu Aug 26 2004 Ralph Apel <r.apel at r-apel.de> - 0:1.0-3jpp
Permaine Cheung 54e2ebb
- Build with ant-1.6.2
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
* Wed Dec 17 2003 Paul Nasrat <pauln at truemesh.com> - 0:1.0-2jpp
Permaine Cheung 54e2ebb
- Fix license and improved description
Permaine Cheung 54e2ebb
- Thanks to Ralph Apel who produced a spec - merged version info
Permaine Cheung 54e2ebb
Permaine Cheung 54e2ebb
* Wed Dec 17 2003 Paul Nasrat <pauln at truemesh.com> - 0:1.0-1jpp
Permaine Cheung 54e2ebb
- Initial Version