Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > main-src > by-pkgid > 9e30fe525c7b02346a2a07d3abee3317 > files > 17

imap-2001a-4mdk.src.rpm

%define version		2001a
%define fversion	2001a
%define release		4mdk
%define fname		imap

%define	with_krb	1
%define	name		uw-imap
%define	renamed_uw	1

%define	build_82	1
%define	build_prior_82	0

# in 8.2 and upper ssl certs are in %_libdir/ssl/cert
# in 8.1 and previous ssl certs are in %_sharedir/ssl/cert
# define build_prior_8.2 to 1 if needed to build for Mandrake 7.2, 8.0, 8.1.
%if %build_prior_82
%define	name		imap
%define	renamed_uw	0
%define	with_krb	0
%endif

%if %build_82
%define name            imap
%define	renamed_uw	0
%define with_krb        1
%endif

Summary:	Server daemons for IMAP and POP network mail protocols.
Name:		%{fname}
Version:	%{version}
Release:	%{release}
License:	BSD
Group:		System/Servers
Source:		ftp://ftp.cac.washington.edu/mail/imap-%{fversion}.tar.bz2
Source1:	imap.pamd
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.bz2

Patch0: 	imap-2001a-ssl.patch.bz2
Patch1: 	imap-2000-linux.patch.bz2
Patch2: 	imap-2000-vfs.patch.bz2
Patch3:		imap-2001a-disable-mbox.patch.bz2
Patch4:		imap-2001a-redhat.patch.bz2
Patch5: 	imap-2000c-flock.patch.bz2
Patch7: 	imap-2001a-version.patch.bz2
Patch8: 	imap-2001a-pine-4.30-boguswarning.patch.bz2
Patch9:		imap-2000-glibc-2.2.2.patch.bz2
Patch10:	imap-2001a-ssldocs.patch.bz2
Patch11:	imap-2000-krbpath.patch.bz2

Buildroot:	%{_tmppath}/%{name}-buildroot
Requires:	pam >= 0.59
BuildPreReq:	openssl-devel
%if %{with_krb}
BuildPreReq:	krb5-devel
%endif
BuildRequires:	pam-devel
Url:		http://www.washington.edu/imap/
Epoch:		1
Conflicts:	cyrus-imapd

%if %{renamed_uw}
Provides:	imap = %version-%release
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
Requires:	%name = %version-%release
%if %{renamed_uw}
Provides:       imap-devel = %version-%release
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.

%prep

%setup -q -n %{fname}-%{fversion}
%patch0 -p1 -b .ssl
%patch1 -p1 -b .linxu
#%patch2 -p1 -b .vfs
%patch3 -p1 -b .mbox
%patch4 -p1 -b .redhat
%patch5 -p1 -b .flock
%patch7 -p1 -b .version
%patch8 -p1 -b .boguswarning
cp %{SOURCE7} src/osdep/unix/
%patch9 -p1 -b .glibc
%patch10 -p1
%if %with_krb
%patch11 -p1 -b .gssapi-patch
%endif

%build
EXTRACFLAGS="$EXTRACFLAGS -I%_includedir/openssl"
%if %with_krb
EXTRACFLAGS="$EXTRACFLAGS -I%_includedir/krb5"
%endif
EXTRALDFLAGS="$EXTRALDFLAGS -L%_libdir"

%make RPM_OPT_FLAGS="%optflags -fPIC -fno-omit-frame-pointer" lnp \
	EXTRACFLAGS="$EXTRACFLAGS" \
	EXTRALDFLAGS="$EXTRALDFLAGS" \
%if %{with_krb}
	EXTRAAUTHENTICATORS=gss \
%endif
	SSLTYPE=unix

mv -f ./ipopd/ipop3d ipop3sd
mv -f ./imapd/imapd imapsd
mv -f ./c-client/c-client.a c-client-ssl.a

make clean
# rebuild without SSL support to allow using of different (imapd/imapsd, ipop3d/ipop3sd)
# libwrapper entries.
%make RPM_OPT_FLAGS="%optflags -fPIC -fno-omit-frame-pointer" lnp EXTRACFLAGS="$EXTRACFLAGS"
cp -p ./c-client/c-client.a c-client-nossl.a

%install
rm -rf %buildroot

mkdir -p %buildroot/%_mandir/man8
install -m 644 ./src/ipopd/ipopd.8c %buildroot/%{_mandir}/man8/ipopd.8c
install -m 644 ./src/imapd/imapd.8c %buildroot/%{_mandir}/man8/imapd.8c

mkdir -p %buildroot/%_sbindir
install -s -m 755 ./ipopd/ipop2d %buildroot/%_sbindir
install -s -m 755 ./ipopd/ipop3d %buildroot/%_sbindir
install -s -m 755 ./imapd/imapd %buildroot/%_sbindir
install -s -m 755 ./ipop3sd %buildroot/%_sbindir
install -s -m 755 ./imapsd %buildroot/%_sbindir

mkdir -p %buildroot/%_sysconfdir/pam.d
install -m 644 ${RPM_SOURCE_DIR}/imap.pamd %buildroot/%_sysconfdir/pam.d/imap
install -m 644 ${RPM_SOURCE_DIR}/imap.pamd %buildroot/%_sysconfdir/pam.d/pop

mkdir -p %buildroot/%_libdir
#install -m 755 c-client/libimap.so.%{version} $RPM_BUILD_ROOT/usr/lib
#ln -s libimap.so.%{version} $RPM_BUILD_ROOT/usr/lib/libimap.so.4
#ln -s libimap.so.%{version} $RPM_BUILD_ROOT/usr/lib/libimap.so

#devel
mkdir -p %buildroot/%_includedir/imap
install -m 644 ./c-client/*.h %buildroot/%_includedir/imap
install -m 644 c-client-nossl.a %buildroot/%_libdir/libc-client-nossl.a
install -m 644 c-client-ssl.a %buildroot/%_libdir/libc-client.a
install -m 644 ./src/osdep/tops-20/shortsym.h %buildroot/%_includedir/imap
 # rh - Added linkage.c to fix (#34658) <mharris>
install -m 644 ./c-client/linkage.c %buildroot/%_includedir/imap


#xinetd
install -D -m644 %{SOURCE2} %buildroot/%_sysconfdir/xinetd.d/imap
install -D -m644 %{SOURCE3} %buildroot/%_sysconfdir/xinetd.d/ipop3
install -D -m644 %{SOURCE4} %buildroot/%_sysconfdir/xinetd.d/ipop2
install -D -m644 %{SOURCE5} %buildroot/%_sysconfdir/xinetd.d/imaps
install -D -m644 %{SOURCE6} %buildroot/%_sysconfdir/xinetd.d/pop3s

# SSL support
  # Generate ghost *.pem files
mkdir -p %buildroot/%{_libdir}/ssl/certs
touch %buildroot/%{_libdir}/ssl/certs/{imapsd,ipop3sd}.pem
chmod 600 %buildroot/%{_libdir}/ssl/certs/{imapsd,ipop3sd}.pem
  # install the RedHat Makefile
bzcat %{SOURCE8} > %buildroot/%{_libdir}/ssl/certs/Makefile.imap

%clean
rm -rf %buildroot

%post
# If no cert, migrate stunnel.pem, or generate a new cert
pushd %{_libdir}/ssl/certs &> /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

%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
%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{_libdir}/ssl/certs/*.pem
%{_libdir}/ssl/certs/Makefile.imap
%{_mandir}/man8/ipopd.8c*
%{_mandir}/man8/imapd.8c*
#/usr/lib/libimap.so*
%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 README CPYRIGHT
%doc docs/*

%files devel
%defattr(-,root,root)
%_includedir/imap
%_libdir/libc-client.a
%_libdir/libc-client-nossl.a

%changelog
* Sat Mar 16 2002 Yves Duret <yduret@mandrakesoft.com> 2001a-4mdk
- fix ssl stuf thx Oden Eriksson <oden.eriksson@kvikkjokk.net>:
  changed patch0 that the SSLCERTS dir is /usr/lib/ssl/certs
  these was pointed out by Stefan van der Eijk <stefan@eijk.nu>
- doc/SSLBUILD is updated according new ssl place (adapated patch10)
- redone conditional build (krb, name..)

* Wed Mar 13 2002 Yves Duret <yduret@mandrakesoft.com> 2001a-3mdk
- removed imap-2000c-security.patch, and imap-2000c-morefixes.patch as they
  are now integrated in 2001a
- SSL stuff is in %%_libdir/ssl not in %%_sharedir/ssl !!
- generates ssl cert in %%post now (borrowed a Makefile from RedHat openssl)
- added kerebos5 support (conditional build for 7.x 8.0 update)
- adapted patch11 imap-2000-krbpath.patch 
- merged with RedHat config
- from Giuseppe Ghibò <ghibo@mandrakesoft.com> : 
  * renamed libc-client-ssl.a -> libc-client.a, libc-client.a -> libc-client-nossl.a.
  * added Patch to Patch0 from Oden Eriksson <oden.eriksson@kvikkjokk.net>.
  * added missed libc-client-ssl.a in devel package (Oden Eriksson).

* Fri Jan 04 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2001a-2mdk
- renamed to uw-imap.

* Tue Nov 27 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2001a-1mdk
- sync patches with RedHat 2001a-2.
- readapted ssl patch (Patch1) to version 2001a.
- removed Patch2 (-vfs.patch).
- moved Patch3 (-redhat) -> Patch4.
- added Patch3 (-disable-mbox).
- readapted Patch4 (-redhat) to version 2001a: removed IGNORE_LOCK_EACCES_ERROR=1
  (no longer documented in docs/imaprc.txt) from EXTRACFLAGS.
- readapted Patch8 (-pine-bogus...) to version 2001a.
- removed Patch11 (-security), now merged into main tree, and Patch12
- changed flags SPECIALAUTHENTICATORS=ssl to SSLTYPE=unix (needed to build
  with SSL support).

* Mon Jun 18 2001 Stefan van der Eijk <stefan@eijk.nu> 2000c-7mdk
- BuildRequires:	pam-devel

* Fri Jun 02 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 2000c-6mdk
- Fix directory cpio problem, stupid typo (Vincent Myer).

* Fri Jun 01 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 2000c-5mdk
- Really make SSL work by default (Yes I admit that I really suck).

* Wed May 30 2001 Vincent Danen <vdanen@mandrakesoft.com> 2000c-4mdk
- security patches

* Fri May 18 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 2000c-3mdk
- Really make SSL connections work by default.

* Fri May 18 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 2000c-2mdk
- Make pop3s and imaps work by default by installing a defualt certificate,
  ripped shamelessly from the mod_ssl package.
  
* Wed Apr 11 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2000c-1mdk
- updated to version 2000c (bugfixes).
- removed setcred patch (now included).
- removed sparc patch (now included).
- re-adapted -flock and -version patches to release 2000c.

* Tue Mar 15 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2000-6mdk
- build with -fno-omit-frame-pointer for libsafe.
- fixed SSLBUILD docs.

* Wed Mar 14 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2000-5mdk
- renamed ipop3d and imapd with SSL support to ipop3sd and imapsd, so
  that different libwrapper (i.e. /etc/hosts.deny|allow) entries can be
  used (e.g. one can allow remote SSL imapd and allow imap only for
  localhost, e.g. because needed for a WebMailer like horde IMP).

* Sat Mar 03 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2000-4mdk
- fixed a typo in the SPEC file. Now imap2000 really supports
  SSL.
- bzip2 patches.

* Fri Mar 02 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 2000-3mdk
- Adjust version as required by the License.
- Fix glibc-2.2.2 compilation.

* Thu Jan 11 2001 David BAUDENS <baudens@mandrakesoft.com> 2000-2mdk
- Don't apply sparc patch on non sparc archs (so, fix PPC build)
- %%config(noreplace)
- Macros

* Fri Nov 10 2000 Vincent Danen <vdanen@mandrakesoft.com> 2000-1mdk
- 2000
- change -devel description
- include SSL support
- fixed xinetd support for ipop2 (was using ipop3 for ipop2 incorrectly)

* Tue Sep 26 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 4.7c2-4mdk
- Pamstackizification.

* Sat Sep 23 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 4.7c2-3mdk
- Correct xinetd scripts.
- Add xinetd support for imap.

* Sun Sep 17 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 4.7c2-2mdk
- Fix bad link.

* Tue Jul 18 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 4.7c2-1mdk
- BM.
- xinetd support.
- Merge rh patches.
- 4.7c2.
- Clean up sepcs.

* Sun Apr 02 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.7b_virtual-2mdk
- fixed group

* Thu Mar 02 2000 Jean-Michel Dault <jmdault@netrevolution.com> 4.7b_virtual-1mdk
- updated to 4.7b

* Tue Feb 29 2000 Jean-Michel Dault <jmdault@netrevolution.com> 4.7a_virtual-3mdk
- A fix for crashes caused by certain unusual tokens in message headers. 
- updated patch

* Mon Feb 28 2000 Jean-Michel Dault <jmdault@netrevolution.com> 4.7a_virtual-2mdk
- moved docs in main package instead of devel

* Mon Feb 28 2000 Jean-Michel Dault <jmdault@netrevolution.com> 4.7a_virtual-1mdk
- upgraded to 4.7a
- added phall virtual patch for Linuxconf

* Mon Jan  3 2000 Jean-Michel Dault <jmdault@netrevolution.com>
- final cleanup for Mandrake 7

* Wed Dec 31 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- rebuild for Mandrake 7

* Sat Dec 12 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- Took mandrake adaptations (except SMP build) from 4.5-6mdk and updated to
  4.7. Now we have imap-devel
- Merged and re-made patch files

* Thu May 20 1999 Brian Bruns <bruns@magenet.com>
- Built on RH 5.2

* Thu May 20 1999 Henri Gomez <gomez@slib.fr>
- added devel package and libimap support

* Fri May 14 1999 Brian Bruns <bruns@magenet.com>
- Update to IMAP 4.6 beta

* Fri Apr 09 1999 Cristian Gafton <gafton@redhat.com>
- ipop3d service name was changed to "pop" now. Clearly somebody that hasn't
  got a clue about PAM stuff is messing around with the source.

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 2)

* Sat Mar 13 1999 Cristian Gafton <gafton@redhat.com>
- verson 4.5
- loose the noflock patch

* Thu Dec 17 1998 Cristian Gafton <gafton@redhat.com>
- added a -vfs patch because sys/statvfs on glibc 2.1 is different from what
  is available on the sun...
- build against glibc 2.1

* Fri Sep 11 1998 Jeff Johnson <jbj@redhat.com>
- use only fcntl locking.

* Thu Sep 10 1998 Jeff Johnson <jbj@redhat.com>
- update to 4.4.
- removed g+s bit to imapd.

* Wed Jul 22 1998 Jeff Johnson <jbj@redhat.com>
- updated to 4.2.
- added g+s bit to imapd so that lock files can be created.

* Thu May 07 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Wed Apr 08 1998 Cristian Gafton <gafton@redhat.com>
- Updated to the latest imap as of today...

* Wed Dec 10 1997 Cristian Gafton <gafton@redhat.com>
- Updated to the latest imap as of today...
- Updated the pam patch to reflect the new directory organization

* Thu Oct 23 1997 Michael K. Johnson <johnsonm@redhat.com>
- Fix patch for new PAM spec compliance.

* Thu Oct 02 1997 Michael K. Johnson <johnsonm@redhat.com>
- Comply with change in PAM spec.
- Use a buildroot.

* Mon Mar 03 1997 Michael K. Johnson <johnsonm@redhat.com>
- Moved from pam.conf to pam.d

* Mon Mar 03 1997 Erik Troan <ewt@redhat.com>
- Fixed buffer overrun in server_login().