Blob Blame History Raw
%define base_name  validator
%define short_name commons-%{base_name}
%define name       jakarta-%{short_name}
%define section    free

Summary:        Jakarta Commons Validator
Name:           %{name}
Version:        1.0.2
Release:        2jpp
Epoch:          0
License:        Apache Software License
Group:          Development/Libraries/Java
Vendor:         JPackage Project
Distribution:   JPackage
Source0:        http://www.apache.org/dist/jakarta/commons/validator/source/commons-validator-1.0.2-src.tar.gz
Source1:        %{name}.catalog
URL:            http://jakarta.apache.org/commons/validator/
BuildRequires:  ant, jpackage-utils >= 0:1.5
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/Documentation

%description javadoc
Javadoc for %{name}.

# -----------------------------------------------------------------------------

%prep
%setup -q -n %{short_name}-%{version}-src
# Yay!  No external jars in the source package, way to go...
cp -p %{SOURCE1} conf/share/catalog

# -----------------------------------------------------------------------------

%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 test dist

# -----------------------------------------------------------------------------

%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}

# -----------------------------------------------------------------------------

%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 PROPOSAL.html RELEASE-NOTES* STATUS.html
%{_javadir}/*
%{_datadir}/sgml/%{name}

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

# -----------------------------------------------------------------------------

%changelog
* 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.