spike 558d6b
%global base_name       validator
spike 558d6b
%global short_name      commons-%{base_name}
spike 558d6b
spike 558d6b
Name:             apache-%{short_name}
spike 558d6b
Version:          1.3.1
Dennis Gilmore 93ebd3
Release:          9%{?dist}
spike 558d6b
Summary:          Apache Commons Validator
spike 558d6b
Group:            Development/Libraries
spike 558d6b
License:          ASL 2.0
spike 558d6b
URL:              http://commons.apache.org/%{base_name}/
spike 558d6b
Source0:          http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
Ville Skyttä 24ce85
Patch0:           commons-validator-1.3.1-crosslink.patch
Ville Skyttä 24ce85
# https://issues.apache.org/jira/browse/VALIDATOR-303
Ville Skyttä 24ce85
Patch1:           commons-validator-1.3.1-srcencoding.patch
spike 558d6b
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
spike 558d6b
BuildArch:        noarch
spike 558d6b
spike 558d6b
BuildRequires:    java-devel >= 1:1.6.0
spike 558d6b
BuildRequires:    jpackage-utils
spike 558d6b
BuildRequires:    ant
spike 558d6b
BuildRequires:    apache-commons-beanutils
spike 558d6b
BuildRequires:    apache-commons-digester
spike 558d6b
BuildRequires:    apache-commons-logging
Stanislav Ochotnicky 6a68c7
BuildRequires:    jakarta-oro
spike 558d6b
BuildRequires:    junit
spike 558d6b
Requires:         apache-commons-beanutils
spike 558d6b
Requires:         apache-commons-digester
spike 558d6b
Requires:         apache-commons-logging
Stanislav Ochotnicky 6a68c7
Requires:         jakarta-oro
spike 558d6b
Requires:         java >= 1:1.6.0
spike 558d6b
Requires:         jpackage-utils
spike 558d6b
Requires(post):   jpackage-utils
spike 558d6b
Requires(postun): jpackage-utils
spike 558d6b
Ville Skyttä 24ce85
# This should go away with F-17 after maven-shared-reporting-impl is fixed.
spike 558d6b
Provides:         jakarta-%{short_name} = 0:%{version}-%{release}
spike 558d6b
Obsoletes:        jakarta-%{short_name} < 0:1.3.1-2
spike 558d6b
spike 558d6b
%description
Stanislav Ochotnicky 6a68c7
A common issue when receiving data either electronically or from user input is
Stanislav Ochotnicky 6a68c7
verifying the integrity of the data. This work is repetitive and becomes even
Stanislav Ochotnicky 6a68c7
more complicated when different sets of validation rules need to be applied to
Stanislav Ochotnicky 6a68c7
the same set of data based on locale for example. Error messages may also vary
Stanislav Ochotnicky 6a68c7
by locale. This package attempts to address some of these issues and speed
spike 558d6b
development and maintenance of validation rules.
spike 558d6b
spike 558d6b
%package javadoc
spike 558d6b
Summary:          Javadoc for %{name}
spike 558d6b
Group:            Documentation
Ville Skyttä 24ce85
BuildRequires:    java-javadoc
Ville Skyttä 24ce85
Requires:         java-javadoc
spike 558d6b
spike 558d6b
%description javadoc
spike 558d6b
This package contains the API documentation for %{name}.
spike 558d6b
spike 558d6b
%prep
spike 558d6b
%setup -q -n %{short_name}-%{version}-src
Ville Skyttä 24ce85
%patch0 -p1
Ville Skyttä 24ce85
%patch1 -p1
spike 558d6b
sed -i 's/\r//' LICENSE.txt
spike 558d6b
sed -i 's/\r//' RELEASE-NOTES.txt
spike 558d6b
sed -i 's/\r//' NOTICE.txt
spike 558d6b
Stanislav Ochotnicky f2edda
# use textui instead of awtui (not available in junit4+)
Stanislav Ochotnicky f2edda
sed -i 's:junit.awtui.TestRunner.main:junit.textui.TestRunner.main:g' \
Stanislav Ochotnicky f2edda
        src/test/org/apache/commons/validator/*java
Stanislav Ochotnicky f2edda
spike 558d6b
%build
Stanislav Ochotnicky 6a68c7
# TODO: Use Maven for building as soon as upstream provides proper build.xml.
Stanislav Ochotnicky 6a68c7
#       Currently upstream build.xml uses antrun plugin to build, so downloads
spike 558d6b
#       during build process can't be prohibited.
spike 558d6b
spike 558d6b
export CLASSPATH=$(build-classpath \
spike 558d6b
                   apache-commons-logging \
spike 558d6b
                   apache-commons-digester \
spike 558d6b
                   apache-commons-beanutils \
spike 558d6b
                   junit \
Stanislav Ochotnicky 6a68c7
                   jakarta-oro )
spike 558d6b
spike 558d6b
ant -Dskip.download=true -Dbuild.sysclasspath=first dist
spike 558d6b
spike 558d6b
%check
spike 558d6b
export CLASSPATH=$(build-classpath \
spike 558d6b
                   apache-commons-logging \
spike 558d6b
                   apache-commons-digester \
spike 558d6b
                   apache-commons-beanutils \
spike 558d6b
                   junit \
Stanislav Ochotnicky 6a68c7
                   jakarta-oro )
spike 558d6b
spike 558d6b
ant -Dskip.download=true -Dbuild.sysclasspath=first test
spike 558d6b
spike 558d6b
%install
spike 558d6b
rm -rf %{buildroot}
spike 558d6b
spike 558d6b
# jars
spike 558d6b
install -d -m 0755 %{buildroot}%{_javadir}
Ville Skyttä 24ce85
install -pm 644 dist/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
Ville Skyttä 24ce85
ln -s %{name}.jar %{buildroot}%{_javadir}/%{short_name}.jar
spike 558d6b
spike 558d6b
# javadoc
Ville Skyttä 24ce85
install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
Ville Skyttä 24ce85
cp -pr dist/docs/api*/* %{buildroot}%{_javadocdir}/%{name}/
spike 558d6b
spike 558d6b
%clean
spike 558d6b
rm -rf %{buildroot}
spike 558d6b
Ville Skyttä 24ce85
%pre javadoc
Ville Skyttä 24ce85
# workaround for rpm bug, can be removed in F-18
Ville Skyttä 24ce85
[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
Ville Skyttä 24ce85
rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
Ville Skyttä 24ce85
spike 558d6b
%files
spike 558d6b
%defattr(-,root,root,-)
spike 558d6b
%doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt
Ville Skyttä 24ce85
%{_javadir}/*%{short_name}.jar
spike 558d6b
spike 558d6b
%files javadoc
spike 558d6b
%defattr(-,root,root,-)
spike 558d6b
%doc LICENSE.txt
spike 558d6b
%{_javadocdir}/%{name}
spike 558d6b
spike 558d6b
%changelog
Dennis Gilmore 93ebd3
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-9
Dennis Gilmore 93ebd3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
Dennis Gilmore 93ebd3
Stanislav Ochotnicky f2edda
* Fri May 18 2012 Stanislav Ochotnicky <sochotnicky@redhat.com>- 1.3.1-8
Stanislav Ochotnicky f2edda
- Fix tests after junit update
Stanislav Ochotnicky f2edda
Ville Skyttä 24ce85
* Sat Jan 14 2012 Ville Skyttä <ville.skytta@iki.fi> - 1.3.1-7
Ville Skyttä 24ce85
- Tweak source encoding to fix build with Java 1.7.
Ville Skyttä 24ce85
- Drop versioned jars and javadoc dir.
Ville Skyttä 24ce85
- Drop no longer needed javadoc Obsoletes.
Ville Skyttä 24ce85
- Crosslink with local JDK API docs.
Ville Skyttä 24ce85
Dennis Gilmore 6be65e
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-6
Dennis Gilmore 6be65e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
Dennis Gilmore 6be65e
Stanislav Ochotnicky 6a68c7
* Tue Feb 22 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.3.1-5
Stanislav Ochotnicky 6a68c7
- Change oro to jakarta-oro in BR/R
Stanislav Ochotnicky 6a68c7
Dennis Gilmore 806fb8
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-4
Dennis Gilmore 806fb8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
Dennis Gilmore 806fb8
spike 558d6b
* Wed Oct 20 2010 Chris Spike <chris.spike@arcor.de> 1.3.1-3
spike 558d6b
- Moved junit tests to check section
spike 558d6b
spike 558d6b
* Sat Oct 2 2010 Chris Spike <chris.spike@arcor.de> 1.3.1-2
spike 558d6b
- Rename and rebase from jakarta-commons-validator