Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 059f441b8d34eba3308efb2fa2fa0134 > files > 6

masqmail-0.2.18-3mdk.src.rpm

# masqmail.spec.  Generated from masqmail.spec.in by configure.
# Mandrake GNU/Linux RPM specfile for MasqMail
# $Id$
#
# Process this file with ./config.status --file=mandrake/masqmail.spec
# once you have properly configured the source package.

%define name		masqmail
%define version		0.2.18
%define release		3mdk

%define confdir		%{_sysconfdir}/masqmail
%define spooldir	%{_var}/spool/masqmail
%define logdir		%{_var}/log/masqmail
%define mailuser	mail
%define mailgroup	mail

# include AUTH (RFC 2554) client support:
%define with_AUTH_CL	1
# include ident (RFC 1413) client support:
%define with_IDENT_CL	0
# include qmail-style maildir support:
%define with_MAILDIR	0
# include MasqDial support:
%define with_MSERVER	0
# include fetchmail-like POP3 client support:
%define with_POP3_CL	0
# link with libcrypto:
%define with_LIBCRYPTO	1


Name:		%{name}
Summary:	Offline Mail Transfert Agent
Version:	%{version}
Release:	%{release}
Epoch:		1
URL:		http://masqmail.cx/masqmail/
Source0:	masqmail-%{version}.tar.bz2
Source3:	masqmail-etc-init.d-masqmail
Source4:	masqmail-etc-masqmail-masqmail.conf
Source5:	masqmail-etc-masqmail-example.route
Patch0:		masqmail-Makefile_no_chown.patch.bz2

License:	GPL
Group:		System/Servers

Provides:	smtpdaemon, MailTransportAgent
Requires:	glib >= 1.0
PreReq:		rpm-helper

BuildRequires:	glib-devel >= 1.0
BuildRoot:	%{_tmppath}/%{name}-buildroot

%if %{with_LIBCRYPTO}
BuildRequires:	libopenssl-devel
%endif


%description
MasqMail is a mail server designed for hosts that are not permanently
connected to the Internet. It handles outgoing messages specially and
delivers them only when the Internet connection is available.
It has support for multiple Internet Service Providers and for local
users's mail boxes. It replaces other MTAs such as Sendmail or Postfix.


%prep
/bin/rm -Rf %buildroot
%setup
%patch0 -p1


%build
CFGFLAGS=""
%if %{with_AUTH_CL}
CFGFLAGS="$CFGFLAGS --enable-auth"
%endif
%if %{with_IDENT_CL}
CFGFLAGS="$CFGFLAGS --enable-ident"
%endif
%if %{with_MAILDIR}
CFGFLAGS="$CFGFLAGS --enable-maildir"
%endif
%if %{with_MSERVER}
CFGFLAGS="$CFGFLAGS --enable-mserver"
%endif
CFGFLAGS="$CFGFLAGS --disable-pop3"
%if %{with_POP3_CL}
CFGFLAGS=OLDCFGFLAGS
%endif
%if %{with_LIBCRYPTO}
CFGFLAGS="$CFGFLAGS --with-libcrypto"
%endif

%serverbuild

%ifarch x86_64
%configure --with-user=%{mailuser} --with-group=%{mailgroup} \
        --with-conf-dir=%{confdir} --with-logdir=%{logdir} \
        --with-spooldir=%{spooldir} --disable-debug $CFGFLAGS --disable-resolver
%endif

%configure --with-user=%{mailuser} --with-group=%{mailgroup} \
	--with-conf-dir=%{confdir} --with-logdir=%{logdir} \
	--with-spooldir=%{spooldir} --disable-debug $CFGFLAGS
%make


%install
make DESTDIR=%buildroot install-strip

# Init script:
/bin/mkdir -p %buildroot/%{_sysconfdir}/rc.d/init.d/
install -m 0744 %{SOURCE3} %buildroot/%{_sysconfdir}/rc.d/init.d/masqmail

# Configuration files:
/bin/cp %{SOURCE4} %buildroot/%{confdir}/masqmail.conf
/bin/cp %{SOURCE5} %buildroot/%{confdir}/example.route
%if %{with_POP3_CL}
/bin/cp examples/example.get %buildroot/%{confdir}/example.get
%endif

# Unused files:
%if ! %{with_POP3_CL}
/bin/rm %buildroot/%{_mandir}/man5/masqmail.get.5*
%endif

%if ! %{with_MSERVER}
/bin/rm %buildroot/%{_mandir}/man8/mservdetect.8*
/bin/rm %buildroot/%{_bindir}/mservdetect
%endif

%clean
/bin/rm -Rf %buildroot


%files
%defattr(-, root, root, 0755)
%doc AUTHORS ChangeLog COPYING INSTALL NEWS README TODO
%dir %{_datadir}/masqmail
%dir %{_datadir}/masqmail/tpl
%dir %{_datadir}/masqmail/tpl/*
%{_mandir}/man5/masqmail.aliases.5*
%{_mandir}/man5/masqmail.conf.5*
%if %{with_POP3_CL}
%{_mandir}/man5/masqmail.get.5*
%endif
%{_mandir}/man5/masqmail.route.5*
%{_mandir}/man8/masqmail.8*
%if %{with_MSERVER}
%{_mandir}/man8/mservdetect.8*
%{_bindir}/mservdetect
%endif
%attr(04711, root, root) %{_sbindir}/masqmail

%dir %{confdir}
%config(noreplace) %{confdir}/masqmail.conf
%if %{with_POP3_CL}
%config(noreplace) %{confdir}/example.get
%endif
%config(noreplace) %{confdir}/example.route
%attr(0744, root, root) %config(noreplace) %{_sysconfdir}/rc.d/init.d/masqmail

%defattr(-, %{mailuser}, %{mailgroup}, 0755)
%dir %{logdir}
%dir %{spooldir}
%dir %{spooldir}/input
%dir %{spooldir}/lock
%dir %{spooldir}/popuidl


%post
# Install alternatives:
update-alternatives \
	--install %{_sbindir}/sendmail mta %{_sbindir}/masqmail 20 \
	--slave %{_libdir}/sendmail mta-in_libdir %{_sbindir}/masqmail \
	--slave %{_bindir}/mailq mta-mailq %{_sbindir}/masqmail
# Install service:
%_post_service masqmail


%preun
# Remove service:
%_preun_service masqmail

if [ $1 = 0 ]; then
# Clean up spool:
	for dir in input lock popuidl; do
		test -d %{spooldir}/$dir && /bin/rm -f %{spooldir}/$dir/*
	done
# Clean up logs:
	/bin/rm -f %{logdir}/*
# Remove alternatives:
	update-alternatives --remove mta %{_sbindir}/masqmail
fi


%changelog
* Tue Feb 10 2004 Lenny Cartier <lenny@mandrakesoft.com> 0.2.18-3mdk
- disable-resolver on amd64
- close endif

* Mon Sep 22 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.2.18-2mdk
- fix requires

* Tue Dec 31 2002 Lenny Cartier <lenny@mandrakesoft.com> 0.2.18-1mdk
- from Rémi Denis-Courmont <rdenis@simphalempin.com> :
	- Resync with mainstream version
	- Error templates moved to /usr/share
	- Fixed mservdetect manpage path
	- Optionnaly unused files removed from build root

* Sun Nov 17 2002 Rémi Denis-Courmont <rdenis@simphalempin.com> 0.2.16-1mdk
- Resync with mainstream version
- MTA alternatives no longer removed when upgrading package

* Sat Nov 09 2002 Rémi Denis-Courmont <rdenis@simphalempin.com> 0.2.15-1mdk
- Resync with mainstream version

* Sat Nov 02 2002 Rémi Denis-Courmont <rdenis@simphalempin.com> 0.2.14-1mdk
- Specfile created for Mandrake
- Init script created
- New masqmail.conf and example.route created