imap.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ##
  2. ## imap.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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_real 2006c
  26. %define V_here 2006c
  27. # package information
  28. Name: imap
  29. Summary: The IMAP Library
  30. URL: http://www.washington.edu/imap/
  31. Vendor: University of Washington
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: BASE
  35. Group: Mail
  36. License: University of Washington's Free-Fork License
  37. Version: %{V_here}
  38. Release: 20061024
  39. # package options
  40. %option with_ssl yes
  41. %option with_pam no
  42. %option with_daemons no
  43. %option with_mbxdef no
  44. # list of sources
  45. Source0: ftp://ftp.cac.washington.edu/imap/imap-%{V_real}.tar.Z
  46. Patch0: imap.patch
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
  51. PreReq: OpenPKG, openpkg >= 20040130
  52. %if "%{with_pam}" == "yes"
  53. BuildPreReq: PAM
  54. PreReq: PAM
  55. %endif
  56. %if "%{with_ssl}" == "yes"
  57. BuildPreReq: openssl
  58. PreReq: openssl
  59. %endif
  60. AutoReq: no
  61. AutoReqProv: no
  62. %if "%{with_daemons}" == "yes"
  63. Conflicts: imaputils
  64. %endif
  65. %description
  66. The IMAP library provides a C API for IMAP client access.
  67. It optionally contains the UW IMAP/POP3 daemons, too.
  68. %track
  69. prog imap = {
  70. version = %{V_real}
  71. url = ftp://ftp.cac.washington.edu/imap/
  72. regex = imap-(\d+[a-z]?\d?)\.tar\.Z
  73. }
  74. %prep
  75. %setup -q -n imap-%{V_real}
  76. %patch -p0
  77. %build
  78. mflags="%{l_mflags}"
  79. cflags="%{l_cflags}"
  80. ldflags="%{l_ldflags}"
  81. %if "%{with_pam}" == "yes"
  82. case "%{l_platform -t}" in
  83. *-sunos* ) pamtype=pmb ;;
  84. * ) pamtype=pam ;;
  85. esac
  86. mflags="$mflags PASSWDTYPE=$pamtype"
  87. cflags="$cflags -I`%{l_rc} --query pam_incdir`"
  88. ldflags="$ldflags -L`%{l_rc} --query pam_libdir`"
  89. %endif
  90. %if "%{with_mbxdef}" == "yes"
  91. mflags="$mflags CREATEPROTO=mbxproto"
  92. %endif
  93. %if "%{with_ssl}" == "yes"
  94. cflags="%{l_cppflags openssl .} $cflags"
  95. mflags="$mflags SSLDIR=%{l_prefix}/etc/openssl"
  96. %else
  97. mflags="$mflags SSLTYPE=none"
  98. %endif
  99. case "%{l_platform -t}" in
  100. *-freebsd* ) os=bsf ;;
  101. *-linux* ) os=slx ;;
  102. *-sunos* ) os=gso ;;
  103. *-netbsd* ) os=neb ;;
  104. *-irix* ) os=gsg ;;
  105. *) echo "Unsupported platform %{l_platform -t}" 1>&2; exit 1 ;;
  106. esac
  107. mflags="$mflags $os"
  108. %{l_make} $mflags \
  109. EXTRACFLAGS="$cflags" \
  110. EXTRALDFLAGS="$ldflags"
  111. %install
  112. rm -rf $RPM_BUILD_ROOT
  113. %{l_shtool} mkdir -f -p -m 755 \
  114. $RPM_BUILD_ROOT%{l_prefix}/include/imap \
  115. $RPM_BUILD_ROOT%{l_prefix}/lib
  116. %{l_shtool} install -c -m 644 \
  117. c-client/*.h \
  118. c-client/linkage.c \
  119. $RPM_BUILD_ROOT%{l_prefix}/include/imap/
  120. rm -f $RPM_BUILD_ROOT%{l_prefix}/include/imap/os_*.h
  121. %{l_shtool} install -c -m 644 c-client/c-client.a \
  122. $RPM_BUILD_ROOT%{l_prefix}/lib/libimap.a
  123. %if "%{with_daemons}" == "yes"
  124. %{l_shtool} mkdir -f -p -m 755 \
  125. $RPM_BUILD_ROOT%{l_prefix}/bin \
  126. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  127. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  128. $RPM_BUILD_ROOT%{l_prefix}/man/man8
  129. %{l_shtool} install -c -m 755 \
  130. tmail/tmail dmail/dmail mailutil/mailutil \
  131. $RPM_BUILD_ROOT%{l_prefix}/bin/
  132. %{l_shtool} install -c -m 755 \
  133. imapd/imapd ipopd/ipop3d \
  134. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  135. %{l_shtool} install -c -m 644 \
  136. src/tmail/tmail.1 src/dmail/dmail.1 src/mailutil/mailutil.1 \
  137. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  138. %{l_shtool} install -c -m 644 \
  139. src/imapd/imapd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/imapd.8
  140. %{l_shtool} install -c -m 644 \
  141. src/ipopd/ipopd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ipopd.8
  142. %endif
  143. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  144. %files -f files
  145. %clean
  146. rm -rf $RPM_BUILD_ROOT