mailutils/mailutils.spec

387 lines
12 KiB
RPMSpec

#
# spec file for package mailutils
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# See bug boo#1095783
# Currently disabled suid/sgid program dotlock and maidag
%bcond_with set_user_identity
%define somajor 5
Name: mailutils
Version: 3.4
Release: 0
License: LGPL-3.0-or-later and GPL-3.0-or-later
Summary: GNU Mailutils
Url: https://mailutils.org/
Group: Productivity/Networking/Email/Clients
Source: ftp://ftp.gnu.org/gnu/mailutils/mailutils-3.4.tar.xz
Source1: mailutils-rpmlintrc
Patch0: lisp-load-silent.patch
Patch1: mimeview_lexer_format-security.patch
Patch2: silent-rpmlint-with_initgroups.patch
BuildRequires: bison
BuildRequires: cpio
BuildRequires: cyrus-sasl-gssapi
BuildRequires: fdupes
BuildRequires: flex
%if 0
# Seems not compatible with original radius (missing debug.h)
BuildRequires: freeradius-server-devel
%endif
BuildRequires: gcc-c++
BuildRequires: libmysqld-devel
BuildRequires: m4
BuildRequires: makeinfo
BuildRequires: openldap2-devel
BuildRequires: pam-devel
BuildRequires: pkgconfig(fribidi)
BuildRequires: pkgconfig(gnutls)
BuildRequires: pkgconfig(guile-2.0)
BuildRequires: pkgconfig(libgsasl)
BuildRequires: pkgconfig(krb5-gssapi)
BuildRequires: pkgconfig(kyotocabinet)
%if 0
# Does not compile due API changes
BuildRequires: pkgconfig(python3)
%else
BuildRequires: pkgconfig(python)
%endif
BuildRequires: readline-devel
BuildRequires: tcpd-devel
BuildRequires: update-alternatives
Requires(post): update-alternatives
Requires(preun): update-alternatives
Requires(post): %install_info_prereq
Requires(preun): %install_info_prereq
%if %{with set_user_identity}
Requires(post): permissions
Requires(verify): permissions
%endif
%description
Mailutils is a swiss army knife of electronic mail handling.
It offers a rich set of utilities and daemons for processing e-mail.
All Mailutils programs are able to operate on mailboxes of any
existing format, ranging from standard UNIX maildrops, through
maildir and up to remote mailboxes, which are transparently
accessed using IMAP4, POP3 and SMTP.
Regular users will find here an implementation of the traditional
UNIX mail reader mail, command line utilities, such as frm,
messages, readmsg, and sieve -- a flexible utility for filtering
the incoming mail.
A special feature of Mailutils is an implementation of the
MH Message Handling System, which combines a power of the UNIX
philosophy with a flexibility of Mailutils libraries, thus
allowing to easily incorporate mail from remote mailboxes.
For system administrators, Mailutils provides a set of daemons
for delivering and reading electronic mail, including
pop3d, imap4d and a universal mail delivery agent, called maidag.
%package mh
Summary: GNU Mailutils -- Support for MH mailbox format
Group: Productivity/Networking/Email/Clients
%description mh
The primary aim of this implementation is to provide an interface
between Mailutils and Emacs using mh-e module.
To use Mailutils MH with Emacs, add the following line to your
site-start.el or .gnu-emacs file: (load "mailutils-mh")
%if %{with set_user_identity}
%package delivery
Summary: GNU Mailutils -- Server daemon MAIDAG, the mail delivery agent
Group: Productivity/Networking/Email/Servers
%description delivery
The name 'maidag' stands for Mail delivery agent. It is a
general-purpose MDA offering a rich set of features. It can operate
both in traditional mode, reading the message from its standard input,
and in LMTP mode. 'Maidag' is able to deliver mail to any mailbox
format, supported by GNU Mailutils. These formats, among others,
include 'smtp://', 'prog://' and 'sendmail://' which are equivalent to
forwarding a message over SMTP to a remote node.
%endif
%package notify
Summary: GNU Mailutils -- Server daemon COMSATD, notify users about incoming mail
Group: Productivity/Networking/Email/Servers
%description notify
Comsatd is the server which receives reports of incoming mail and
notifies users, wishing to get this service.
%package imap4d
Summary: GNU Mailutils -- Server daemon IMAP4D
Group: Productivity/Networking/Email/Servers
%description imap4d
GNU 'imap4d' is a daemon implementing IMAP4 rev1 protocol for accessing
and handling electronic mail messages on a server.
%package pop3d
Summary: GNU Mailutils -- Server daemon POP3D
Group: Productivity/Networking/Email/Servers
Conflicts: courier-imap
%description pop3d
The 'pop3d' daemon implements the Post Office Protocol Version 3 server.
%package devel
Summary: GNU Mailutils -- Development
Group: Development/Libraries/Other
Requires: libmailutils%{somajor} == %{version}
Requires: mailutils == %{version}
%description devel
This package includes libraries and header files for building tools to
access mailutils features.
%package -n libmailutils%{somajor}
Summary: GNU Mailutils -- Shared libraries
Group: System/Libraries
%description -n libmailutils%{somajor}
At the core of Mailutils is 'libmailutils', a library which provides
an API for accessing a generalized mailbox. A set of complementary
libraries provide methods for handling particular mailbox
implementations: UNIX mailbox, Maildir, MH, POP3, IMAP4, even SMTP.
%prep
%setup -q
%patch0
%patch1 -p1
%patch2
#
# Avoid build require for emacs as emacs does
# build require one the sub packages herein!
#
mkdir bin
(cat > bin/emacs)<<-'EOF'
#!/bin/sh
case "$@" in
*byte-compile*)
for arg
do
case "$arg" in
*.elc)
> "$arg"
;;
*)
esac
done
;;
*load-path*)
echo %{_datadir}/emacs/site-lisp
;;
*)
esac
EOF
chmod 755 bin/emacs
#
# There is no python-config for python3
#
if type -p python3-config > /dev/null 2>&1
then
sed -ri '\@python-config@{ s@python-config@python3-config@ }' configure
fi
%build
PATH="$PWD/bin:$PATH"
CC=gcc
CXX=g++
#
# In frm/frm.h wrong definition of MB_LEN_MAX if not defined
#
CFLAGS="-Wall $RPM_OPT_FLAGS -D_GNU_SOURCE -DMB_LEN_MAX=16 -fno-strict-aliasing"
CXXFLAGS="-Wall $RPM_OPT_FLAGS -D_GNU_SOURCE -DMB_LEN_MAX=16 -fno-strict-aliasing"
export PATH CC CXX CFLAGS CXXFLAGS
%configure --enable-ipv6 \
--enable-build-servers \
--enable-build-clients \
--disable-debug \
--disable-rpath \
%if %{without set_user_identity}
--disable-build-dotlock \
--disable-build-maidag \
%endif
%if 0
--disable-silent-rules \
%endif
--disable-static \
--with-gnu-ld \
--with-gssapi \
--with-tcp-wrappers \
--with-ldap \
--with-lispdir=%{_datadir}/emacs/site-lisp \
--with-log-facility=LOG_MAIL \
--with-kyotocabinet \
CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"
make %{?_smp_mflags}
%install
PATH="$PWD/bin:$PATH"
make install DESTDIR=%{buildroot} %{?_smp_mflags}
#
# Remove dir, .la and .elc files
#
find %{buildroot} \( -name dir -o -name '*.la' -o -name '*.elc' \) -exec rm -fv '{}' \+
#
# Rename the mail program to avoid conflicts
#
mv %{buildroot}%{_bindir}/mail %{buildroot}%{_bindir}/mu-mail
mv %{buildroot}%{_mandir}/man1/mail.1 %{buildroot}%{_mandir}/man1/mu-mail.1
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -sf %{_bindir}/mu-mail %{buildroot}%{_sysconfdir}/alternatives/mail
ln -sf %{_mandir}/man1/mu-mail.1%{?ext_man} %{buildroot}%{_sysconfdir}/alternatives/mail.1%{?ext_man}
#
#
#
%if %{with set_user_identity}
mkdir -p %{buildroot}%{_sysconfdir}/permissions.d
(cat > %{buildroot}%{_sysconfdir}/permissions.d/mailutils) <<-'EOF'
%{_bindir}/dotlock root:root 02755
%{_sbindir}/maidag root:root 04755
EOF
(cat > %{buildroot}%{_sysconfdir}/permissions.d/mailutils.paranoid) <<-'EOF'
%{_bindir}/dotlock root:root 00755
%{_sbindir}/maidag root:root 00755
EOF
%endif
%fdupes -s %{buildroot}%{_libexecdir}/python*/site-packages/mailutils/
%find_lang %name
%post
%install_info --info-dir=%{_infodir} %{_infodir}/mailutils.info.gz
%{_sbindir}/update-alternatives --quiet --force \
--install %{_bindir}/mail mail %{_bindir}/mu-mail 10 \
--slave /bin/mail binmail %{_bindir}/mu-mail \
--slave %{_bindir}/Mail Mail %{_bindir}/mu-mail \
--slave %{_mandir}/man1/mail.1%{?ext_man} mail.1%{?ext_man} %{_mandir}/man1/mu-mail.1%{?ext_man} \
--slave %{_mandir}/man1/Mail.1%{?ext_man} Mail.1%{?ext_man} %{_mandir}/man1/mu-mail.1%{?ext_man}
%if %{with set_user_identity}
%set_permissions %{_bindir}/dotlock
%set_permissions %{_sbindir}/maidag
%endif
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/mailutils.info.gz
%{_sbindir}/update-alternatives --quiet --force --remove mail %{_bindir}/mu-mail
%post -n libmailutils%{somajor} -p /sbin/ldconfig
%postun -n libmailutils%{somajor} -p /sbin/ldconfig
%if %{with set_user_identity}
%verifyscript
%verify_permissions %{_bindir}/dotlock
%verify_permissions %{_sbindir}/maidag
%endif
%files -f %name.lang
%defattr(-,root,root)
%license COPYING COPYING.LESSER
%doc ChangeLog README NEWS AUTHORS THANKS
%doc %{_infodir}/mailutils.info*.gz
%doc %{_mandir}/man1/*.1%{?ext_man}
%if %{with set_user_identity}
%config %{_sysconfdir}/permissions.d/mailutils*
%endif
%ghost %config %{_sysconfdir}/alternatives/binmail
%ghost %config %{_sysconfdir}/alternatives/Mail
%ghost %config %{_sysconfdir}/alternatives/mail
%ghost %config %{_sysconfdir}/alternatives/Mail.1%{?ext_man}
%ghost %config %{_sysconfdir}/alternatives/mail.1%{?ext_man}
%if %{with set_user_identity}
%attr(02755,root,root) %verify(not mode) %{_bindir}/dotlock
%endif
%{_bindir}/frm
%{_bindir}/from
%{_bindir}/guimb
%{_bindir}/mu-mail
%{_bindir}/mailutils
%{_bindir}/mailutils-config
%{_bindir}/messages
%{_bindir}/mimeview
%{_bindir}/movemail
%{_bindir}/popauth
%{_bindir}/readmsg
%{_bindir}/sieve
%dir %{_libexecdir}/mailutils/
%{_libexecdir}/mailutils/mailutils-*
%dir %{_libexecdir}/python*/site-packages/mailutils/
%{_libexecdir}/python*/site-packages/mailutils/*.p*
%dir %{_libdir}/mailutils/
%{_libdir}/mailutils/*.so
%dir %{_libdir}/python*/site-packages/mailutils/
%{_libdir}/python*/site-packages/mailutils/c_api.so
%files mh
%defattr(-,root,root)
%dir %{_bindir}/mu-mh/
%{_bindir}/mu-mh/*
%{_datadir}/emacs/site-lisp/mailutils-mh.el
%dir %{_datadir}/mailutils/
%dir %{_datadir}/mailutils/mh/
%{_datadir}/mailutils/mh/*
%if %{with set_user_identity}
%files delivery
%defattr(-,root,root)
%attr(04755,root,root) %verify(not mode) %{_sbindir}/maidag
%endif
%files notify
%defattr(-,root,root)
%{_sbindir}/comsatd
%files imap4d
%defattr(-,root,root)
%{_sbindir}/imap4d
%files pop3d
%defattr(-,root,root)
%{_sbindir}/pop3d
%files devel
%defattr(-,root,root)
%{_libdir}/*.so
%dir %{_includedir}/mailutils/
%{_includedir}/mailutils/*.h
%dir %{_includedir}/mailutils/sys/
%{_includedir}/mailutils/sys/*.h
%{_datadir}/aclocal/mailutils.m4
%dir %{_datadir}/guile/site/2.0/
%dir %{_datadir}/guile/site/2.0/mailutils/
%{_datadir}/guile/site/2.0/mailutils/*
%files -n libmailutils%{somajor}
%defattr(-,root,root)
%{_libdir}/*.so.*
%changelog