# Copyright (C) 2001-2004 Daniel Berrange <dan@berrange.com>
#
# $Id: Text-Smart.spec.PL,v 1.3 2005/09/08 20:49:23 dan Exp $

use strict;
use warnings;

die unless (scalar @ARGV == 1);

unless (do 'lib/Text/Smart.pm')
  {
    if ($@) { die $@ };
    die "lib/Text/Smart.pm: $!";
  }

local $/ = undef;
$_ = <DATA>;
s/\@VERSION\@/$Text::Smart::VERSION/g;

open SPEC, ">$ARGV[0]" or die "$!";
print SPEC $_;
close SPEC;
__DATA__
# Automatically generated by Text-Smart.spec.PL

%define appname Text-Smart

Summary: Text::Smart - Simple text markup processor
Name: perl-%{appname}
Version: @VERSION@
Release: 1
License: GPLv2+
Group: Applications/Internet
Source0:        http://www.cpan.org/modules/by-module/Text/%{appname}-%{version}.tar.gz
URL:            http://search.cpan.org/dist/%{appname}/
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArchitectures: noarch
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
BuildRequires:  perl(Test::More)
BuildRequires:  perl(Test::Pod)
BuildRequires:  perl(Test::Pod::Coverage)

%description
Text::Smart provides a module for simple inline text
markup processing.

%prep
%setup -q -n %{appname}-%{version}


%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%__make


%install
%__rm -rf $RPM_BUILD_ROOT
%__make install \
  PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name perllocal.pod -exec rm -f {} \;
find $RPM_BUILD_ROOT -name .packlist -exec rm -f {} \;

%check
%__make test

%clean
%__rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%doc AUTHORS LICENSE README
%doc examples/*
%attr (0755,root,root) %{_bindir}/text-smart
%{_mandir}/man1/*
%{_mandir}/man3/*
%{perl_vendorlib}/Text/Smart.pm
%dir %{perl_vendorlib}/Text/Smart/
%{perl_vendorlib}/Text/Smart/HTML.pm
