%define base_name validator %define short_name commons-%{base_name} %define name jakarta-%{short_name} %define section free %define build_tests 0 Summary: Jakarta Commons Validator Name: %{name} Version: 1.1.4 Release: 1.1mdk Epoch: 0 License: Apache License Group: Development/Java #Vendor: JPackage Project #Distribution: JPackage Source0: http://www.apache.org/dist/jakarta/commons/validator/source/commons-validator-%{version}-src.tar.bz2 Source1: %{name}.catalog # FIXME DTDs are not in the source tarball anymore (conf directory missing) Source2: commons-validator-%{version}-conf.tar.bz2 Patch1: jakarta-commons-validator-%{version}-build.patch.bz2 URL: http://jakarta.apache.org/commons/validator/ BuildRequires: jpackage-utils >= 0:1.5 BuildRequires: ant >= 0:1.6.2 BuildRequires: jakarta-commons-beanutils >= 0:1.5 BuildRequires: jakarta-commons-collections >= 0:2.1 BuildRequires: jakarta-commons-digester >= 0:1.3 BuildRequires: jakarta-commons-logging >= 0:1.0.2 BuildRequires: oro >= 0:2.0.6 BuildRequires: junit >= 0:3.7 BuildRequires: xml-commons-apis Requires: jakarta-commons-beanutils >= 0:1.5 Requires: jakarta-commons-collections >= 0:2.1 Requires: jakarta-commons-digester >= 0:1.3 Requires: jakarta-commons-logging >= 0:1.0.2 Requires: oro >= 0:2.0.6 Requires: xml-commons-apis BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Provides: %{short_name} Obsoletes: %{short_name} %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: Development/Java %description javadoc Javadoc for %{name}. # ----------------------------------------------------------------------------- %prep %setup -q -n %{short_name}-%{version} # Yay! No external jars in the source package, way to go... %{__tar} xjf %{SOURCE2} cp -p %{SOURCE1} conf/share/catalog %patch1 # ----------------------------------------------------------------------------- %build CLASSPATH=$(build-classpath \ xml-commons-apis oro junit jakarta-commons-logging jakarta-commons-digester \ jakarta-commons-beanutils jakarta-commons-collections) \ %ant -Dbuild.sysclasspath=first dist %if %{build_tests} %ant -Dbuild.sysclasspath=first test %endif # ----------------------------------------------------------------------------- %install rm -rf $RPM_BUILD_ROOT # jars mkdir -p $RPM_BUILD_ROOT%{_javadir} cp -p dist/%{short_name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar (cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|jakarta-||g"`; done) (cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done) # dtds and catalog mkdir -p $RPM_BUILD_ROOT%{_datadir}/sgml/%{name} cp -p conf/share/{*.dtd,catalog} $RPM_BUILD_ROOT%{_datadir}/sgml/%{name} # javadoc mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} cp -pr dist/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} # fix end-of-line %{__perl} -pi -e 's/\r\n/\n/g' *.txt # ----------------------------------------------------------------------------- %clean rm -rf $RPM_BUILD_ROOT # ----------------------------------------------------------------------------- %post # Note that we're using versioned catalog, so this is always ok. if [ -x %{_bindir}/install-catalog -a -d %{_sysconfdir}/sgml ]; then %{_bindir}/install-catalog --add \ %{_sysconfdir}/sgml/%{name}-%{version}-%{release}.cat \ %{_datadir}/sgml/%{name}/catalog > /dev/null || : fi %postun # Note that we're using versioned catalog, so this is always ok. if [ -x %{_bindir}/install-catalog -a -d %{_sysconfdir}/sgml ]; then %{_bindir}/install-catalog --remove \ %{_sysconfdir}/sgml/%{name}-%{version}-%{release}.cat \ %{_datadir}/sgml/%{name}/catalog > /dev/null || : fi # ----------------------------------------------------------------------------- %files %defattr(0644,root,root,0755) %doc LICENSE.txt NOTICE.txt %{_javadir}/* %{_datadir}/sgml/%{name} %files javadoc %defattr(0644,root,root,0755) %{_javadocdir}/%{name}-%{version} # ----------------------------------------------------------------------------- %changelog * Wed Aug 17 2005 David Walluck <walluck@mandriva.org> 0:1.1.4-1.1mdk - 1.1.4 * Sat May 21 2005 David Walluck <walluck@mandriva.org> 0:1.1.3-1.1mdk - release * Tue Sep 07 2004 Fernando Nasser <fnasser at redhat.com> - 0:1.1.3-1jpp - Upgrade to 1.1.3 * Sun Aug 23 2004 Randy Watler <rwatler at finali.com> - 0:1.0.2-3jpp - Rebuild with ant-1.6.2 * Fri Apr 18 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:1.0.2-2jpp - Move DTDs from %%{_datadir}/%{name} to %%{_datadir}/sgml/%%{name} for FHS compliance, <http://www.pathname.com/fhs/2.2/fhs-4.11.html#4.11.7>. * Fri Apr 18 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:1.0.2-1jpp - Update to 1.0.2 and JPackage 1.5. - Move DTDs from %%doc to %%{_datadir}/%%{name}. - Include catalog for DTDs, and install it if %%{_bindir}/install-catalog is available. * Mon Dec 16 2002 Ville Skyttä <ville.skytta at iki.fi> - 1.0.1-1jpp - 1.0.1. - Include the DTD in the package (as documentation). * Sat Nov 2 2002 Ville Skyttä <ville.skytta at iki.fi> - 1.0-1jpp - 1.0, initial JPackage release.