mutt.spec 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. ##
  2. ## mutt.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_mutt 1.5.19
  25. %define V_mutt_patches 1.5.19
  26. %define V_mutt_patches_sidebar 1.5.19.sidebar.20090618
  27. # package information
  28. Name: mutt
  29. Summary: Mail User Agent
  30. URL: http://www.mutt.org/
  31. Vendor: Michael Elkins
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: BASE
  35. Group: Mail
  36. License: BSD
  37. Version: %{V_mutt}
  38. Release: 20090703
  39. # build options
  40. %option with_pop no
  41. %option with_imap no
  42. %option with_smtp no
  43. %option with_sasl no
  44. %option with_ssl no
  45. %option with_hcache no
  46. %option with_comp no
  47. %option with_nntp no
  48. %option with_initials no
  49. %option with_quote no
  50. %option with_sidebar no
  51. %option with_ncurses no
  52. # list of sources
  53. Source0: ftp://ftp.mutt.org/mutt/devel/mutt-%{V_mutt}.tar.gz
  54. Source1: mailcap
  55. Source2: muttrc
  56. Patch0: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.rr.compressed.gz
  57. Patch1: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.nntp.gz
  58. Patch2: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.initials.gz
  59. Patch3: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.quote.gz
  60. Patch4: http://lunar-linux.org/~tchan/mutt/patch-%{V_mutt_patches_sidebar}.txt
  61. Patch5: mutt.patch.sidebar
  62. # build information
  63. Prefix: %{l_prefix}
  64. BuildRoot: %{l_buildroot}
  65. BuildPreReq: OpenPKG, openpkg >= 20060622, make, perl
  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://www.lunar-linux.org/index.php?option=com_content&task=view&id=44
  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. %patch -p0 -P 5
  166. %endif
  167. %{l_shtool} subst \
  168. -e 's;\(Mutt/%%s\);\1 %{l_openpkg_release -F "OpenPKG/%%t"};' \
  169. sendlib.c
  170. %build
  171. # configure for particular platform
  172. options=''
  173. libs=''
  174. case "%{l_platform -t}" in
  175. *-freebsd* ) options="--enable-flock --disable-fcntl" ;;
  176. *-linux* ) libs="-ldl" ;;
  177. esac
  178. CC="%{l_cc}" \
  179. CFLAGS="%{l_cflags -O}" \
  180. %if "%{with_ncurses}" == "yes"
  181. CPPFLAGS="%{l_cppflags ncurses libidn .}" \
  182. %else
  183. CPPFLAGS="%{l_cppflags libidn .}" \
  184. %endif
  185. LDFLAGS="-Limap %{l_ldflags}" \
  186. LIBS="$libs" \
  187. INSTALL="%{l_shtool} install%{l_nil} -c" \
  188. ./configure \
  189. --prefix=%{l_prefix} \
  190. --mandir=%{l_prefix}/man \
  191. --sysconfdir=%{l_prefix}/etc/mutt \
  192. --with-docdir=%{l_prefix}/share/mutt \
  193. %if "%{with_ncurses}" == "yes"
  194. --with-curses=%{l_prefix} \
  195. %else
  196. --with-slang=%{l_prefix} \
  197. %endif
  198. %if "%{with_pop}" == "yes"
  199. --enable-pop \
  200. %endif
  201. %if "%{with_imap}" == "yes"
  202. --enable-imap \
  203. %endif
  204. %if "%{with_smtp}" == "yes"
  205. --enable-smtp \
  206. %endif
  207. %if "%{with_sasl}" == "yes"
  208. --with-sasl=%{l_prefix} \
  209. %endif
  210. %if "%{with_ssl}" == "yes"
  211. --with-ssl=%{l_prefix} \
  212. %endif
  213. %if "%{with_hcache}" == "yes"
  214. --enable-hcache \
  215. --with-qdbm=%{l_prefix} \
  216. %endif
  217. %if "%{with_comp}" == "yes"
  218. --enable-compressed \
  219. %endif
  220. %if "%{with_nntp}" == "yes"
  221. --enable-nntp \
  222. %endif
  223. --enable-pgp \
  224. --enable-smime \
  225. --enable-buffy-size \
  226. --with-iconv \
  227. --disable-warnings \
  228. --disable-nls \
  229. $options
  230. # perform standard build procedure
  231. %{l_make} %{l_mflags}
  232. %install
  233. rm -rf $RPM_BUILD_ROOT
  234. # perform standard installation procedure
  235. %{l_shtool} subst \
  236. -e "s;chmod 2755;true;" \
  237. -e "s;chgrp mail;true;" \
  238. Makefile
  239. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  240. # strip down installation tree
  241. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/[A-Za-d]*
  242. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/patch-notes.txt
  243. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/html
  244. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/samples
  245. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/flea
  246. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/flea.1
  247. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/muttbug
  248. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/muttbug.1
  249. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  250. # install additional files
  251. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  252. %{SOURCE muttrc} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/Muttrc
  253. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  254. %{SOURCE mailcap} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/mailcap
  255. # determine installation files
  256. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  257. %{l_files_std} \
  258. '%config %{l_prefix}/etc/mutt/*'
  259. %files -f files
  260. %clean
  261. rm -rf $RPM_BUILD_ROOT