uw-imap-vl.spec 14 KB

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