+# TODO
+# - version 0.43 is out
%define ezmlm_ver 0.53
%define idx_ver 0.40
-Summary: ezmlm - high-speed mailing list manager for qmail.
-Summary(pl): ezmlm - szybki mened¿er list dyskysyjnych dla qmail'a.
+Summary: ezmlm - high-speed mailing list manager for qmail
+Summary(pl.UTF-8): ezmlm - szybki zarządca list dyskysyjnych dla qmaila
Name: ezmlm-idx
Version: %{ezmlm_ver}_%{idx_ver}
-Release: 1
-License: Check with djb@cr.yp.to
+Release: 2.2
+Epoch: 1
+License: DJB (base ezmlm), GPL (ezmlm-idx additions) - non distributable as a whole?
Group: Applications/System
Source0: http://cr.yp.to/software/ezmlm-%{ezmlm_ver}.tar.gz
+# Source0-md5: 108c632caaa8cdbfd3041e6c449191b2
Source1: http://gd.tuwien.ac.at/infosys/mail/qmail/ezmlm-patches/%{name}-%{idx_ver}.tar.gz
+# Source1-md5: c6137114060cff19301a956e73d46fc0
Source2: http://gd.tuwien.ac.at/infosys/mail/qmail/ezmlm-patches/ezman.html.tar.gz
+# Source2-md5: 3ebdd5289f302063d21be43aaeef0585
Patch0: %{name}-opt.patch
+Patch1: ezmlm-glibc.patch
+Patch2: %{name}-DESTDIR.patch
URL: http://www.ezmlm.org/
-Obsoletes: ezmlm
BuildRequires: groff
+Obsoletes: ezmlm
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Qmail Mailing List Manager + Indexing, (Remote) Moderation, digest,
+Qmail mailing list manager + indexing, (remote) moderation, digest,
make patches, multi-language, MIME, global-interface, easy-to-use.
-%description -l pl
-Qmailowy Mened¿er List Dyskusyjnych + Indeksowanie, (Zdalne)
-Moderowanie, obs³uga wielu jêzyków, MIME, globalny-interfejs, prosta
-obs³uga.
+%description -l pl.UTF-8
+Qmailowy zarządca list dyskusyjnych + indeksowanie, (zdalne)
+moderowanie, obsługa wielu języków, MIME, globalny-interfejs, prosta
+obsługa.
%prep
-%setup -q -T -b 0 -n ezmlm-%{ezmlm_ver}
-%setup -q -D -T -a 1 -n ezmlm-%{ezmlm_ver}
+%setup -q -n ezmlm-%{ezmlm_ver} -a1
%patch0 -p1
+%patch1
+%patch2 -p1
mv -f ezmlm-idx-%{idx_ver}/* .
cat idx.patch | sed 's/conf-bin`/conf-bin2`/g' > idx2.patch
patch -s < idx2.patch
echo "%{_bindir}" > conf-bin2
-cat Makefile | sed 's/auto_bin `head -1 conf-bin`/auto_bin `head -1 conf-bin2`/g' > Makefile.pld
+cat Makefile | sed 's/auto_bin `head -n 1 conf-bin`/auto_bin `head -n 1 conf-bin2`/g' > Makefile.pld
mv -f Makefile.pld Makefile
mv -f ezmlmrc.pl ezmlmrc.pl.org
%install
rm -rf $RPM_BUILD_ROOT
-echo "$RPM_BUILD_ROOT%{_bindir}" > conf-bin
-echo "$RPM_BUILD_ROOT%{_mandir}" > conf-man
+echo "%{_bindir}" > conf-bin
+echo "%{_mandir}" > conf-man
install -d $RPM_BUILD_ROOT%{_sysconfdir}/ezmlm
install -d $RPM_BUILD_ROOT%{_bindir}
install ezmlmrc $RPM_BUILD_ROOT%{_sysconfdir}/ezmlm
-%{__make} setup
+%{__make} setup \
+ DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %dir %{_sysconfdir}/ezmlm
%attr(755,root,root) %{_bindir}/ezmlm-*
-%attr(644,root,root) %{_mandir}/man[15]/*
-%attr(644,root,root) %config %verify(not size mtime md5) %{_sysconfdir}/ezmlm/*
+%{_mandir}/man[15]/*
+%config %verify(not md5 mtime size) %{_sysconfdir}/ezmlm/*