mutt.spec 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. ##
  2. ## mutt.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_mutt 1.4.2.1
  27. # package information
  28. Name: mutt
  29. Summary: Mail User Agent
  30. URL: http://www.mutt.org/
  31. Vendor: Michael Elkins
  32. Packager: The OpenPKG Project
  33. Distribution: OpenPKG
  34. Class: BASE
  35. Group: Mail
  36. License: BSD
  37. Version: %{V_mutt}i
  38. Release: 20040917
  39. # build options
  40. %option with_comp no
  41. %option with_nntp no
  42. %option with_initials no
  43. %option with_quote no
  44. %option with_ncurses no
  45. # list of sources
  46. Source0: ftp://ftp.mutt.org/mutt/mutt-%{V_mutt}i.tar.gz
  47. Source1: mailcap
  48. Source2: muttrc
  49. Patch0: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt}/patch-%{V_mutt}.rr.compressed.gz
  50. Patch1: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt}/patch-%{V_mutt}.vvv.nntp.gz
  51. Patch2: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt}/patch-%{V_mutt}.vvv.initials.gz
  52. Patch3: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt}/patch-%{V_mutt}.vvv.quote.gz
  53. # build information
  54. Prefix: %{l_prefix}
  55. BuildRoot: %{l_buildroot}
  56. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  57. PreReq: OpenPKG, openpkg >= 20040130
  58. BuildPreReq: openssl
  59. PreReq: openssl
  60. %if "%{with_ncurses}" == "yes"
  61. BuildPreReq: ncurses
  62. PreReq: ncurses
  63. %else
  64. BuildPreReq: slang
  65. PreReq: slang
  66. %endif
  67. AutoReq: no
  68. AutoReqProv: no
  69. Conflicts: mutt15
  70. %description
  71. Mutt is a small but very powerful text based program for reading
  72. electronic mail under Unix operating systems, including support for
  73. color terminals, MIME, and a threaded sorting mode.
  74. %track
  75. prog mutt = {
  76. version = %{version}
  77. url = ftp://ftp.mutt.org/mutt/
  78. regex = mutt-(__VER__i)\.tar\.gz
  79. }
  80. prog mutt:patch_rr_compressed = {
  81. version = %{V_mutt}
  82. url = ftp://ftp.mutt.org.ua/pub/mutt/
  83. regex = mutt-(1\.4(\.\d+)+)
  84. url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
  85. regex = patch-(__VER__)\.rr\.compressed\.gz
  86. }
  87. prog mutt:patch_vvv_initials = {
  88. version = %{V_mutt}
  89. url = ftp://ftp.mutt.org.ua/pub/mutt/
  90. regex = mutt-(1\.4(\.\d+)+)
  91. url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
  92. regex = patch-(__VER__)\.vvv\.initials\.gz
  93. }
  94. prog mutt:patch_vvv_nntp = {
  95. version = %{V_mutt}
  96. url = ftp://ftp.mutt.org.ua/pub/mutt/
  97. regex = mutt-(1\.4(\.\d+)+)
  98. url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
  99. regex = patch-(__VER__)\.vvv\.nntp\.gz
  100. }
  101. prog mutt:patch_vvv_quote = {
  102. version = %{V_mutt}
  103. url = ftp://ftp.mutt.org.ua/pub/mutt/
  104. regex = mutt-(1\.4(\.\d+)+)
  105. url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
  106. regex = patch-(__VER__)\.vvv\.quote\.gz
  107. }
  108. %prep
  109. %setup -q -n mutt-%{V_mutt}
  110. %if "%{with_comp}" == "yes"
  111. %{l_gzip} -d -c <%{PATCH0} |\
  112. sed -e '/^diff.*Makefile\.am/,/^diff/d' \
  113. -e '/^diff.*configure\.in /,/^diff/d' \
  114. -e '/^diff.*acconfig\.h /,/^diff/d' |\
  115. %{l_patch} -p1
  116. %endif
  117. %if "%{with_nntp}" == "yes"
  118. %{l_gzip} -d -c <%{PATCH1} |\
  119. sed -e '/^diff.*configure\.in /,/^diff/d' \
  120. -e '/^diff.*acconfig\.h /,/^diff/d' |\
  121. %{l_patch} -p1
  122. %endif
  123. %if "%{with_initials}" == "yes"
  124. %patch -p1 -P 2
  125. %endif
  126. %if "%{with_quote}" == "yes"
  127. %patch -p1 -P 3
  128. %endif
  129. %build
  130. # configure for particular platform
  131. echo 'am_cv_func_iconv=no' >config.cache
  132. echo 'ac_cv_header_iconv_h=no' >>config.cache
  133. options=''
  134. case "%{l_platform -t}" in
  135. *-freebsd* ) options="--enable-flock --disable-fcntl" ;;
  136. esac
  137. CC="%{l_cc}" \
  138. CFLAGS="%{l_cflags -O}" \
  139. %if "%{with_ncurses}" == "yes"
  140. CPPFLAGS="%{l_cppflags ncurses .}" \
  141. %else
  142. CPPFLAGS="%{l_cppflags}" \
  143. %endif
  144. LDFLAGS="-Limap %{l_ldflags}" \
  145. ./configure \
  146. --cache-file=./config.cache \
  147. --prefix=%{l_prefix} \
  148. --sysconfdir=%{l_prefix}/etc/mutt \
  149. --with-docdir=%{l_prefix}/share/mutt \
  150. %if "%{with_ncurses}" == "yes"
  151. --with-curses=%{l_prefix} \
  152. %else
  153. --with-slang=%{l_prefix} \
  154. %endif
  155. --with-ssl=%{l_prefix} \
  156. --enable-pop \
  157. --enable-imap \
  158. %if "%{with_comp}" == "yes"
  159. --enable-compressed \
  160. %endif
  161. %if "%{with_nntp}" == "yes"
  162. --enable-nntp \
  163. %endif
  164. --enable-buffy-size \
  165. --disable-warnings \
  166. --disable-iconv \
  167. --disable-nls \
  168. $options
  169. # perform standard build procedure
  170. %{l_make} %{l_mflags}
  171. %install
  172. rm -rf $RPM_BUILD_ROOT
  173. # perform standard installation procedure
  174. %{l_shtool} subst \
  175. -e "s;chmod 2755;true;" \
  176. -e "s;chgrp mail;true;" \
  177. Makefile
  178. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  179. # strip down installation tree
  180. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/[A-Za-d]*
  181. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/patch-notes.txt
  182. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/html
  183. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/samples
  184. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/flea
  185. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/flea.1
  186. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/muttbug
  187. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/muttbug.1
  188. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  189. # install additional files
  190. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  191. %{SOURCE muttrc} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/Muttrc
  192. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  193. %{SOURCE mailcap} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/mailcap
  194. # determine installation files
  195. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  196. %{l_files_std} \
  197. '%config %{l_prefix}/etc/mutt/*'
  198. %files -f files
  199. %clean
  200. rm -rf $RPM_BUILD_ROOT