imapd.spec 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. ##
  2. ## imapd.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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 information
  26. Name: imapd
  27. Summary: Cyrus IMAP Server
  28. URL: http://asg.web.cmu.edu/cyrus/imapd/
  29. Vendor: Carnegie Mellon University
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: Mail
  33. License: BSD
  34. Version: 2.1.12
  35. Release: 20030224
  36. # list of sources
  37. Source0: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-%{version}.tar.gz
  38. Source1: imapd.conf
  39. Source2: rc.imapd
  40. Patch0: imapd.patch
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20020206, sasl, db >= 4.1.24, openssl, make, perl, perl-openpkg
  45. PreReq: OpenPKG, openpkg >= 20020206, sasl, openssl, MTA
  46. AutoReq: no
  47. AutoReqProv: no
  48. Provides: IMAP
  49. %description
  50. The Cyrus IMAP server is an IMAP4 and POP3 daemon that differs from
  51. other IMAP server implementations in that it is generally intended to
  52. be run on sealed servers, where normal users are not permitted to log
  53. in. The mailbox database is stored in parts of the filesystem that are
  54. private to the Cyrus IMAP system. All user access to mail is through
  55. the IMAP, POP3, or KPOP protocols.
  56. %prep
  57. %setup -q -n cyrus-imapd-%{version}
  58. %patch -p0
  59. %build
  60. %{l_shtool} subst -e 's;db-4.1;db;g' configure
  61. cflags="-I%{l_prefix}/include"
  62. ldflags="-L%{l_prefix}/lib"
  63. case "%{l_target}" in
  64. *-solaris* ) ldflags="$ldflags -lsocket -lnsl" ;;
  65. esac
  66. CC="%{l_cc}" \
  67. CPPFLAGS="$cflags" \
  68. CFLAGS="%{l_cflags -O} $cflags" \
  69. LDFLAGS="$ldflags" \
  70. ./configure \
  71. --prefix=%{l_prefix} \
  72. --with-openssl=%{l_prefix} \
  73. --with-dbdir=%{l_prefix} \
  74. --with-sasl=%{l_prefix} \
  75. --with-statedir=%{l_prefix}/var/imapd \
  76. --with-auth=unix \
  77. --without-perl \
  78. --disable-sieve \
  79. --with-cyrus-prefix=%{l_prefix} \
  80. --with-cyrus-user=%{l_musr} \
  81. --with-cyrus-group=%{l_mgrp}
  82. # redirect the hard coded file paths
  83. %{l_shtool} subst -e "s;/etc/\(.*\).conf;%{l_prefix}/etc/imapd/\\1.conf;" \
  84. imap/*.c imap/*.h master/*.c master/*.h
  85. %{l_make} %{l_mflags}
  86. # build (and install) Perl-based administration stuff
  87. %{l_prefix}/bin/perl-openpkg prolog
  88. ( cd perl/imap
  89. export SASL_INC="%{l_cppflags}"
  90. export SASL_LIB="%{l_ldflags} -lsasl2"
  91. export OPENSSL_INC="%{l_cppflags}"
  92. export OPENSSL_LIB="%{l_ldflags} -lssl -lcrypto"
  93. %{l_prefix}/bin/perl-openpkg install )
  94. %install
  95. #rm -rf $RPM_BUILD_ROOT
  96. %{l_make} %{l_mflags} install \
  97. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  98. exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
  99. cyrus_prefix=$RPM_BUILD_ROOT%{l_prefix}
  100. %{l_shtool} mkdir -f -p -m 755 \
  101. $RPM_BUILD_ROOT%{l_prefix}/etc/imapd \
  102. $RPM_BUILD_ROOT%{l_prefix}/var/imapd \
  103. $RPM_BUILD_ROOT%{l_prefix}/var/spool
  104. # offer a sane configuration
  105. cp master/conf/small.conf master/conf/cyrus.conf
  106. %{l_shtool} subst -e "s;/var/imap/socket;%{l_prefix}/var/imapd/socket;g" \
  107. master/conf/cyrus.conf
  108. %{l_shtool} install -c -m 644 \
  109. -e 's;@l_prefix@;%{l_prefix};g' \
  110. -e 's;@l_musr@;%{l_musr};g' \
  111. %{SOURCE imapd.conf} master/conf/cyrus.conf \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/imapd/
  113. # install the run command file
  114. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  115. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  116. -e 's;@l_musr@;%{l_musr};g' -e 's;@l_mgrp@;%{l_mgrp};g' \
  117. %{SOURCE rc.imapd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  118. # use mkimap to create many directories for us
  119. cp $RPM_BUILD_ROOT%{l_prefix}/etc/imapd/imapd.conf imapd.conf.hack
  120. %{l_shtool} subst -e "s;%{l_prefix};$RPM_BUILD_ROOT%{l_prefix};" \
  121. imapd.conf.hack
  122. tools/mkimap imapd.conf.hack
  123. # determine files
  124. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  125. %{l_files_std} \
  126. '%config %{l_prefix}/etc/imapd/imapd.conf' \
  127. '%config %{l_prefix}/etc/imapd/cyrus.conf'
  128. %files -f files
  129. %clean
  130. rm -rf $RPM_BUILD_ROOT