karsten / rpms / uw-imap

Forked from rpms/uw-imap 6 years ago
Clone
3d87698
3d87698
# Change the default connected directory from the user's home directory
3d87698
# to the named subdirectory of the user's home directory
3d87698
%define mail_subdirectory      Mail
3d87698
3d87698
Summary: UW Server daemons for IMAP and POP network mail protocols
3d87698
Name:	 uw-imap 
8e7d84b
Version: 2006
8e7d84b
Release: 1%{?dist}
004b59f
3d87698
License: University of Washington Free-Fork License
3d87698
Group: 	 System Environment/Daemons
3d87698
URL:	 http://www.washington.edu/imap/
3d87698
# Old (non-latest) releases live at  ftp://ftp.cac.washington.edu/imap/old/
8e7d84b
Source:	 ftp://ftp.cac.washington.edu/imap/imap-%{version}.tar.Z
3d87698
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3d87698
3d87698
%define soname    c-client
4e0e696
%define somajor  %{version} 
4e0e696
%define shlibname lib%{soname}.so.%{somajor}
4e0e696
%define imap_libs lib%{soname}%{somajor}
3d87698
#Old naming
3d87698
#define imap_libs	imap-libs
3d87698
4e0e696
# FC4+ uses %%_sysconfdir/pki/tls/certs, previous releases used %%_datadir/ssl/certs
3d87698
%define sslcerts  %{expand:%(if [ -d %{_sysconfdir}/pki/tls/certs ]; then echo "%{_sysconfdir}/pki/tls/certs"; else echo "%{_datadir}/ssl/certs"; fi)}
3d87698
3d87698
# imap -> uw-imap rename
3d87698
Obsoletes: imap < 1:%{version}
3d87698
7992bad
# legacy/old pam setup, using pam_stack.so
45f6deb
Source1: imap-legacy.pam
7992bad
# new pam setup, using new "include" feature
45f6deb
Source2: imap.pam
3d87698
Source3: imap-xinetd
3d87698
Source4: ipop2-xinetd
3d87698
Source5: ipop3-xinetd
3d87698
Source6: imaps-xinetd
3d87698
Source7: pop3s-xinetd
3d87698
8e7d84b
Patch1: imap-2006-paths.patch
3d87698
Patch5: imap-2001a-overflow.patch
3d87698
Patch7: imap-2002d-ssltype.patch
3d87698
Patch9: imap-2002e-shared.patch
3d87698
Patch10: imap-2002e-authmd5.patch
8e7d84b
Patch11: imap-2006-mixproto.patch
3d87698
3d87698
BuildRequires: krb5-devel
3d87698
BuildRequires: openssl-devel
3d87698
BuildRequires: pam-devel
3d87698
3d87698
# Prereq is shorter than separate Requires, Requires(post), Requires(postun)
3d87698
Prereq: xinetd
3d87698
Requires(post): openssl
3d87698
Requires(triggerpostun): sed >= 4.0
3d87698
3d87698
%description
3d87698
The %{name} package provides UW server daemons for both the IMAP (Internet
3d87698
Message Access Protocol) and POP (Post Office Protocol) mail access
3d87698
protocols.  The POP protocol uses a "post office" machine to collect
3d87698
mail for users and allows users to download their mail to their local
3d87698
machine for reading. The IMAP protocol allows a user to read mail on a
3d87698
remote machine without downloading it to their local machine.
3d87698
3d87698
%package -n %{imap_libs} 
3d87698
Summary: UW C-client mail library 
3d87698
Group:	 System Environment/Libraries
8e7d84b
Obsoletes: libc-client2004d < 1:2004d-2
8e7d84b
Obsoletes: libc-client2004e < 2004e-2
3d87698
%description -n %{imap_libs} 
3d87698
Provides a common API for accessing mailboxes. 
3d87698
3d87698
%package devel
3d87698
Summary: Development tools for programs which will use the UW IMAP library
3d87698
Group: 	 Development/Libraries
3d87698
Requires: %{imap_libs} = %{version}-%{release}
3d87698
# imap -> uw-imap rename
3d87698
Obsoletes: imap-devel < 1:%{version}
3d87698
Conflicts: libc-client-devel
3d87698
%description devel
3d87698
Contains the header files and static libraries for developing programs 
3d87698
which will use the UW C-client common API.
3d87698
3d87698
%package utils
3d87698
Summary: UW IMAP Utilities to make managing your email simpler
3d87698
Group: 	 Applications/System 
3d87698
# imap -> uw-imap rename
3d87698
Obsoletes: imap-utils < 1:%{version}
3d87698
%description utils
3d87698
This package contains some utilities for managing UW IMAP email.
3d87698
3d87698
3d87698
%prep
3d87698
%setup -q -n imap-%{version}
3d87698
3d87698
%patch1 -p1 -b .paths
3d87698
3d87698
%patch5 -p1 -b .overflow
3d87698
3d87698
%patch7 -p1 -b .ssltype
3d87698
3d87698
%patch9 -p1 -b .shared
3d87698
%patch10 -p1 -b .authmd5
8e7d84b
# use mix (instead of unix/mbox) folder format by default
4e0e696
# its faster, allows (better) locking
8e7d84b
%patch11 -p1 -b .mixproto
3d87698
8e7d84b
%if "%{?fedora}" > "4" || "%{?rhel}" > "5"
7992bad
install -p -m644 %{SOURCE2} imap.pam
7992bad
%else
7992bad
install -p -m644 %{SOURCE1} imap.pam
7992bad
%endif
3d87698
3d87698
3d87698
%build
8e7d84b
# Not sure why this was ever included, omitting for now -- Rex
3d87698
#EXTRACFLAGS="$EXTRACFLAGS -DDISABLE_POP_PROXY=1"
3d87698
8e7d84b
# Kerberos setup
3d87698
if [ -x %{_sysconfdir}/profile.d/krb5.sh ]; then
3d87698
  . %{_sysconfdir}/profile.d/krb5.sh
3d87698
elif ! echo ${PATH} | grep -q %{_prefix}kerberos/bin ; then
3d87698
  export PATH=%{_prefix}/kerberos/bin:${PATH}
3d87698
fi
3d87698
GSSDIR=$(krb5-config --prefix)
3d87698
8e7d84b
## SSL setup
8e7d84b
# (probably legacy-only) -- Rex
3d87698
export EXTRACFLAGS="$EXTRACFLAGS $(pkg-config --cflags openssl 2>/dev/null)"
3d87698
3d87698
make %{?_smp_mflags} lnp \
3d87698
EXTRACFLAGS="$EXTRACFLAGS" \
3d87698
EXTRALDFLAGS="$EXTRALDFLAGS" \
3d87698
EXTRAAUTHENTICATORS=gss \
3d87698
SPECIALS="GSSDIR=${GSSDIR} LOCKPGM=%{_sbindir}/mlock SSLCERTS=%{sslcerts} SSLDIR=%{_datadir}/ssl SSLINCLUDE=%{_includedir}/openssl SSLLIB=%{_libdir}" \
3d87698
SSLTYPE=unix \
3d87698
CCLIENTLIB=$(pwd)/c-client/%{shlibname} \
3d87698
SHLIBBASE=%{soname} \
3d87698
SHLIBNAME=%{shlibname}
3d87698
# Blank line
3d87698
3d87698
3d87698
%install
3d87698
rm -rf $RPM_BUILD_ROOT
3d87698
7992bad
mkdir -p $RPM_BUILD_ROOT%{_libdir}/
3d87698
install -p -m644 ./c-client/c-client.a $RPM_BUILD_ROOT%{_libdir}/
7992bad
ln -s c-client.a $RPM_BUILD_ROOT%{_libdir}/libc-client.a
3d87698
3d87698
install -p -m755 ./c-client/%{shlibname} $RPM_BUILD_ROOT%{_libdir}/
3d87698
ln -s %{shlibname} $RPM_BUILD_ROOT%{_libdir}/lib%{soname}.so
3d87698
7992bad
mkdir -p $RPM_BUILD_ROOT%{_includedir}/imap/
3d87698
install -m644 ./c-client/*.h $RPM_BUILD_ROOT%{_includedir}/imap
3d87698
# Added linkage.c to fix (#34658) <mharris>
3d87698
install -m644 ./c-client/linkage.c $RPM_BUILD_ROOT%{_includedir}/imap
3d87698
install -m644 ./src/osdep/tops-20/shortsym.h $RPM_BUILD_ROOT%{_includedir}/imap
3d87698
7992bad
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8/
3d87698
install -p -m644 src/{ipopd/ipopd,imapd/imapd}.8 $RPM_BUILD_ROOT%{_mandir}/man8/
3d87698
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
3d87698
install -p -m755 ipopd/ipop{2d,3d} $RPM_BUILD_ROOT%{_sbindir}/
3d87698
install -p -m755 imapd/imapd $RPM_BUILD_ROOT%{_sbindir}/
3d87698
install -p -m755 mlock/mlock $RPM_BUILD_ROOT%{_sbindir}/
3d87698
7992bad
mkdir -p $RPM_BUILD_ROOT%{_bindir}/
3d87698
install -p -m755 dmail/dmail mailutil/mailutil mtest/mtest tmail/tmail $RPM_BUILD_ROOT%{_bindir}/
7992bad
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
3d87698
install -p -m644 src/{dmail/dmail,mailutil/mailutil,tmail/tmail}.1 $RPM_BUILD_ROOT%{_mandir}/man1/
3d87698
7992bad
install -p -m644 -D imap.pam $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/imap
7992bad
install -p -m644 -D imap.pam $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/pop
3d87698
3d87698
install -p -m644 -D %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/imap
3d87698
install -p -m644 -D %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/imaps
3d87698
install -p -m644 -D %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/ipop2
3d87698
install -p -m644 -D %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/ipop3
3d87698
install -p -m644 -D %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/pop3s
3d87698
3d87698
# Generate ghost *.pem files
7992bad
mkdir -p $RPM_BUILD_ROOT%{sslcerts}/
3d87698
touch $RPM_BUILD_ROOT%{sslcerts}/{imapd,ipop3d}.pem
3d87698
3d87698
# c-client.cf: mail_subdirectory
3d87698
cat > c-client.cf <
3d87698
I accept the risk of using UW-IMAP
6439350
set mail-subdirectory %{mail_subdirectory}
3d87698
EOF
3d87698
install -p -m644 -D c-client.cf $RPM_BUILD_ROOT%{_sysconfdir}/c-client.cf
3d87698
3d87698
3d87698
%post
3d87698
{
3d87698
cd %{sslcerts} &> /dev/null || :
3d87698
for CERT in imapd.pem ipop3d.pem ;do
3d87698
   if [ ! -e $CERT ];then
3d87698
      if [ -e stunnel.pem ];then
3d87698
         cp stunnel.pem $CERT &> /dev/null || :
3d87698
      elif [ -e Makefile ];then
3d87698
         make $CERT << EOF &> /dev/null || :
3d87698
--
3d87698
SomeState
3d87698
SomeCity
3d87698
SomeOrganization
3d87698
SomeOrganizationalUnit
3d87698
localhost.localdomain
3d87698
root@localhost.localdomain
3d87698
EOF
3d87698
      fi
3d87698
   fi
3d87698
done
3d87698
} || :
3d87698
/sbin/service xinetd reload > /dev/null 2>&1 || :
3d87698
3d87698
%postun
3d87698
/sbin/service xinetd reload > /dev/null 2>&1 || :
3d87698
3d87698
%post -n %{imap_libs} -p /sbin/ldconfig
3d87698
3d87698
%postun -n %{imap_libs} -p /sbin/ldconfig
3d87698
3d87698
%triggerpostun -- imap < 1:2004
3d87698
#if upgrading from old version, don't change/set (default) MailDir
7992bad
if [ -f %{_sysconfdir}/c-client.cf ]; then
3d87698
  if grep -q "^set mail-subdirectory %{mail_subdirectory}" %{_sysconfdir}/c-client.cf; then
3d87698
    sed -i -e 's/^set mail-subdirectory/\#set mail-subdirectory/g' \
3d87698
      %{_sysconfdir}/c-client.cf
3d87698
  fi
3d87698
fi
3d87698
3d87698
3d87698
%clean
3d87698
rm -rf $RPM_BUILD_ROOT
3d87698
3d87698
3d87698
%files
45f6deb
%defattr(-,root,root,-)
7992bad
%doc docs/SSLBUILD
3d87698
%config %{_sysconfdir}/pam.d/imap
3d87698
%config %{_sysconfdir}/pam.d/pop
3d87698
%config(noreplace) %{_sysconfdir}/xinetd.d/imap
3d87698
%config(noreplace) %{_sysconfdir}/xinetd.d/ipop2
3d87698
%config(noreplace) %{_sysconfdir}/xinetd.d/ipop3
3d87698
# These need to be replaced (ie, can't use %%noreplace), or imaps/pop3s will fail after an upgrade
3d87698
%config %{_sysconfdir}/xinetd.d/imaps
3d87698
%config %{_sysconfdir}/xinetd.d/pop3s
3d87698
%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{sslcerts}/imapd.pem
3d87698
%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{sslcerts}/ipop3d.pem
3d87698
%config(noreplace) %{_sysconfdir}/c-client.cf
3d87698
%{_mandir}/man8/*
3d87698
%{_sbindir}/ipop2d
3d87698
%{_sbindir}/ipop3d
3d87698
%{_sbindir}/imapd
3d87698
3d87698
%files utils
45f6deb
%defattr(-,root,root,-)
3d87698
%{_bindir}/*
3d87698
%attr(2755, root, mail) %{_sbindir}/mlock
3d87698
%{_mandir}/man1/*
3d87698
3d87698
%files -n lib%{soname}%{version}
3d87698
%defattr(-,root,root)
3d87698
%doc docs/RELNOTES docs/*.txt
3d87698
%{_libdir}/lib%{soname}.so.*
3d87698
3d87698
%files devel
45f6deb
%defattr(-,root,root,-)
7992bad
%{_includedir}/imap/
3d87698
%{_libdir}/c-client.a
3d87698
%{_libdir}/libc-client.a
3d87698
%{_libdir}/lib%{soname}.so
3d87698
3d87698
3d87698
%changelog
8e7d84b
* Fri Sep 15 2006 Rex Dieter <rexdieter[AT]users.sf.net> 2006-1
8e7d84b
- imap-2006
8e7d84b
- change default (CREATEPROTO) driver to mix
8e7d84b
- Obsolete old libc-clients
8e7d84b
81c03f1
* Tue Aug 29 2006 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-6 
81c03f1
- fc6 respin
81c03f1
45f6deb
* Fri Aug 18 2006 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-5
45f6deb
- cleanup, respin for fc6
45f6deb
68c0660
* Wed Mar 1 2006 Rex Dieter <rexdieter[AT]users.sf.net> 
c41350f
- fc5: gcc/glibc respin
c41350f
7992bad
* Thu Nov 17 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-4
7992bad
- use pam's "include" feature on fc5
7992bad
- cleanup %%doc handling, remove useless bits
7992bad
6439350
* Thu Nov 17 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-3
6439350
- omit trailing whitespace in default c-client.cf
6439350
48983c6
* Wed Nov 16 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-2 
48983c6
- rebuild for new openssl
48983c6
3d87698
* Mon Sep 26 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-1
3d87698
- imap-2004g
3d87698
- /etc -> %%_sysconfdir
3d87698
- use %%{?_smp_mflags}
3d87698
3d87698
* Mon Aug 15 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004e-1
3d87698
- imap-2004e
3d87698
- rename: imap -> uw-imap (yay, we get to drop the Epoch)
3d87698
- sslcerts=%{_sysconfdir}/pki/tls/certs if exists, else /usr/share/ssl/certs
3d87698
3d87698
* Fri Apr 29 2005 Rex Dieter <rexdieter[AT]users.sf.net> 1:2004d-1
3d87698
- 2004d
3d87698
- imap-libs -> lib%%{soname}%%{version} (ie, libc-client2004d), so we can 
3d87698
  have multiple versions (shared-lib only) installed
3d87698
- move mlock to -utils.
3d87698
- revert RFC2301, locks out too many folks where SSL is unavailable
3d87698
3d87698
* Thu Apr 28 2005 Rex Dieter <rexdieter[AT]users.sf.net> 1:2004-0.fdr.11.c1
3d87698
- change default driver from mbox to mbx
3d87698
- comply with RFC 3501 security: Unencrypted plaintext passwords are prohibited
3d87698
3d87698
* Fri Jan 28 2005 Rex Dieter <rexdieter[AT]users.sf.net> 1:2004-0.fdr.10.c1
3d87698
- imap-2004c1 security release:
3d87698
  http://www.kb.cert.org/vuls/id/702777
3d87698
3d87698
* Thu Jan 20 2005 Rex Dieter <rexdieter[AT]users.sf.net> 1:2004-0.fdr.9.c
3d87698
- imap2004c
3d87698
- -utils: dmail,mailutil,tmail
3d87698
- -libs: include mlock (so it's available for other imap clients, like pine)
3d87698
- remove extraneous patches
3d87698
- %%_sysconfigdir/c-client.cf: use to set MailDir (but don't if upgrading from
3d87698
  an older version (ie, if folks don't want/expect a change in behavior)
3d87698
3d87698
* Mon Sep 13 2004 Rex Dieter 
3d87698
- don't use mailsubdir patch (for now)
3d87698
3d87698
* Wed Aug 11 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.7.a
3d87698
- mailsubdir patch (default to ~/Mail instead of ~)
3d87698
3d87698
* Fri Jul 23 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.6.a
3d87698
- remove Obsoletes/Provides: libc-client (they can, in fact, co-xist)
3d87698
- -devel: remove O/P: libc-client-devel -> Conflicts: libc-client-devel
3d87698
3d87698
* Thu Jul 16 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.5.a
3d87698
- imap2004a
3d87698
3d87698
* Tue Jul 13 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.4
3d87698
- -devel: Req: %%{name}-libs
3d87698
3d87698
* Tue Jul 13 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.3
3d87698
- previous imap pkgs had Epoch: 1, we need it too.
3d87698
3d87698
* Wed Jul 07 2004 Rex Dieter <rexdieter at sf.net> 2004-0.fdr.2
3d87698
- use %%version as %%somajver (like how openssl does it)
3d87698
3d87698
* Wed Jul 07 2004 Rex Dieter <rexdieter at sf.net> 2004-0.fdr.1
3d87698
- imap-2004
3d87698
- use mlock, if available.
3d87698
- Since libc-client is an attrocious name choice, we'll trump it, 
3d87698
  and provide imap, imap-libs, imap-devel instead (redhat bug #120873)
3d87698
3d87698
* Wed Apr 07 2004 Kaj J. Niemi <kajtzu@fi.basen.net> 2002e-4
3d87698
- Use CFLAGS (and RPM_OPT_FLAGS) during the compilation
3d87698
- Build the .so through gcc instead of directly calling ld 
3d87698
3d87698
* Fri Mar  5 2004 Joe Orton <jorton@redhat.com> 2002e-3
3d87698
- install .so with permissions 0755
3d87698
- make auth_md5.c functions static to avoid symbol conflicts
3d87698
- remove Epoch: 0
3d87698
3d87698
* Tue Mar 02 2004 Kaj J. Niemi <kajtzu@fi.basen.net> 0:2002e-2
3d87698
- "lnp" already uses RPM_OPT_FLAGS
3d87698
- have us conflict with imap, imap-devel
3d87698
3d87698
* Tue Mar  2 2004 Joe Orton <jorton@redhat.com> 0:2002e-1
3d87698
- add post/postun, always use -fPIC
3d87698
3d87698
* Tue Feb 24 2004 Kaj J. Niemi <kajtzu@fi.basen.net>
3d87698
- Name change from c-client to libc-client
3d87698
3d87698
* Sat Feb 14 2004 Kaj J. Niemi <kajtzu@fi.basen.net> 0:2002e-0.1
3d87698
- c-client 2002e is based on imap-2002d
3d87698
- Build shared version, build logic is copied from FreeBSD net/cclient
3d87698