%define version 2006j %define fversion 2006j2 %define fname imap %define epoch 1 %define soname c-client-php %define major 0 %define libname %mklibname %{soname} %{major} %define develname %mklibname -d %{soname} # Change the default connected directory from the user's home directory # to the named subdirectory of the user's home directory %define mailsubdir Mail %define name imap %define renamed_uw 0 %define with_krb 1 Summary: Server daemons for IMAP and POP network mail protocols Name: %{fname} Version: %{version} Release: %mkrel 1 License: Apache License Group: System/Servers Source: ftp://ftp.cac.washington.edu/mail/imap-%{fversion}.tar.Z Source2: imap-xinetd Source3: ipop3-xinetd Source4: ipop2-xinetd Source5: imaps-xinetd Source6: pop3s-xinetd Source7: flock.c # yves - 2001a-4mdk - this makefile comes from RH openssl rpm Source8: Makefile.imap Source9: ftp://ftp.cac.washington.edu/mail/imap-utils.tar.bz2 Patch0: imap-2002e-ssl.patch Patch1: imap-2006c1-linux.diff Patch3: imap-2001a-disable-mbox.patch Patch4: imap-2001a-redhat.patch Patch5: imap-2006c1-flock.diff Patch9: imap-2006c1-glibc-2.2.2.diff Patch11: imap-2006c1-krbpath.diff Patch12: imap-2001a-overflow.patch Patch16: imap-utils-makefiles.patch # (sb) ipop3d gripes about msec permissions on /var/spool/mail Patch17: imap-mail-spool-perms.diff Patch21: imap-2004a-shared.patch Patch22: imap-2002e-authmd5.patch # (oe) the annotate patch is implemented upstream and needed by kolab2 Patch23: imap-2006c1-annotate.diff # (oe) http://www.gadgetwiz.com/software/hash_reset.html Patch24: imap-2004g-hash_reset.diff Patch25: imap-yes.diff Buildroot: %{_tmppath}/%{name}-buildroot Requires: pam >= 0.59 Requires(post): xinetd Requires(postun): xinetd BuildRequires: openssl-devel %if %{with_krb} BuildRequires: krb5-devel %endif BuildRequires: pam-devel URL: http://www.washington.edu/imap/ Epoch: %{epoch} Conflicts: cyrus-imapd courier-imap %if %{renamed_uw} Provides: imap = %{version} Obsoletes: imap %endif %description The imap package provides server daemons for both the IMAP (Internet Message Access Protocol) and POP (Post Office Protocol) mail access protocols. The POP protocol uses a "post office" machine to collect mail for users and allows users to download their mail to their local machine for reading. The IMAP protocol provides the functionality of POP, but allows a user to read mail on a remote machine without downloading it to their local machine. Install the imap package if you need a server to support the IMAP or the POP mail access protocols. %package devel Summary: Libraries, includes, etc to develop IMAP applications Group: Development/C %if %{renamed_uw} Provides: imap-devel = %{version} Obsoletes: imap %endif %description devel The imap-devel package contains the header files and static libraries for developing programs which will use the IMAP (Internet Message Access Protocol) library. %package utils Summary: Some basic IMAP utilities to make managing your email simpler Group: System/Servers %if %{renamed_uw} Provides: imap-utils = %{version} Obsoletes: imap %endif %description utils This package contains some basic IMAP tools for managing IMAP email. These tools are part of the uw-imapd, but may be used indepentantly since they are stand-alone and not bound to a specific IMAP server. chkmail - check for new mail icat - "cat" a mailbox from an IMAP source (standard Unix mailbox format) ifrom - one line per message summary of IMAP mailbox imapcopy - copy messages from an IMAP inbox to a local mailbox imapmove - move messages from an IMAP inbox to a local mailbox imapxfer - copy mailboxes between IMAP servers mbxcreat - create a new mailbox mbxcopy - copy messages to a new mailbox mbxmove - move messages to a new mailbox mbxcvt - copy or move messages to a new mailbox, converting mailbox format dmail - procmail Mail Delivery Module tmail - Mail Delivery Module %package -n %{libname} Summary: C-client mail access routines for IMAP and POP protocols Group: System/Libraries Provides: c-client %description -n %{libname} C-client is a common API for accessing mailboxes. It is used internally by the popular PINE mail reader, the University of Washington's IMAP server and PHP. This package contains the shared c-client library. %package -n %{develname} Summary: Development files for the c-client library Group: Development/C Provides: libc-client-php-devel Requires: %{libname} = %{epoch}:%{version} Requires: imap-devel = %{epoch}:%{version} Provides: %{libname}-devel = %{epoch}:%{version}-%{release} Obsoletes: %{libname}-devel %description -n %{develname} C-client is a common API for accessing mailboxes. It is used internally by the popular PINE mail reader, the University of Washington's IMAP server and PHP. This package contains development files for the c-client library. %prep %setup -q -n %{fname}-%{version} -a9 # (sb) breaks patching rm -rf RCS %patch0 -p0 -b .ssl %patch1 -p0 -b .linux %patch3 -p1 -b .mbox %patch4 -p1 -b .redhat %patch5 -p0 -b .flock install -m 0644 %{SOURCE7} src/osdep/unix/flock.c %patch9 -p1 -b .glibc %if %{with_krb} %patch11 -p0 -b .gssapi-patch %endif %patch12 -p1 -b .overflow %patch16 -p1 -b .utils %patch17 -p0 -b .lock-warning %patch21 -p1 -b .shared %patch22 -p1 -b .authmd5 %patch23 -p1 -b .annotate %patch24 -p1 -b .hash_reset %patch25 -p0 -b .yes # save man pages, since main Makefile overwrites these directories mv tmail/tmail.1 . mv dmail/dmail.1 . install -m 0644 %{SOURCE2} imap-xinetd install -m 0644 %{SOURCE3} ipop3-xinetd install -m 0644 %{SOURCE4} ipop2-xinetd install -m 0644 %{SOURCE5} imaps-xinetd install -m 0644 %{SOURCE6} pop3s-xinetd mv docs/rfc/README docs/rfc/README.rfc mv docs/draft/README docs/draft/README.draft %build %serverbuild EXTRACFLAGS="$EXTRACFLAGS -I%{_includedir}/openssl" %if %with_krb EXTRACFLAGS="$EXTRACFLAGS -I%{_includedir}/krb5" %endif EXTRALDFLAGS="$EXTRALDFLAGS -L%{_libdir}" touch ip6 %make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DDIC -fPIC -fno-omit-frame-pointer" lnp \ EXTRACFLAGS="$EXTRACFLAGS" \ EXTRALDFLAGS="$EXTRALDFLAGS" \ %if %{with_krb} EXTRAAUTHENTICATORS=gss \ %endif SSLDIR=%{_libdir}/ssl \ SSLINCLUDE=%{_includedir}/openssl \ SSLLIB=%{_libdir} \ LOCKPGM=%{_sbindir}/mlock \ SSLTYPE=unix.nopwd \ BASECFLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DDIC -fPIC -fno-omit-frame-pointer" \ IP=6 mv -f ipopd/ipop3d ipop3sd mv -f imapd/imapd imapsd mv -f c-client/c-client.a c-client-ssl.a make clean ################################################################################ # Build a usable c-client.a for PHP4 (duh!) // Oden Eriksson Tue 15 Jun 2004 # Thanks to Troels Arvin <troels@arvin.dk> and Kaj J. Niemi for he hints! EXTRACFLAGS="$EXTRACFLAGS -DDISABLE_POP_PROXY=1 -DIGNORE_LOCK_EACCES_ERRORS=1" EXTRACFLAGS="$EXTRACFLAGS -I%{_includedir}/openssl" EXTRALDFLAGS="$EXTRALDFLAGS -L%{_libdir}" make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DDIC -fPIC -fno-omit-frame-pointer" slx \ EXTRACFLAGS="$EXTRACFLAGS" \ EXTRALDFLAGS="$EXTRALDFLAGS" \ SSLDIR=%{_libdir}/ssl \ SSLINCLUDE=%{_includedir}/openssl \ SSLLIB=%{_libdir} \ LOCKPGM=%{_sbindir}/mlock \ SSLTYPE=unix \ SHLIBBASE=%{soname} \ SHLIBNAME=lib%{soname}.so.%{major} \ BASECFLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DDIC -fPIC -fno-omit-frame-pointer" \ IP=6 mv -f c-client/c-client.a %{soname}.a mv -f c-client/lib%{soname}.so.%{major} . make clean ################################################################################ # rebuild without SSL support to allow using of different (imapd/imapsd, ipop3d/ipop3sd) # libwrapper entries. %make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DDIC -fPIC -fno-omit-frame-pointer" lnp \ EXTRACFLAGS="$EXTRACFLAGS" \ LOCKPGM=%{_sbindir}/mlock \ SSLTYPE=none \ BASECFLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DDIC -fPIC -fno-omit-frame-pointer" \ IP=6 cp -p c-client/c-client.a c-client-nossl.a # build imap-utils for i in chkmail icat ifrom imapcopy imapxfer mbxcopy mbxcreat mbxcvt ; do %make -C $i done %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} # make some directories install -d %{buildroot}%{_sysconfdir}/pam.d install -d %{buildroot}%{_sysconfdir}/xinetd.d install -d %{buildroot}%{_sysconfdir}/ssl/imap install -d %{buildroot}%{_sbindir} install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_libdir} install -d %{buildroot}%{_includedir}/imap install -d %{buildroot}%{_localstatedir}/imap/ssl install -d %{buildroot}%{_mandir}/man8 install -d %{buildroot}%{_mandir}/man1 # install man pages install -m0644 chkmail/chkmail.1 %{buildroot}%{_mandir}/man1/ install -m0644 dmail.1 %{buildroot}%{_mandir}/man1/ install -m0644 icat/icat.1 %{buildroot}%{_mandir}/man1/ install -m0644 ifrom/ifrom.1 %{buildroot}%{_mandir}/man1/ install -m0644 imapcopy/imapcopy.1 %{buildroot}%{_mandir}/man1/ install -m0644 imapxfer/imapxfer.1 %{buildroot}%{_mandir}/man1/ install -m0644 mbxcopy/mbxcopy.1 %{buildroot}%{_mandir}/man1/ install -m0644 mbxcreat/mbxcreat.1 %{buildroot}%{_mandir}/man1/ install -m0644 mbxcvt/mbxcvt.1 %{buildroot}%{_mandir}/man1/ install -m0644 tmail.1 %{buildroot}%{_mandir}/man1/ install -m0644 src/imapd/imapd.8 %{buildroot}%{_mandir}/man8/imapd.8 install -m0644 src/ipopd/ipopd.8 %{buildroot}%{_mandir}/man8/ipopd.8 # install daemons install -m0755 ipopd/ipop2d %{buildroot}%{_sbindir}/ install -m0755 ipopd/ipop3d %{buildroot}%{_sbindir}/ install -m0755 imapd/imapd %{buildroot}%{_sbindir}/ install -m0755 ipop3sd %{buildroot}%{_sbindir}/ install -m0755 imapsd %{buildroot}%{_sbindir}/ # install utils install -m0755 chkmail/chkmail %{buildroot}%{_bindir}/ install -m0755 dmail/dmail %{buildroot}%{_bindir}/ install -m0755 icat/icat %{buildroot}%{_bindir}/ install -m0755 ifrom/ifrom %{buildroot}%{_bindir}/ install -m0755 imapcopy/imapcopy %{buildroot}%{_bindir}/ ln -snf imapcopy %{buildroot}%{_bindir}/imapmove install -m0755 imapxfer/imapxfer %{buildroot}%{_bindir}/ install -m0755 mbxcopy/mbxcopy %{buildroot}%{_bindir}/ ln -snf mbxcopy %{buildroot}%{_bindir}/mbxmove install -m0755 mbxcreat/mbxcreat %{buildroot}%{_bindir}/ install -m0755 mbxcvt/mbxcvt %{buildroot}%{_bindir}/ install -m0755 tmail/tmail %{buildroot}%{_bindir}/ # install pam files %if %mdkversion < 200700 cat > %{buildroot}%{_sysconfdir}/pam.d/imap <<EOF #%PAM-1.0 auth required pam_stack.so service=system-auth account required pam_stack.so service=system-auth EOF %else cat > %{buildroot}%{_sysconfdir}/pam.d/imap <<EOF #%PAM-1.0 auth include system-auth account include system-auth EOF %endif cp -a %{buildroot}%{_sysconfdir}/pam.d/{imap,pop} # install headers install -m0644 c-client/*.h %{buildroot}%{_includedir}/imap/ install -m0644 src/osdep/tops-20/shortsym.h %{buildroot}%{_includedir}/imap/ # install static libraries install -m0644 c-client-nossl.a %{buildroot}%{_libdir}/libc-client-nossl.a install -m0644 c-client-ssl.a %{buildroot}%{_libdir}/libc-client.a # rh - Added linkage.c to fix (#34658) <mharris> install -m0644 c-client/linkage.c %{buildroot}%{_includedir}/imap/ # install xinetd scripts install -m0644 imap-xinetd %{buildroot}%{_sysconfdir}/xinetd.d/imap install -m0644 ipop3-xinetd %{buildroot}%{_sysconfdir}/xinetd.d/ipop3 install -m0644 ipop2-xinetd %{buildroot}%{_sysconfdir}/xinetd.d/ipop2 install -m0644 imaps-xinetd %{buildroot}%{_sysconfdir}/xinetd.d/imaps install -m0644 pop3s-xinetd %{buildroot}%{_sysconfdir}/xinetd.d/pop3s # SSL support # Generate ghost *.pem files touch %{buildroot}%{_sysconfdir}/ssl/imap/{imapsd,ipop3sd}.pem chmod 600 %{buildroot}%{_sysconfdir}/ssl/imap/{imapsd,ipop3sd}.pem # install the RedHat Makefile install -m 0644 %{SOURCE8} %{buildroot}%{_localstatedir}/imap/ssl/Makefile.imap # (sb) moved the above Makefile to make rpmlint happy ln -sf %{_localstatedir}/imap/ssl/Makefile.imap %{buildroot}%{_sysconfdir}/ssl/imap/ # mailsubdir cat > %{buildroot}%{_sysconfdir}/c-client.cf <<EOF I accept the risk of using UW-imapd set mail-subdirectory %mailsubdir EOF # OE: 20040614 provide stuff for php install -m0755 lib%{soname}.so.%{major} %{buildroot}%{_libdir}/ ln -snf lib%{soname}.so.%{major} %{buildroot}%{_libdir}/lib%{soname}.so install -m0755 %{soname}.a %{buildroot}%{_libdir}/lib%{soname}.a %post # If no cert, migrate stunnel.pem, or generate a new cert pushd %{_sysconfdir}/ssl/imap &> /dev/null || : for CERT in imapsd.pem ipop3sd.pem ;do if [ ! -e $CERT ];then if [ -e stunnel.pem ];then cp stunnel.pem $CERT &> /dev/null || : elif [ -e Makefile.imap ];then make -f Makefile.imap $CERT << EOF &> /dev/null || : -- SomeState SomeCity SomeOrganization SomeOrganizationalUnit localhost.localdomain root@localhost.localdomain EOF fi fi done popd &> /dev/null || : [ -x /etc/init.d/xinetd ] && /etc/init.d/xinetd condrestart 2>/dev/null >/dev/null exit 0 %postun [ -x /etc/init.d/xinetd ] && /etc/init.d/xinetd condrestart 2>/dev/null >/dev/null exit 0 %triggerpostun -- imap < 1:2002d-6mdk if [ -r %{_sysconfdir}/c-client.cf ]; then if grep -q "^set mail-subdirectory %mailsubdir" %{_sysconfdir}/c-client.cf; then perl -pi -e 's/^set mail-subdirectory/\#set mail-subdirectory/g' \ %{_sysconfdir}/c-client.cf fi fi %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %files %defattr(-,root,root) %config(noreplace) %{_sysconfdir}/xinetd.d/ipop2 %config(noreplace) %{_sysconfdir}/xinetd.d/ipop3 %config(noreplace) %{_sysconfdir}/xinetd.d/pop3s %config(noreplace) %{_sysconfdir}/xinetd.d/imap %config(noreplace) %{_sysconfdir}/xinetd.d/imaps %config(noreplace) %{_sysconfdir}/pam.d/imap %config(noreplace) %{_sysconfdir}/pam.d/pop %dir %{_sysconfdir}/ssl/imap %attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_sysconfdir}/ssl/imap/*.pem %{_sysconfdir}/ssl/imap/Makefile.imap %dir %{_localstatedir}/imap %{_localstatedir}/imap/ssl/Makefile.imap %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/c-client.cf %{_mandir}/man8/ipopd.8* %{_mandir}/man8/imapd.8* %attr(0755,root,mail) %{_sbindir}/ipop2d %attr(0755,root,mail) %{_sbindir}/ipop3d %attr(0755,root,mail) %{_sbindir}/ipop3sd %attr(0755,root,mail) %{_sbindir}/imapd %attr(0755,root,mail) %{_sbindir}/imapsd %doc CONTENTS LICENSE.txt NOTICE README SUPPORT %doc `find docs -type f | grep -v internal.txt` %files utils %defattr(-,root,root) %attr(0755,root,root) %{_bindir}/chkmail %attr(0755,root,root) %{_bindir}/dmail %attr(0755,root,root) %{_bindir}/icat %attr(0755,root,root) %{_bindir}/ifrom %attr(0755,root,root) %{_bindir}/imapcopy %attr(0755,root,root) %{_bindir}/imapmove %attr(0755,root,root) %{_bindir}/imapxfer %attr(0755,root,root) %{_bindir}/mbxcopy %attr(0755,root,root) %{_bindir}/mbxmove %attr(0755,root,root) %{_bindir}/mbxcreat %attr(0755,root,root) %{_bindir}/mbxcvt %attr(0755,root,root) %{_bindir}/tmail %attr(0644,root,root) %{_mandir}/man1/chkmail.1* %attr(0644,root,root) %{_mandir}/man1/dmail.1* %attr(0644,root,root) %{_mandir}/man1/icat.1* %attr(0644,root,root) %{_mandir}/man1/ifrom.1* %attr(0644,root,root) %{_mandir}/man1/imapcopy.1* %attr(0644,root,root) %{_mandir}/man1/imapxfer.1* %attr(0644,root,root) %{_mandir}/man1/mbxcopy.1* %attr(0644,root,root) %{_mandir}/man1/mbxcreat.1* %attr(0644,root,root) %{_mandir}/man1/mbxcvt.1* %attr(0644,root,root) %{_mandir}/man1/tmail.1* %files devel %defattr(-,root,root) %doc docs/internal.txt %{_libdir}/libc-client.a %{_libdir}/libc-client-nossl.a %{_includedir}/imap %files -n %{libname} %defattr(-,root,root) %{_libdir}/lib%{soname}.so.* %files -n %{develname} %defattr(-,root,root) %{_libdir}/lib%{soname}.a %{_libdir}/lib%{soname}.so %changelog * Mon Aug 06 2007 Oden Eriksson <oeriksson@mandriva.com> 2006j-1mdv2008.0 + Revision: 59326 - fix rpmlint upload blockers - 2006j - obey new devel naming specs * Fri Jun 22 2007 Andreas Hasenack <andreas@mandriva.com> 1:2006i-2mdv2008.0 + Revision: 43197 - use serverbuild macro * Thu Jun 21 2007 Oden Eriksson <oeriksson@mandriva.com> 1:2006i-1mdv2008.0 + Revision: 42301 - 2006i - drop the version patch (P7) as it is quite useless * Thu May 10 2007 Oden Eriksson <oeriksson@mandriva.com> 1:2006h-1mdv2008.0 + Revision: 26081 - 2006h - rediffed some patches - removed obsolete patches - added one patch to skip the y/n prompt * Thu Nov 23 2006 Andreas Hasenack <andreas@mandriva.com> 2006c1-2mdv2007.0 + Revision: 86682 - drop USERID from xinetd (#27278) - drop svn warning from spec file * Fri Oct 27 2006 Oden Eriksson <oeriksson@mandriva.com> 1:2006c1-1mdv2007.1 + Revision: 73101 - 2006c1 - new license BSD/Apache License - rediffed patches; P1,P5,P7,P9,P11,P17,P23 * Sun Aug 13 2006 Oden Eriksson <oeriksson@mandriva.com> 1:2004g-2mdv2007.0 + Revision: 55717 - correct the pam file generation - fix a possible symbol clash with mysql * Tue Aug 08 2006 Andreas Hasenack <andreas@mandriva.com> 1:2004g-1mdv2007.0 + Revision: 54213 - ops, 200700 and not 20070 in mkdversion comparison - updated to version 2004g (using pristine version: .Z) - removed CAN-2005-2933 security patch, already fixed - bunzipped rest of bzipped source files - build pam file according to version of the distribution - using mdv instead of mdk in the version patch which marks this as a modified version of the software - import imap-2004e-3mdk * Sun Nov 13 2005 Oden Eriksson <oeriksson@mandriva.com> 2004e-3mdk - rebuilt against openssl-0.9.8a * Tue Oct 25 2005 Oden Eriksson <oeriksson@mandriva.com> 1:2004e-2mdk - security update for CAN-2205-2933 (P24) * Thu Jul 07 2005 Oden Eriksson <oeriksson@mandriva.com> 1:2004e-1mdk - 2004e - added rediffed P23 from the openpkg kolab2 packages * Fri Jun 10 2005 Buchan Milne <bgmilne@linux-mandrake.com> 2004d-2mdk - Rebuild for libkrb53-devel 1.4.1 * Mon May 30 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1:2004d-1mdk - 2004d - rediffed P1 * Thu Feb 17 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1:2004c1-2mdk - fix xinetd deps (#13716) * Sun Feb 13 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1:2004c1-1mdk - 2004c1 (maintenance release) - rediffed P7 - drop P30, the vu-702777 fix is included upstream - added some ssl related build stuff after looking at the new lmd build option * Sat Feb 12 2005 Stew Benedict <sbenedict@mandrakesoft.com> 1:2004a-2mdk - security update for CERT VU#702777 (p30) - rpmlint: o drop unused patch, dot in summary o requires-release, incoherant version, - drop compatibility defines for ancient distro releases * Tue Nov 09 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2004a-1mdk - 2004a (maintenance release) - rediffed P7 * Fri Oct 22 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2004-2mdk - use -D_REENTRANT -DDIC, seems to fix amd64 build (joeghi) - fix P21 (joeghi) * Thu Jun 17 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2004-1mdk - 2004 - enabled ipv6 support - fixed P1, P5, P7, P9 - drop pointless P10 - disable pam in the shared c-client lib, pretty pointless for a php-imap client... * Wed Jun 16 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2002e-1mdk - 2002e - provide shared c-client libs as well * Mon Dec 29 2003 Stew Benedict <sbenedict@mandrakesoft.com> 2002d-8mdk - msec/ipop3d conflict with mailbox permissions [Bug 6617] - Patch17 - some file re-arranging to make rpmlint happier