mutt/mutt.spec

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 478
804dbcd7beb4
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

michael@478 1 ##
michael@478 2 ## mutt.spec -- OpenPKG RPM Package Specification
michael@478 3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@478 4 ##
michael@478 5 ## Permission to use, copy, modify, and distribute this software for
michael@478 6 ## any purpose with or without fee is hereby granted, provided that
michael@478 7 ## the above copyright notice and this permission notice appear in all
michael@478 8 ## copies.
michael@478 9 ##
michael@478 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@478 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@478 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@478 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@478 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@478 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@478 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@478 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@478 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@478 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@478 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@478 21 ## SUCH DAMAGE.
michael@478 22 ##
michael@478 23
michael@478 24 # package version
michael@478 25 %define V_mutt 1.5.21
michael@478 26 %define V_mutt_patches 1.5.21
michael@478 27
michael@478 28 # package information
michael@478 29 Name: mutt
michael@478 30 Summary: Mail User Agent
michael@478 31 URL: http://www.mutt.org/
michael@478 32 Vendor: Michael Elkins
michael@478 33 Packager: OpenPKG Foundation e.V.
michael@478 34 Distribution: OpenPKG Community
michael@478 35 Class: BASE
michael@478 36 Group: Mail
michael@478 37 License: BSD
michael@478 38 Version: %{V_mutt}
michael@479 39 Release: 20120800
michael@478 40
michael@478 41 # build options
michael@478 42 %option with_pop yes
michael@478 43 %option with_imap yes
michael@478 44 %option with_smtp yes
michael@478 45 %option with_sasl yes
michael@478 46 %option with_ssl yes
michael@478 47 %option with_ncurses yes
michael@478 48 %option with_hcache no
michael@478 49 %option with_comp no
michael@478 50 %option with_nntp no
michael@478 51 %option with_initials no
michael@478 52 %option with_quote no
michael@478 53 %option with_sidebar no
michael@478 54
michael@478 55 # list of sources
michael@478 56 Source0: ftp://ftp.mutt.org/mutt/devel/mutt-%{V_mutt}.tar.gz
michael@478 57 Source1: mailcap
michael@478 58 Source2: muttrc
michael@478 59 Patch0: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.rr.compressed.gz
michael@478 60 Patch1: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.nntp.gz
michael@478 61 Patch2: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.initials.gz
michael@478 62 Patch3: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.quote.gz
michael@478 63 Patch4: mutt.patch.sidebar
michael@478 64 Patch5: mutt.patch
michael@478 65
michael@478 66 # build information
michael@478 67 BuildPreReq: OpenPKG, openpkg >= 20100101, make, perl
michael@478 68 PreReq: OpenPKG, openpkg >= 20100101
michael@478 69 BuildPreReq: libidn, libiconv
michael@478 70 PreReq: libidn, libiconv
michael@478 71 %if "%{with_ssl}" == "yes"
michael@478 72 BuildPreReq: openssl
michael@478 73 PreReq: openssl
michael@478 74 %endif
michael@478 75 %if "%{with_sasl}" == "yes"
michael@479 76 BuildPreReq: sasl, pkgconfig
michael@478 77 PreReq: sasl
michael@478 78 %endif
michael@478 79 %if "%{with_hcache}" == "yes"
michael@478 80 BuildPreReq: qdbm
michael@478 81 PreReq: qdbm
michael@478 82 %endif
michael@478 83 %if "%{with_ncurses}" == "yes"
michael@478 84 BuildPreReq: ncurses
michael@478 85 PreReq: ncurses
michael@478 86 %else
michael@478 87 BuildPreReq: slang
michael@478 88 PreReq: slang
michael@478 89 %endif
michael@478 90
michael@478 91 %description
michael@478 92 Mutt is a small but very powerful text based program for reading
michael@478 93 electronic mail under Unix operating systems, including support for
michael@478 94 color terminals, MIME, and a threaded sorting mode.
michael@478 95
michael@478 96 %track
michael@478 97 prog mutt = {
michael@478 98 version = %{V_mutt}
michael@478 99 url = ftp://ftp.mutt.org/mutt/devel/
michael@478 100 regex = mutt-(__VER__)\.tar\.gz
michael@478 101 }
michael@478 102 prog mutt:patch_rr_compressed = {
michael@478 103 version = %{V_mutt_patches}
michael@478 104 url = ftp://ftp.mutt.org.ua/pub/mutt/
michael@478 105 regex = mutt-(1\.5(\.\d+)+)
michael@478 106 url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
michael@478 107 regex = patch-(__VER__)\.rr\.compressed\.gz
michael@478 108 }
michael@478 109 prog mutt:patch_vvv_initials = {
michael@478 110 version = %{V_mutt_patches}
michael@478 111 url = ftp://ftp.mutt.org.ua/pub/mutt/
michael@478 112 regex = mutt-(1\.5(\.\d+)+)
michael@478 113 url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
michael@478 114 regex = patch-(__VER__)\.vvv\.initials\.gz
michael@478 115 }
michael@478 116 prog mutt:patch_vvv_nntp = {
michael@478 117 version = %{V_mutt_patches}
michael@478 118 url = ftp://ftp.mutt.org.ua/pub/mutt/
michael@478 119 regex = mutt-(1\.5(\.\d+)+)
michael@478 120 url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
michael@478 121 regex = patch-(__VER__)\.vvv\.nntp\.gz
michael@478 122 }
michael@478 123 prog mutt:patch_vvv_quote = {
michael@478 124 version = %{V_mutt_patches}
michael@478 125 url = ftp://ftp.mutt.org.ua/pub/mutt/
michael@478 126 regex = mutt-(1\.5(\.\d+)+)
michael@478 127 url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
michael@478 128 regex = patch-(__VER__)\.vvv\.quote\.gz
michael@478 129 }
michael@478 130
michael@478 131 %prep
michael@478 132 %setup -q -n mutt-%{V_mutt}
michael@478 133 %if "%{with_comp}" == "yes"
michael@478 134 %{l_gzip} -d -c <%{PATCH0} |\
michael@478 135 sed -e '/^diff.*Makefile\.am/,/^diff/d' \
michael@478 136 -e '/^diff.*configure\.in /,/^diff/d' \
michael@478 137 -e '/^diff.*acconfig\.h /,/^diff/d' |\
michael@478 138 %{l_patch} -p1
michael@478 139 # add target without requiring autoconf(1) to rebuild Makefile.in
michael@478 140 # from Makefile.am since definitions of the patch are wrongly
michael@478 141 # placed at the very beginning of Makefile.in and get overwritten
michael@478 142 # latter.
michael@478 143 %{l_shtool} subst -s \
michael@478 144 -e 's;^\( \| \{8,\}\)\(crypt.c cryptglue.c .*\)$; compress.c \2;' \
michael@478 145 -e 's;^\( attach.h buffy.h charset.h \)\(copy.h .*\)$;\1compress.h \2;' \
michael@478 146 -e 's;^\( buffy.$(OBJEXT) color.$(OBJEXT) \)\(.*\)$;\1compress.$(OBJEXT) \2;' \
michael@478 147 Makefile.in
michael@478 148 %endif
michael@478 149 %if "%{with_nntp}" == "yes"
michael@478 150 %{l_gzip} -d -c <%{PATCH1} |\
michael@478 151 sed -e '/^diff.*configure\.in /,/^diff/d' \
michael@478 152 -e '/^diff.*acconfig\.h /,/^diff/d' |\
michael@478 153 %{l_patch} -p1
michael@478 154 %endif
michael@478 155 %if "%{with_initials}" == "yes"
michael@478 156 %patch -p1 -P 2
michael@478 157 %endif
michael@478 158 %if "%{with_quote}" == "yes"
michael@478 159 %patch -p1 -P 3
michael@478 160 %endif
michael@478 161 %if "%{with_sidebar}" == "yes"
michael@478 162 %patch -p0 -P 4
michael@478 163 %endif
michael@478 164 %patch -p0 -P 5
michael@478 165 %{l_shtool} subst \
michael@478 166 -e 's;\(Mutt/%%s\);\1 %{l_openpkg_release -F "OpenPKG/%%t"};' \
michael@478 167 sendlib.c
michael@478 168
michael@478 169 %build
michael@478 170 # configure for particular platform
michael@478 171 options=''
michael@478 172 export CC="%{l_cc}"
michael@478 173 export CFLAGS="%{l_cflags -O}"
michael@478 174 %if "%{with_ncurses}" == "yes"
michael@478 175 export CPPFLAGS="%{l_cppflags ncurses libidn .}"
michael@478 176 %else
michael@478 177 export CPPFLAGS="%{l_cppflags libidn .}"
michael@478 178 %endif
michael@478 179 export LDFLAGS="-Limap %{l_ldflags}"
michael@478 180 export LIBS=""
michael@478 181 export INSTALL="%{l_shtool} install%{l_nil} -c"
michael@478 182 case "%{l_platform -t}" in
michael@478 183 *-freebsd* ) options="--enable-flock --disable-fcntl" ;;
michael@478 184 *-linux* ) LIBS="$LIBS -ldl" ;;
michael@478 185 esac
michael@478 186 %if "%{with_sasl}" == "yes"
michael@478 187 CFLAGS="$CFLAGS `pkg-config sasl --cflags`"
michael@478 188 LDFLAGS="$LDFLAGS `pkg-config sasl --libs-only-L`"
michael@478 189 LIBS="$LIBS `pkg-config sasl --libs-only-l`"
michael@478 190 %endif
michael@478 191 ./configure \
michael@478 192 --prefix=%{l_prefix} \
michael@478 193 --mandir=%{l_prefix}/man \
michael@478 194 --sysconfdir=%{l_prefix}/etc/mutt \
michael@478 195 --with-docdir=%{l_prefix}/share/mutt \
michael@478 196 %if "%{with_ncurses}" == "yes"
michael@478 197 --with-curses=%{l_prefix} \
michael@478 198 %else
michael@478 199 --with-slang=%{l_prefix} \
michael@478 200 %endif
michael@478 201 %if "%{with_pop}" == "yes"
michael@478 202 --enable-pop \
michael@478 203 %endif
michael@478 204 %if "%{with_imap}" == "yes"
michael@478 205 --enable-imap \
michael@478 206 %endif
michael@478 207 %if "%{with_smtp}" == "yes"
michael@478 208 --enable-smtp \
michael@478 209 %endif
michael@478 210 %if "%{with_sasl}" == "yes"
michael@478 211 --with-sasl=%{l_prefix} \
michael@478 212 %endif
michael@478 213 %if "%{with_ssl}" == "yes"
michael@478 214 --with-ssl=%{l_prefix} \
michael@478 215 %endif
michael@478 216 %if "%{with_hcache}" == "yes"
michael@478 217 --enable-hcache \
michael@478 218 --with-qdbm=%{l_prefix} \
michael@478 219 %endif
michael@478 220 %if "%{with_comp}" == "yes"
michael@478 221 --enable-compressed \
michael@478 222 %endif
michael@478 223 %if "%{with_nntp}" == "yes"
michael@478 224 --enable-nntp \
michael@478 225 %endif
michael@478 226 --enable-pgp \
michael@478 227 --enable-smime \
michael@478 228 --enable-iconv \
michael@478 229 --disable-warnings \
michael@478 230 --disable-nls \
michael@478 231 $options
michael@478 232
michael@478 233 # perform standard build procedure
michael@478 234 %{l_make} %{l_mflags}
michael@478 235
michael@478 236 %install
michael@478 237
michael@478 238 # perform standard installation procedure
michael@478 239 %{l_shtool} subst \
michael@478 240 -e "s;chmod 2755;true;" \
michael@478 241 -e "s;chgrp mail;true;" \
michael@478 242 Makefile
michael@478 243 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@478 244
michael@478 245 # strip down installation tree
michael@478 246 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/[A-Za-d]*
michael@478 247 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/patch-notes.txt
michael@478 248 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/html
michael@478 249 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/samples
michael@478 250 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/flea
michael@478 251 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/flea.1
michael@478 252 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/muttbug
michael@478 253 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/muttbug.1
michael@478 254 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@478 255
michael@478 256 # install additional files
michael@478 257 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@478 258 %{SOURCE muttrc} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/Muttrc
michael@478 259 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@478 260 %{SOURCE mailcap} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/mailcap
michael@478 261
michael@478 262 # determine installation files
michael@478 263 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@478 264 %{l_files_std} \
michael@478 265 '%config %{l_prefix}/etc/mutt/*'
michael@478 266
michael@478 267 %files -f files
michael@478 268
michael@478 269 %clean
michael@478 270

mercurial