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