source: projects/specs/trunk/u/uw-imap/uw-imap-vl.spec @ 10080

Revision 10080, 13.5 KB checked in by tomop, 8 years ago (diff)

uw-imap-2007f-2

Line 
1# Change the default connected directory from the user's home directory
2# to the named subdirectory of the user's home directory
3%define mail_subdirectory      Mail
4
5Summary: UW Server daemons for IMAP and POP network mail protocols
6Summary(ja): IMAP/POP ネットワークメールプロトコル用デーモン
7Name:    uw-imap
8Version: 2007f
9Release: 2%{?_dist_release}
10
11# See LICENSE.txt, http://www.apache.org/licenses/LICENSE-2.0
12License: ASL 2.0
13Group:   System Environment/Daemons
14URL:     http://www.washington.edu/imap/
15# Old (non-latest) releases live at  ftp://ftp.cac.washington.edu/imap/old/
16Source0: ftp://ftp.cac.washington.edu/imap/imap-%{version}.tar.gz
17BuildRoot: %{_tmppath}/%{name}-%{version}-root
18
19%define soname    c-client
20%define somajor   2007
21%define shlibname lib%{soname}.so.%{somajor}
22%define imap_libs lib%{soname}
23
24# FC4+ uses %%_sysconfdir/pki/tls/certs, previous releases used %%_datadir/ssl/certs
25%define sslcerts  %{expand:%(if [ -d %{_sysconfdir}/pki/tls/certs ]; then echo "%{_sysconfdir}/pki/tls/certs"; else echo "%{_datadir}/ssl/certs"; fi)}
26
27# imap -> uw-imap rename
28Obsoletes: imap < 1:%{version}
29
30Source10: c-client.cf
31
32# new pam setup, using new "include" feature
33Source21: imap.pam
34# legacy/old pam setup, using pam_stack.so
35Source22: imap-legacy.pam
36
37Source31: imap-xinetd
38Source32: imaps-xinetd
39Source33: ipop2-xinetd
40Source34: ipop3-xinetd
41Source35: pop3s-xinetd
42
43Patch1: imap-2007-paths.patch
44# See http://bugzilla.redhat.com/229781 , http://bugzilla.redhat.com/127271
45Patch2: imap-2004a-doc.patch
46Patch5: imap-2001a-overflow.patch
47Patch9: imap-2002e-shared.patch
48Patch10: imap-2002e-authmd5.patch
49Patch11: imap-2007e-system_c_client.patch
50Patch12: imap-2007f-format-security.patch
51
52BuildRequires: openssl-devel
53BuildRequires: pam-devel
54BuildRequires: krb5-devel
55
56# Prereq is shorter than separate Requires, Requires(post), Requires(postun)
57Requires(pre): xinetd
58Requires(post): openssl
59Requires: %{imap_libs} = %{version}-%{release}
60
61%description
62The %{name} package provides UW server daemons for both the IMAP (Internet
63Message Access Protocol) and POP (Post Office Protocol) mail access
64protocols.  The POP protocol uses a "post office" machine to collect
65mail for users and allows users to download their mail to their local
66machine for reading. The IMAP protocol allows a user to read mail on a
67remote machine without downloading it to their local machine.
68
69%package -n %{imap_libs}
70Summary: UW C-client mail library
71Summary(ja): UW メールライブラリ
72Group:   System Environment/Libraries
73Obsoletes: libc-client2004d < 1:2004d-2
74Obsoletes: libc-client2004e < 2004e-2
75Obsoletes: libc-client2004g < 2004g-7
76Obsoletes: libc-client2006 < 2006k-2
77
78%description -n %{imap_libs}
79Provides a common API for accessing mailboxes.
80
81%package devel
82Summary: Development tools for programs which will use the UW IMAP library
83Group:   Development/Libraries
84Requires: %{imap_libs} = %{version}-%{release}
85# imap -> uw-imap rename
86Obsoletes: imap-devel < 1:%{version}
87Provides: imap-devel < 1:%{version}
88Conflicts: libc-client-devel
89
90%description devel
91Contains the header files and static libraries for developing programs
92which will use the UW C-client common API.
93
94%package utils
95Summary: UW IMAP Utilities to make managing your email simpler
96Group:   Applications/Internet
97# imap -> uw-imap rename
98Obsoletes: imap-utils < 1:%{version}
99
100%description utils
101This package contains some utilities for managing UW IMAP email,including:
102* dmail : procmail Mail Delivery Module
103* mailutil : mail utility program
104* mtest : C client test program
105* tmail : Mail Delivery Module
106* mlock
107
108
109%prep
110%setup -q -n imap-%{version}
111%patch1 -p1 -b .paths
112%patch2 -p1 -b .doc
113
114%patch5 -p1 -b .overflow
115
116%patch9 -p1 -b .shared
117%patch10 -p1 -b .authmd5
118
119#if 0%{?fedora} > 4 || 0%{?rhel} > 4
120install -p -m644 %{SOURCE21} imap.pam
121#else
122#install -p -m644 %{SOURCE22} imap.pam
123#endif
124
125%build
126# Kerberos setup
127test -f %{_sysconfdir}/profile.d/krb5-devel.sh && source %{_sysconfdir}/profile.d/krb5-devel.sh
128test -f %{_sysconfdir}/profile.d/krb5.sh && source %{_sysconfdir}/profile.d/krb5.sh
129GSSDIR=$(krb5-config --prefix)
130
131# SSL setup, probably legacy-only, but shouldn't hurt -- Rex
132export EXTRACFLAGS="$EXTRACFLAGS $(pkg-config --cflags openssl 2>/dev/null)"
133# $RPM_OPT_FLAGS
134export EXTRACFLAGS="$EXTRACFLAGS $RPM_OPT_FLAGS"
135# jorton added these, I'll assume he knows what he's doing. :) -- Rex
136export EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing"
137export EXTRACFLAGS="$EXTRACFLAGS -Wno-pointer-sign"
138
139echo "y" | \
140make %{?_smp_mflags} lnp \
141EXTRACFLAGS="$EXTRACFLAGS" \
142EXTRALDFLAGS="$EXTRALDFLAGS" \
143EXTRAAUTHENTICATORS=gss \
144SPECIALS="GSSDIR=${GSSDIR} LOCKPGM=%{_sbindir}/mlock SSLCERTS=%{sslcerts} SSLDIR=%{_datadir}/ssl SSLINCLUDE=%{_includedir}/openssl SSLLIB=%{_libdir}" \
145SSLTYPE=unix \
146CCLIENTLIB=$(pwd)/c-client/%{shlibname} \
147SHLIBBASE=%{soname} \
148SHLIBNAME=%{shlibname}
149# Blank line
150
151
152%install
153rm -rf $RPM_BUILD_ROOT
154
155mkdir -p $RPM_BUILD_ROOT%{_libdir}/
156
157install -p -m644 ./c-client/c-client.a $RPM_BUILD_ROOT%{_libdir}/
158ln -s c-client.a $RPM_BUILD_ROOT%{_libdir}/libc-client.a
159
160install -p -m755 ./c-client/%{shlibname} $RPM_BUILD_ROOT%{_libdir}/
161ln -s %{shlibname} $RPM_BUILD_ROOT%{_libdir}/lib%{soname}.so
162
163mkdir -p $RPM_BUILD_ROOT%{_includedir}/imap/
164install -m644 ./c-client/*.h $RPM_BUILD_ROOT%{_includedir}/imap
165# Added linkage.c to fix (#34658) <mharris>
166install -m644 ./c-client/linkage.c $RPM_BUILD_ROOT%{_includedir}/imap
167install -m644 ./src/osdep/tops-20/shortsym.h $RPM_BUILD_ROOT%{_includedir}/imap
168
169mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8/
170install -p -m644 src/{ipopd/ipopd,imapd/imapd}.8 $RPM_BUILD_ROOT%{_mandir}/man8/
171mkdir -p $RPM_BUILD_ROOT%{_sbindir}
172install -p -m755 ipopd/ipop{2d,3d} $RPM_BUILD_ROOT%{_sbindir}/
173install -p -m755 imapd/imapd $RPM_BUILD_ROOT%{_sbindir}/
174install -p -m755 mlock/mlock $RPM_BUILD_ROOT%{_sbindir}/
175
176mkdir -p $RPM_BUILD_ROOT%{_bindir}/
177install -p -m755 dmail/dmail mailutil/mailutil mtest/mtest tmail/tmail $RPM_BUILD_ROOT%{_bindir}/
178mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
179install -p -m644 src/{dmail/dmail,mailutil/mailutil,tmail/tmail}.1 $RPM_BUILD_ROOT%{_mandir}/man1/
180
181install -p -m644 -D imap.pam $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/imap
182install -p -m644 -D imap.pam $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/pop
183
184install -p -m644 -D %{SOURCE31} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/imap
185install -p -m644 -D %{SOURCE32} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/imaps
186install -p -m644 -D %{SOURCE33} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/ipop2
187install -p -m644 -D %{SOURCE34} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/ipop3
188install -p -m644 -D %{SOURCE35} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/pop3s
189
190# Generate ghost *.pem files
191mkdir -p $RPM_BUILD_ROOT%{sslcerts}/
192touch $RPM_BUILD_ROOT%{sslcerts}/{imapd,ipop3d}.pem
193
194# c-client.cf
195touch $RPM_BUILD_ROOT%{_sysconfdir}/c-client.cf
196
197# FIXME, do this on daemon startup -- Rex
198%post
199{
200cd %{sslcerts} &> /dev/null || :
201for CERT in imapd.pem ipop3d.pem ;do
202   if [ ! -e $CERT ];then
203      if [ -e stunnel.pem ];then
204         cp stunnel.pem $CERT &> /dev/null || :
205      elif [ -e Makefile ];then
206         make $CERT << EOF &> /dev/null || :
207--
208SomeState
209SomeCity
210SomeOrganization
211SomeOrganizationalUnit
212localhost.localdomain
213root@localhost.localdomain
214EOF
215      fi
216   fi
217done
218} || :
219/sbin/service xinetd reload > /dev/null 2>&1 || :
220
221%postun
222/sbin/service xinetd reload > /dev/null 2>&1 || :
223
224%post -n %{imap_libs} -p /sbin/ldconfig
225
226%postun -n %{imap_libs} -p /sbin/ldconfig
227
228%triggerpostun -- imap < 1:2004
229#if upgrading from old version, don't change/set (default) MailDir
230if [ -f %{_sysconfdir}/c-client.cf ]; then
231  if grep -q "^set mail-subdirectory %{mail_subdirectory}" %{_sysconfdir}/c-client.cf; then
232    sed -i -e 's/^set mail-subdirectory/\#set mail-subdirectory/g' \
233      %{_sysconfdir}/c-client.cf
234  fi
235fi
236
237%clean
238rm -rf $RPM_BUILD_ROOT
239
240
241%files
242%defattr(-,root,root)
243%doc docs/SSLBUILD
244%config %{_sysconfdir}/pam.d/imap
245%config %{_sysconfdir}/pam.d/pop
246%config(noreplace) %{_sysconfdir}/xinetd.d/imap
247%config(noreplace) %{_sysconfdir}/xinetd.d/ipop2
248%config(noreplace) %{_sysconfdir}/xinetd.d/ipop3
249# These need to be replaced (ie, can't use %%noreplace), or imaps/pop3s will fail after an upgrade
250%config %{_sysconfdir}/xinetd.d/imaps
251%config %{_sysconfdir}/xinetd.d/pop3s
252%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{sslcerts}/imapd.pem
253%attr(0600,root,root) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{sslcerts}/ipop3d.pem
254%config(noreplace) %{_sysconfdir}/c-client.cf
255%{_mandir}/man8/*
256%{_sbindir}/ipop2d
257%{_sbindir}/ipop3d
258%{_sbindir}/imapd
259
260%files utils
261%defattr(-,root,root)
262%{_bindir}/*
263%attr(2755, root, mail) %{_sbindir}/mlock
264%{_mandir}/man1/*
265
266%files -n %{imap_libs}
267%defattr(-,root,root)
268%doc docs/RELNOTES docs/*.txt
269%{_libdir}/lib%{soname}.so.*
270
271%files devel
272%defattr(-,root,root)
273%{_includedir}/imap/
274%{_libdir}/c-client.a
275%{_libdir}/libc-client.a
276%{_libdir}/lib%{soname}.so
277
278
279%changelog
280* Tue Mar 15 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2007f-2
281- rebuilt with openssl-1.0.2g.
282
283* Thu Jun 25 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2007f-1
284- new upstream release.
285- added Patch11 and Patch12.
286
287* Sat Mar 26 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2007e-3
288- rebuilt with openssl-1.0.0d and krb5-libs-1.8.2
289
290* Sun Feb 06 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2007e-2
291- rebuild with openssl-1.0.0c
292
293* Sat May 16 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2007e-1
294- new upstream release
295- built with krb5-devel (VineSeed)
296
297* Sun Sep 07 2008 Shu KONNO <owa@bg.wakwak.com> 2006b-2vl5
298- applied new versioning policy, spec in utf-8
299
300* Sat Jun  2 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2006b-1vl2
301- rebuilt with new toolchain
302
303* Fri Oct 20 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2006b-1vl1
304- updated to 2006b based on Fedora development
305
306* Mon May 29 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2004g-4vl2
307- changed package name
308
309* Wed Mar 15 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2004g-4vl1
310- rebuilt for Vine Linux
311
312* Wed Mar 1 2006 Rex Dieter <rexdieter[AT]users.sf.net>
313- fc5: gcc/glibc respin
314
315* Thu Nov 17 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-4
316- use pam's "include" feature on fc5
317- cleanup %%doc handling, remove useless bits
318
319* Thu Nov 17 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-3
320- omit trailing whitespace in default c-client.cf
321
322* Wed Nov 16 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-2
323- rebuild for new openssl
324
325* Mon Sep 26 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004g-1
326- imap-2004g
327- /etc -> %%_sysconfdir
328- use %%{?_smp_mflags}
329
330* Mon Aug 15 2005 Rex Dieter <rexdieter[AT]users.sf.net> 2004e-1
331- imap-2004e
332- rename: imap -> uw-imap (yay, we get to drop the Epoch)
333- sslcerts=%{_sysconfdir}/pki/tls/certs if exists, else /usr/share/ssl/certs
334
335* Fri Apr 29 2005 Rex Dieter <rexdieter[AT]users.sf.net> 1:2004d-1
336- 2004d
337- imap-libs -> lib%%{soname}%%{version} (ie, libc-client2004d), so we can
338  have multiple versions (shared-lib only) installed
339- move mlock to -utils.
340- revert RFC2301, locks out too many folks where SSL is unavailable
341
342* Thu Apr 28 2005 Rex Dieter <rexdieter[AT]users.sf.net> 1:2004-0.fdr.11.c1
343- change default driver from mbox to mbx
344- comply with RFC 3501 security: Unencrypted plaintext passwords are prohibited
345
346* Fri Jan 28 2005 Rex Dieter <rexdieter[AT]users.sf.net> 1:2004-0.fdr.10.c1
347- imap-2004c1 security release:
348  http://www.kb.cert.org/vuls/id/702777
349
350* Thu Jan 20 2005 Rex Dieter <rexdieter[AT]users.sf.net> 1:2004-0.fdr.9.c
351- imap2004c
352- -utils: dmail,mailutil,tmail
353- -libs: include mlock (so it's available for other imap clients, like pine)
354- remove extraneous patches
355- %%_sysconfigdir/c-client.cf: use to set MailDir (but don't if upgrading from
356  an older version (ie, if folks don't want/expect a change in behavior)
357
358* Mon Sep 13 2004 Rex Dieter <rexdieter at sf.net. 1:2004-0.fdr.8.a
359- don't use mailsubdir patch (for now)
360
361* Wed Aug 11 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.7.a
362- mailsubdir patch (default to ~/Mail instead of ~)
363
364* Fri Jul 23 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.6.a
365- remove Obsoletes/Provides: libc-client (they can, in fact, co-xist)
366- -devel: remove O/P: libc-client-devel -> Conflicts: libc-client-devel
367
368* Fri Jul 16 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.5.a
369- imap2004a
370
371* Tue Jul 13 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.4
372- -devel: Req: %%{name}-libs
373
374* Tue Jul 13 2004 Rex Dieter <rexdieter at sf.net> 1:2004-0.fdr.3
375- previous imap pkgs had Epoch: 1, we need it too.
376
377* Wed Jul 07 2004 Rex Dieter <rexdieter at sf.net> 2004-0.fdr.2
378- use %%version as %%somajver (like how openssl does it)
379
380* Wed Jul 07 2004 Rex Dieter <rexdieter at sf.net> 2004-0.fdr.1
381- imap-2004
382- use mlock, if available.
383- Since libc-client is an attrocious name choice, we'll trump it,
384  and provide imap, imap-libs, imap-devel instead (redhat bug #120873)
385
386* Wed Apr 07 2004 Kaj J. Niemi <kajtzu@fi.basen.net> 2002e-4
387- Use CFLAGS (and RPM_OPT_FLAGS) during the compilation
388- Build the .so through gcc instead of directly calling ld
389
390* Fri Mar  5 2004 Joe Orton <jorton@redhat.com> 2002e-3
391- install .so with permissions 0755
392- make auth_md5.c functions static to avoid symbol conflicts
393- remove Epoch: 0
394
395* Tue Mar 02 2004 Kaj J. Niemi <kajtzu@fi.basen.net> 0:2002e-2
396- "lnp" already uses RPM_OPT_FLAGS
397- have us conflict with imap, imap-devel
398
399* Tue Mar  2 2004 Joe Orton <jorton@redhat.com> 0:2002e-1
400- add post/postun, always use -fPIC
401
402* Tue Feb 24 2004 Kaj J. Niemi <kajtzu@fi.basen.net>
403- Name change from c-client to libc-client
404
405* Sat Feb 14 2004 Kaj J. Niemi <kajtzu@fi.basen.net> 0:2002e-0.1
406- c-client 2002e is based on imap-2002d
407- Build shared version, build logic is copied from FreeBSD net/cclient
408
Note: See TracBrowser for help on using the repository browser.