mutt.spec 9.0 KB

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