uw-imap-vl.spec 13 KB

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