File qpopper.spec of Package qpopper

#
# spec file for package qpopper
#
# Copyright (c) 2011 SUSE LINUX Products 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/
#

# norootforbuild


Name:           qpopper
BuildRequires:  gdbm-devel openssl-devel pam-devel postfix
Version:        4.1.0
Release:        1
License:        LGPLv2 or later, BSD 4 (UCB)
Group:          Productivity/Networking/Email/Servers
Url:            http://www.eudora.com/products/unsupported/qpopper/index.html
Source0:        ftp://ftp.qualcomm.com/eudora/servers/unix/popper/%{name}%{version}.tar.gz
# pam config
Source1:        pop3
# xinetd config
Source2:        qpopper.xinetd
# show that SuSE has modified qpopper
Patch0:         banner.diff
# make response to 'wrong password' and 'non existing account' identical
Patch1:         auth-text.diff
# fix some race condition in popauth
Patch2:         popauth.diff
# fix some minor security problems
Patch3:         security1.diff
# fix some compile warnings
Patch4:         include1.diff
# fix path in manpage
Patch5:         manpage.diff
# build with proper compiler flags
Patch6:         qpopper-buildflags.diff
Summary:        POP3 Mail Daemon from Qualcomm Inc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       pam inet-daemon
PreReq:         /usr/sbin/useradd permissions

%description
A mail server using the POP3 protocol. The daemon also supports the
more secure APOP protocol.

You must agree to the license in
/usr/share/doc/packages/qpopper/License.txt before you can use qpopper.

After installation, activate the server in the /etc/inetd.conf or
/etc/xinetd.d/qpopper file.


%package doc
License:        PERMISSIVE-OSI-COMPLIANT
Group:          Documentation/Other
Summary:        Documentation about the POP3 Mail Daemon from Qualcomm Inc
Requires:       %{name} = %{version}
BuildArch:      noarch

%description doc
Documentation about the POP3 Mail Daemon from Qualcomm Inc


%prep
%setup -q -n %{name}%{version}
%patch0
%patch1
%patch2
%patch3 -p1
%patch4
%patch5 -p1
%patch6 -p1

%build
CFLAGS="$RPM_OPT_FLAGS -fstack-protector" ./configure \
 --enable-uw-kludge \
 --enable-debugging \
 --with-pam \
 --with-warnings \
 --prefix=/usr \
 --enable-specialauth \
 --enable-apop=/etc/pop.auth \
 --with-popuid \
 --enable-shy \
 --with-openssl
make CFLAGS="$RPM_OPT_FLAGS \
 -DBLOCK_UID=100 \
 -DPOP_TIMEOUT=600 \
 -DNONAUTHFILE=\\\"/etc/mail/pop.nonauthfile\\\" \
 -fstack-protector"

%install
install -d -m 755 $RPM_BUILD_ROOT/usr/sbin
install -m 755 popper/popper $RPM_BUILD_ROOT/usr/sbin/popper
install -m 755 popper/popauth $RPM_BUILD_ROOT/usr/sbin/popauth
install -d -m 755 $RPM_BUILD_ROOT/usr/share/man/man8
install -m 644 man/popper.8 $RPM_BUILD_ROOT/usr/share/man/man8/popper.8
install -m 644 man/popauth.8 $RPM_BUILD_ROOT/usr/share/man/man8/popauth.8
install -d -m 755 $RPM_BUILD_ROOT/etc/pam.d
install -m 644 %{S:1} $RPM_BUILD_ROOT/etc/pam.d/pop3
install -d -m 755 $RPM_BUILD_ROOT/etc/xinetd.d
install -m 644 %{S:2} $RPM_BUILD_ROOT/etc/xinetd.d/qpopper
install -d -m 755 $RPM_BUILD_ROOT/var/lib/pop

%clean
rm -rf $RPM_BUILD_ROOT

%pre
/usr/sbin/useradd -r -o -u 67 -g users -s /bin/false -c "POP admin" -d /var/lib/pop pop 2> /dev/null || :

%post
%if %suse_version >= 1140
%set_permissions /usr/sbin/popauth
%else
%run_permissions
%endif
%verifyscript
%verify_permissions -e /usr/sbin/popauth

%files
%defattr (-, root, root)
%doc License.txt README doc/Changes doc/Release.Notes
%attr (755, pop, root) %dir /var/lib/pop
%verify(not mode) %attr (4750, pop, trusted) /usr/sbin/popauth
%attr (755, root, root) /usr/sbin/popper
/usr/share/man/man8/*
%config /etc/pam.d/pop3
%config(noreplace) /etc/xinetd.d/qpopper

%files doc
%defattr (-, root, root)
%doc GUIDE.pdf doc/LMOS-FAQ.html doc/README.Berkeley doc/rfc1939.txt doc/rfc2449.txt

%changelog
openSUSE Build Service is sponsored by