mutt.spec 8.2 KB

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