--- /dev/null
+#
+# Conditional build:
+%bcond_without tests # do not perform "make test"
+#
+%include /usr/lib/rpm/macros.perl
+%define pdir Crypt
+%define pnam X509
+Summary: Crypt::X509 - Parse a X.509 certificate
+Name: perl-Crypt-X509
+Version: 0.51
+Release: 1
+License: Artistic
+Group: Development/Languages/Perl
+Source0: http://www.cpan.org/modules/by-module/Crypt/%{pdir}-%{pnam}-%{version}.tar.gz
+# Source0-md5: aadab2960d2bd65a212d1bd7f50e282a
+URL: http://search.cpan.org/dist/Crypt-X509/
+BuildRequires: perl-Convert-ASN1
+BuildRequires: perl-devel >= 1:5.8.0
+BuildRequires: rpm-perlprov >= 4.1-13
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Crypt::X509 parses X.509 certificates. Methods are provided for
+accessing most certificate elements.
+
+%prep
+%setup -q -n %{pdir}-%{pnam}-%{version}
+
+%build
+%{__perl} Makefile.PL \
+ INSTALLDIRS=vendor
+
+%{__make} \
+ CC="%{__cc}" \
+ OPTIMIZE="%{rpmcflags}"
+
+%{?with_tests:%{__make} test}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc Changes README
+%{perl_vendorlib}/Crypt/X509.pm
+%{_mandir}/man3/Crypt::*.3pm*