%define	pkgname	Mail-Sender

# Basic Information
Summary:	Mail::Sender - module for sending mails with attachments through an SMTP server
Summary(ja):	Mail::Sender - SMTP サーバー経由で添付ファイル付メールを送信するためのモジュール
Name:		perl-%{pkgname}
Version:	0.903
Release:	2%{?_dist_release}
Group:		programming
Vendor:		Project Vine
Distribution:	Vine Linux
Packager:	yasumichi

License:	Artistic or GPL
URL:		https://metacpan.org/pod/Mail::Sender
Source0:	https://cpan.metacpan.org/authors/id/C/CA/CAPOEIRAB/%{pkgname}-%{version}.tar.gz

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildArch:	noarch

# Dependency
Requires:	perl >= 2:5.34.0
BuildRequires:  perl >= 2:5.34.0

%description
Mail::Sender provides an object oriented interface to sending mails. It
doesn't need any outer program. It connects to a mail server directly from
Perl, using Socket.

%description -l ja
Mail::Sender は、メール送信のためのオブジェクト指向インターフェースを提供し
ます。他の外部プログラムは必要ありません。ソケットを使って Perl から直接、
メールサーバーへ接続します。


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


%build
perl Makefile.PL INSTALLDIRS="vendor" NO_PACKLIST=1 NO_PERLLOCAL=1
%{__make} << EOM
n
EOM


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__make} install DESTDIR=${RPM_BUILD_ROOT}

# Remove the Win32 module in order to avoid requiring perl(Win32API::Registry)
# This idea is from fedora.
find $RPM_BUILD_ROOT -type f -name Win32.pm -exec rm -f {} ';'

find $RPM_BUILD_ROOT%{_prefix} -type f -print |
        sed "s@^$RPM_BUILD_ROOT@@g" |
	grep -v ^%{_mandir} \
	> %{name}.files

if [ "$(cat %{name}.files)X" = "X" ] ; then
	echo "ERROR: EMPTY FILE LIST"
	exit -1
fi


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}


%files -f %{name}.files
%defattr(-,root,root)
%doc Changes README
%{_mandir}/man*/*


%changelog
* Thu Nov 18 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.903-2
- rebuilt with perl-5.34.0.

* Fri May 17 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.903-1
- new upstream release.
- rebuilt with perl-5.26.

* Mon Jun 30 2014 Daisuke SUZUKI <daisuke@vinelinux.org> 0.8.21-1
- update to 0.8.21

* Wed Jan 25 2012 Yasumichi Akahoshi <yasumichi@vinelinux.org> 0.8.16-1
- initial build for Vine Linux
