imap.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ##
  2. ## imap.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package version
  25. %define V_here 2006k
  26. %define V_real 2006k
  27. %define V_subdir 2006k
  28. # package information
  29. Name: imap
  30. Summary: The IMAP Library
  31. URL: http://www.washington.edu/imap/
  32. Vendor: University of Washington
  33. Packager: OpenPKG Foundation e.V.
  34. Distribution: OpenPKG Community
  35. Class: BASE
  36. Group: Mail
  37. License: University of Washington's Free-Fork License
  38. Version: %{V_here}
  39. Release: 20071221
  40. # package options
  41. %option with_ssl yes
  42. %option with_pam no
  43. %option with_daemons no
  44. %option with_mbxdef no
  45. %option with_annotate no
  46. # list of sources
  47. # (ping p@rdus.de if the Kolab patches are unavailable for the latest IMAP version)
  48. Source0: ftp://ftp.cac.washington.edu/imap/old/imap-%{V_real}.tar.Z
  49. Patch0: imap.patch
  50. Patch1: http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/patches/imap/KOLAB_imap-c-client_2006j2_Annotations.patch
  51. # build information
  52. Prefix: %{l_prefix}
  53. BuildRoot: %{l_buildroot}
  54. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
  55. PreReq: OpenPKG, openpkg >= 20040130
  56. %if "%{with_pam}" == "yes"
  57. BuildPreReq: PAM
  58. PreReq: PAM
  59. %endif
  60. %if "%{with_ssl}" == "yes"
  61. BuildPreReq: openssl
  62. PreReq: openssl
  63. %endif
  64. AutoReq: no
  65. AutoReqProv: no
  66. %if "%{with_daemons}" == "yes"
  67. Conflicts: imaputils
  68. %endif
  69. %description
  70. The IMAP library provides a C API for IMAP client access.
  71. It optionally contains the UW IMAP/POP3 daemons, too.
  72. %track
  73. prog imap = {
  74. version = %{V_real}
  75. url = ftp://ftp.cac.washington.edu/imap/old/
  76. regex = imap-(\d+[a-z]?\d?)\.tar\.Z
  77. }
  78. %prep
  79. %setup -q -n imap-%{V_subdir}
  80. %patch -p0
  81. %if "%{with_annotate}" == "yes"
  82. %patch -p1 -P 1
  83. %endif
  84. %build
  85. mflags="%{l_mflags}"
  86. cflags="%{l_cflags}"
  87. ldflags="%{l_ldflags}"
  88. %if "%{with_pam}" == "yes"
  89. case "%{l_platform -t}" in
  90. *-sunos* ) pamtype=pmb ;;
  91. * ) pamtype=pam ;;
  92. esac
  93. mflags="$mflags PASSWDTYPE=$pamtype"
  94. cflags="$cflags -I`%{l_rc} --query pam_incdir`"
  95. ldflags="$ldflags -L`%{l_rc} --query pam_libdir`"
  96. %endif
  97. %if "%{with_mbxdef}" == "yes"
  98. mflags="$mflags CREATEPROTO=mbxproto"
  99. %endif
  100. %if "%{with_ssl}" == "yes"
  101. cflags="%{l_cppflags openssl .} $cflags"
  102. mflags="$mflags SSLDIR=%{l_prefix}/etc/openssl"
  103. %else
  104. mflags="$mflags SSLTYPE=none"
  105. %endif
  106. case "%{l_platform -t}" in
  107. *-freebsd* ) os=bsf ;;
  108. *-linux* ) os=slx ;;
  109. *-sunos* ) os=gso ;;
  110. *-netbsd* ) os=neb ;;
  111. *-irix* ) os=gsg ;;
  112. *) echo "Unsupported platform %{l_platform -t}" 1>&2; exit 1 ;;
  113. esac
  114. mflags="$mflags $os"
  115. %{l_make} $mflags \
  116. EXTRACFLAGS="$cflags" \
  117. EXTRALDFLAGS="$ldflags"
  118. %install
  119. rm -rf $RPM_BUILD_ROOT
  120. %{l_shtool} mkdir -f -p -m 755 \
  121. $RPM_BUILD_ROOT%{l_prefix}/include/imap \
  122. $RPM_BUILD_ROOT%{l_prefix}/lib
  123. %{l_shtool} install -c -m 644 \
  124. c-client/*.h \
  125. c-client/linkage.c \
  126. $RPM_BUILD_ROOT%{l_prefix}/include/imap/
  127. rm -f $RPM_BUILD_ROOT%{l_prefix}/include/imap/os_*.h
  128. %{l_shtool} install -c -m 644 c-client/c-client.a \
  129. $RPM_BUILD_ROOT%{l_prefix}/lib/libimap.a
  130. %if "%{with_daemons}" == "yes"
  131. %{l_shtool} mkdir -f -p -m 755 \
  132. $RPM_BUILD_ROOT%{l_prefix}/bin \
  133. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  134. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  135. $RPM_BUILD_ROOT%{l_prefix}/man/man8
  136. %{l_shtool} install -c -m 755 \
  137. tmail/tmail dmail/dmail mailutil/mailutil \
  138. $RPM_BUILD_ROOT%{l_prefix}/bin/
  139. %{l_shtool} install -c -m 755 \
  140. imapd/imapd ipopd/ipop3d \
  141. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  142. %{l_shtool} install -c -m 644 \
  143. src/tmail/tmail.1 src/dmail/dmail.1 src/mailutil/mailutil.1 \
  144. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  145. %{l_shtool} install -c -m 644 \
  146. src/imapd/imapd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/imapd.8
  147. %{l_shtool} install -c -m 644 \
  148. src/ipopd/ipopd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ipopd.8
  149. %endif
  150. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  151. %files -f files
  152. %clean
  153. rm -rf $RPM_BUILD_ROOT