-Summary: ezmlm - high-speed mailing list manager for qmail.
-Name: ezmlm-idx
-Version: 0.53.313
-Release: 1
-Group: Utilities/System
-Source: ftp://koobera.math.uic.edu/pub/software/ezmlm-0.53.tar.gz
-Source1: ftp://ftp.id.wustl.edu/pub/patches/%{name}-0.313.tar.gz
-Patch0: %{name}-opt.patch
-Patch1: %{name}.ezmlmrc.pl-fix.patch
-URL: http://www.qmail.org/
-Copyright: Check with djb@koobera.math.uic.edu
-Requires: qmail
-Conflicts: ezmlm
-Buildroot: /tmp/%{name}-%{version}-root
-Summary(pl): ezmlm - szybki mened¿er list dyskysyjnych dla qmail'a.
+# 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.UTF-8): ezmlm - szybki zarządca list dyskysyjnych dla qmaila
+Name: ezmlm-idx
+Version: %{ezmlm_ver}_%{idx_ver}
+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/
+BuildRequires: groff
+Obsoletes: ezmlm
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Qmail Mailing List Manager + Indexing, (Remote) Moderation, digest, make
-patches, multi-language, MIME, global-interface, easy-to-use.
+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-0.53
-%setup -q -D -T -a 1 -n ezmlm-0.53
+%setup -q -n ezmlm-%{ezmlm_ver} -a1
%patch0 -p1
-%patch1 -p1
+%patch1
+%patch2 -p1
-mv -f ezmlm-idx-0.313/* .
-patch -s < idx.patch
+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 -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
+echo "%{idx_ver} - This must be on 1 and start in pos 1" > ezmlmrc.pl
+cat ezmlmrc.pl.org >> ezmlmrc.pl
%build
-make
-make man
+%{__make}
+%{__make} man
+tar zxf %{SOURCE2}
%install
rm -rf $RPM_BUILD_ROOT
+echo "%{_bindir}" > conf-bin
+echo "%{_mandir}" > conf-man
-install -d $RPM_BUILD_ROOT/etc
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/ezmlm
install -d $RPM_BUILD_ROOT%{_bindir}
-install -d $RPM_BUILD_ROOT%{_mandir}/{man1,man5}
-
-install -s ezmlm-{clean,cron,gate,get,idx,issubn,list,make,\
-manage,moderate,reject,request,return,send,store,sub,tstdig,\
-unsub,warn,weed} $RPM_BUILD_ROOT%{_bindir}
-
-install ezmlm-{accept,both,check,glconf,glmake} $RPM_BUILD_ROOT%{_bindir}
+install -d $RPM_BUILD_ROOT%{_mandir}/man{1,5}
-install *.1 $RPM_BUILD_ROOT%{_mandir}/man1
-install *.5 $RPM_BUILD_ROOT%{_mandir}/man5
+install ezmlmrc $RPM_BUILD_ROOT%{_sysconfdir}/ezmlm
-install ezmlmrc $RPM_BUILD_ROOT/etc
-
-gzip -9nf $RPM_BUILD_ROOT%{_mandir}/man1/*
-gzip -9nf $RPM_BUILD_ROOT%{_mandir}/man5/*
+%{__make} setup \
+ DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc BLURB CHANGES CHANGES.idx FAQ.idx README README.idx
-%doc SYSDEPS TARGETS UPGRADE.idx DOWNGRADE.idx ezmlmrc.sv
-%doc ezmlmrc.da ezmlmrc.pl ezmlmrc.fr ezmlmrc.de ezmlmrc.jp
-%doc ezmlmrc.pt_BR ezdomo.tar.gz ezdomo.pl.tar.gz
-
-%attr(755,root,root) /usr/bin/*
-%attr(644,root,root) %{_mandir}/man[15]/*
-%attr(644,root,root) %config %verify(not size mtime md5) /etc/*
-
-%changelog
-* Mon Jun 07 1999 Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
-- updated to x.313
-- added few macros
-- %config _must be_ 644 (if not - ezmlm-web won't work)
-- added ezmlm-idx.ezmlmrc.pl-fix.patch
+%doc BLURB CHANGES CHANGES.idx FAQ.idx README README.idx
+%doc SYSDEPS TARGETS UPGRADE.idx DOWNGRADE.idx ezmlmrc
+%doc ezmlmrc.*[a-zA-Z] ezman
-* Sat Oct 17 1998 Bartek Rozkrut <madey@dione.ids.pl>
-[0.53.312-1d]
-- First relase as a PLD package,
-- added opt.patch prepared by Marcin Korzonek <mkorz@SHADOW.EU.ORG>.
+%attr(755,root,root) %dir %{_sysconfdir}/ezmlm
+%attr(755,root,root) %{_bindir}/ezmlm-*
+%{_mandir}/man[15]/*
+%config %verify(not md5 mtime size) %{_sysconfdir}/ezmlm/*