imap.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. ##
  2. ## imap.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_real 2004a
  27. %define V_here 2004a
  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: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: BASE
  36. Group: Mail
  37. License: University of Washington's Free-Fork License
  38. Version: %{V_here}
  39. Release: 20040716
  40. # package options
  41. %option with_ssl yes
  42. %option with_pam no
  43. %option with_daemons no
  44. %option with_mbxdef no
  45. # list of sources
  46. Source0: ftp://ftp.cac.washington.edu/imap/imap-%{V_real}.tar.Z
  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-(__VER__)\.tar\.Z
  73. }
  74. %prep
  75. %setup -q -n imap-%{V_real}
  76. %build
  77. mflags="%{l_mflags}"
  78. cflags="%{l_cflags}"
  79. ldflags="%{l_ldflags}"
  80. %if "%{with_pam}" == "yes"
  81. case "%{l_platform -t}" in
  82. *-sunos* ) pamtype=pmb ;;
  83. * ) pamtype=pam ;;
  84. esac
  85. mflags="$mflags PASSWDTYPE=$pamtype"
  86. cflags="$cflags -I`%{l_prefix}/etc/rc --query pam_incdir`"
  87. ldflags="$ldflags -L`%{l_prefix}/etc/rc --query pam_libdir`"
  88. %endif
  89. %if "%{with_mbxdef}" == "yes"
  90. mflags="$mflags CREATEPROTO=mbxproto"
  91. %endif
  92. %if "%{with_ssl}" == "yes"
  93. cflags="%{l_cppflags openssl .} $cflags"
  94. mflags="$mflags SSLDIR=%{l_prefix}/etc/openssl"
  95. %else
  96. mflags="$mflags SSLTYPE=none"
  97. %endif
  98. case "%{l_platform -t}" in
  99. *-freebsd* ) os=bsf ;;
  100. *-linux* ) os=slx ;;
  101. *-sunos* ) os=gso ;;
  102. *-netbsd* ) os=neb ;;
  103. *-irix* ) os=gsg ;;
  104. *) echo "Unsupported platform %{l_platform -t}" 1>&2; exit 1 ;;
  105. esac
  106. mflags="$mflags $os"
  107. %{l_make} $mflags \
  108. EXTRACFLAGS="$cflags" \
  109. EXTRALDFLAGS="$ldflags"
  110. %install
  111. rm -rf $RPM_BUILD_ROOT
  112. %{l_shtool} mkdir -f -p -m 755 \
  113. $RPM_BUILD_ROOT%{l_prefix}/include/imap \
  114. $RPM_BUILD_ROOT%{l_prefix}/lib
  115. %{l_shtool} install -c -m 644 \
  116. c-client/*.h \
  117. c-client/linkage.c \
  118. $RPM_BUILD_ROOT%{l_prefix}/include/imap/
  119. rm -f $RPM_BUILD_ROOT%{l_prefix}/include/imap/os_*.h
  120. %{l_shtool} install -c -m 644 c-client/c-client.a \
  121. $RPM_BUILD_ROOT%{l_prefix}/lib/libimap.a
  122. %if "%{with_daemons}" == "yes"
  123. %{l_shtool} mkdir -f -p -m 755 \
  124. $RPM_BUILD_ROOT%{l_prefix}/bin \
  125. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  126. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  127. $RPM_BUILD_ROOT%{l_prefix}/man/man8
  128. %{l_shtool} install -c -m 755 \
  129. tmail/tmail dmail/dmail mailutil/mailutil \
  130. $RPM_BUILD_ROOT%{l_prefix}/bin/
  131. %{l_shtool} install -c -m 755 \
  132. imapd/imapd ipopd/ipop3d \
  133. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  134. %{l_shtool} install -c -m 644 \
  135. src/tmail/tmail.1 src/dmail/dmail.1 src/mailutil/mailutil.1 \
  136. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  137. %{l_shtool} install -c -m 644 \
  138. src/imapd/imapd.8c $RPM_BUILD_ROOT%{l_prefix}/man/man8/imapd.8
  139. %{l_shtool} install -c -m 644 \
  140. src/ipopd/ipopd.8c $RPM_BUILD_ROOT%{l_prefix}/man/man8/ipopd.8
  141. %endif
  142. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  143. %files -f files
  144. %clean
  145. rm -rf $RPM_BUILD_ROOT