mutt/mutt.spec

changeset 478
804dbcd7beb4
child 479
1a3c5950a050
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mutt/mutt.spec	Sun Aug 05 21:46:09 2012 +0200
     1.3 @@ -0,0 +1,270 @@
     1.4 +##
     1.5 +##  mutt.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package version
    1.28 +%define       V_mutt                  1.5.21
    1.29 +%define       V_mutt_patches          1.5.21
    1.30 +
    1.31 +#   package information
    1.32 +Name:         mutt
    1.33 +Summary:      Mail User Agent
    1.34 +URL:          http://www.mutt.org/
    1.35 +Vendor:       Michael Elkins
    1.36 +Packager:     OpenPKG Foundation e.V.
    1.37 +Distribution: OpenPKG Community
    1.38 +Class:        BASE
    1.39 +Group:        Mail
    1.40 +License:      BSD
    1.41 +Version:      %{V_mutt}
    1.42 +Release:      20110123
    1.43 +
    1.44 +#   build options
    1.45 +%option       with_pop       yes
    1.46 +%option       with_imap      yes
    1.47 +%option       with_smtp      yes
    1.48 +%option       with_sasl      yes
    1.49 +%option       with_ssl       yes
    1.50 +%option       with_ncurses   yes
    1.51 +%option       with_hcache    no
    1.52 +%option       with_comp      no
    1.53 +%option       with_nntp      no
    1.54 +%option       with_initials  no
    1.55 +%option       with_quote     no
    1.56 +%option       with_sidebar   no
    1.57 +
    1.58 +#   list of sources
    1.59 +Source0:      ftp://ftp.mutt.org/mutt/devel/mutt-%{V_mutt}.tar.gz
    1.60 +Source1:      mailcap
    1.61 +Source2:      muttrc
    1.62 +Patch0:       ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.rr.compressed.gz
    1.63 +Patch1:       ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.nntp.gz
    1.64 +Patch2:       ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.initials.gz
    1.65 +Patch3:       ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.quote.gz
    1.66 +Patch4:       mutt.patch.sidebar
    1.67 +Patch5:       mutt.patch
    1.68 +
    1.69 +#   build information
    1.70 +BuildPreReq:  OpenPKG, openpkg >= 20100101, make, perl
    1.71 +PreReq:       OpenPKG, openpkg >= 20100101
    1.72 +BuildPreReq:  libidn, libiconv
    1.73 +PreReq:       libidn, libiconv
    1.74 +%if "%{with_ssl}" == "yes"
    1.75 +BuildPreReq:  openssl
    1.76 +PreReq:       openssl
    1.77 +%endif
    1.78 +%if "%{with_sasl}" == "yes"
    1.79 +BuildPreReq:  sasl
    1.80 +PreReq:       sasl
    1.81 +%endif
    1.82 +%if "%{with_hcache}" == "yes"
    1.83 +BuildPreReq:  qdbm
    1.84 +PreReq:       qdbm
    1.85 +%endif
    1.86 +%if "%{with_ncurses}" == "yes"
    1.87 +BuildPreReq:  ncurses
    1.88 +PreReq:       ncurses
    1.89 +%else
    1.90 +BuildPreReq:  slang
    1.91 +PreReq:       slang
    1.92 +%endif
    1.93 +
    1.94 +%description
    1.95 +    Mutt is a small but very powerful text based program for reading
    1.96 +    electronic mail under Unix operating systems, including support for
    1.97 +    color terminals, MIME, and a threaded sorting mode.
    1.98 +
    1.99 +%track
   1.100 +    prog mutt = {
   1.101 +        version   = %{V_mutt}
   1.102 +        url       = ftp://ftp.mutt.org/mutt/devel/
   1.103 +        regex     = mutt-(__VER__)\.tar\.gz
   1.104 +    }
   1.105 +    prog mutt:patch_rr_compressed = {
   1.106 +        version   = %{V_mutt_patches}
   1.107 +        url       = ftp://ftp.mutt.org.ua/pub/mutt/
   1.108 +        regex     = mutt-(1\.5(\.\d+)+)
   1.109 +        url       = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
   1.110 +        regex     = patch-(__VER__)\.rr\.compressed\.gz
   1.111 +    }
   1.112 +    prog mutt:patch_vvv_initials = {
   1.113 +        version   = %{V_mutt_patches}
   1.114 +        url       = ftp://ftp.mutt.org.ua/pub/mutt/
   1.115 +        regex     = mutt-(1\.5(\.\d+)+)
   1.116 +        url       = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
   1.117 +        regex     = patch-(__VER__)\.vvv\.initials\.gz
   1.118 +    }
   1.119 +    prog mutt:patch_vvv_nntp = {
   1.120 +        version   = %{V_mutt_patches}
   1.121 +        url       = ftp://ftp.mutt.org.ua/pub/mutt/
   1.122 +        regex     = mutt-(1\.5(\.\d+)+)
   1.123 +        url       = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
   1.124 +        regex     = patch-(__VER__)\.vvv\.nntp\.gz
   1.125 +    }
   1.126 +    prog mutt:patch_vvv_quote = {
   1.127 +        version   = %{V_mutt_patches}
   1.128 +        url       = ftp://ftp.mutt.org.ua/pub/mutt/
   1.129 +        regex     = mutt-(1\.5(\.\d+)+)
   1.130 +        url       = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/
   1.131 +        regex     = patch-(__VER__)\.vvv\.quote\.gz
   1.132 +    }
   1.133 +
   1.134 +%prep
   1.135 +    %setup -q -n mutt-%{V_mutt}
   1.136 +%if "%{with_comp}" == "yes"
   1.137 +    %{l_gzip} -d -c <%{PATCH0} |\
   1.138 +        sed -e '/^diff.*Makefile\.am/,/^diff/d' \
   1.139 +            -e '/^diff.*configure\.in /,/^diff/d' \
   1.140 +            -e '/^diff.*acconfig\.h /,/^diff/d' |\
   1.141 +        %{l_patch} -p1
   1.142 +    #   add target without requiring autoconf(1) to rebuild Makefile.in
   1.143 +    #   from Makefile.am since definitions of the patch are wrongly
   1.144 +    #   placed at the very beginning of Makefile.in and get overwritten
   1.145 +    #   latter.
   1.146 +    %{l_shtool} subst -s \
   1.147 +        -e 's;^\(	\| \{8,\}\)\(crypt.c cryptglue.c .*\)$;	compress.c \2;' \
   1.148 +        -e 's;^\(	attach.h buffy.h charset.h \)\(copy.h .*\)$;\1compress.h \2;' \
   1.149 +        -e 's;^\(	buffy.$(OBJEXT) color.$(OBJEXT) \)\(.*\)$;\1compress.$(OBJEXT) \2;' \
   1.150 +        Makefile.in
   1.151 +%endif
   1.152 +%if "%{with_nntp}" == "yes"
   1.153 +    %{l_gzip} -d -c <%{PATCH1} |\
   1.154 +        sed -e '/^diff.*configure\.in /,/^diff/d' \
   1.155 +            -e '/^diff.*acconfig\.h /,/^diff/d' |\
   1.156 +        %{l_patch} -p1
   1.157 +%endif
   1.158 +%if "%{with_initials}" == "yes"
   1.159 +    %patch -p1 -P 2
   1.160 +%endif
   1.161 +%if "%{with_quote}" == "yes"
   1.162 +    %patch -p1 -P 3
   1.163 +%endif
   1.164 +%if "%{with_sidebar}" == "yes"
   1.165 +    %patch -p0 -P 4
   1.166 +%endif
   1.167 +    %patch -p0 -P 5
   1.168 +    %{l_shtool} subst \
   1.169 +        -e 's;\(Mutt/%%s\);\1 %{l_openpkg_release -F "OpenPKG/%%t"};' \
   1.170 +        sendlib.c
   1.171 +
   1.172 +%build
   1.173 +    #   configure for particular platform
   1.174 +    options=''
   1.175 +    export CC="%{l_cc}"
   1.176 +    export CFLAGS="%{l_cflags -O}"
   1.177 +%if "%{with_ncurses}" == "yes"
   1.178 +    export CPPFLAGS="%{l_cppflags ncurses libidn .}"
   1.179 +%else
   1.180 +    export CPPFLAGS="%{l_cppflags libidn .}"
   1.181 +%endif
   1.182 +    export LDFLAGS="-Limap %{l_ldflags}"
   1.183 +    export LIBS=""
   1.184 +    export INSTALL="%{l_shtool} install%{l_nil} -c"
   1.185 +    case "%{l_platform -t}" in
   1.186 +        *-freebsd* ) options="--enable-flock --disable-fcntl" ;;
   1.187 +        *-linux*   ) LIBS="$LIBS -ldl" ;;
   1.188 +    esac
   1.189 +%if "%{with_sasl}" == "yes"
   1.190 +    CFLAGS="$CFLAGS `pkg-config sasl --cflags`"
   1.191 +    LDFLAGS="$LDFLAGS `pkg-config sasl --libs-only-L`"
   1.192 +    LIBS="$LIBS `pkg-config sasl --libs-only-l`"
   1.193 +%endif
   1.194 +    ./configure \
   1.195 +        --prefix=%{l_prefix} \
   1.196 +        --mandir=%{l_prefix}/man \
   1.197 +        --sysconfdir=%{l_prefix}/etc/mutt \
   1.198 +        --with-docdir=%{l_prefix}/share/mutt \
   1.199 +%if "%{with_ncurses}" == "yes"
   1.200 +        --with-curses=%{l_prefix} \
   1.201 +%else
   1.202 +        --with-slang=%{l_prefix} \
   1.203 +%endif
   1.204 +%if "%{with_pop}" == "yes"
   1.205 +        --enable-pop \
   1.206 +%endif
   1.207 +%if "%{with_imap}" == "yes"
   1.208 +        --enable-imap \
   1.209 +%endif
   1.210 +%if "%{with_smtp}" == "yes"
   1.211 +        --enable-smtp \
   1.212 +%endif
   1.213 +%if "%{with_sasl}" == "yes"
   1.214 +        --with-sasl=%{l_prefix} \
   1.215 +%endif
   1.216 +%if "%{with_ssl}" == "yes"
   1.217 +        --with-ssl=%{l_prefix} \
   1.218 +%endif
   1.219 +%if "%{with_hcache}" == "yes"
   1.220 +        --enable-hcache \
   1.221 +        --with-qdbm=%{l_prefix} \
   1.222 +%endif
   1.223 +%if "%{with_comp}" == "yes"
   1.224 +        --enable-compressed \
   1.225 +%endif
   1.226 +%if "%{with_nntp}" == "yes"
   1.227 +        --enable-nntp \
   1.228 +%endif
   1.229 +        --enable-pgp \
   1.230 +        --enable-smime \
   1.231 +        --enable-iconv \
   1.232 +        --disable-warnings \
   1.233 +        --disable-nls \
   1.234 +        $options
   1.235 +
   1.236 +    #   perform standard build procedure
   1.237 +    %{l_make} %{l_mflags}
   1.238 +
   1.239 +%install
   1.240 +
   1.241 +    #   perform standard installation procedure
   1.242 +    %{l_shtool} subst \
   1.243 +        -e "s;chmod 2755;true;" \
   1.244 +        -e "s;chgrp mail;true;" \
   1.245 +        Makefile
   1.246 +    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.247 +
   1.248 +    #   strip down installation tree
   1.249 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/share/mutt/[A-Za-d]*
   1.250 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/share/mutt/patch-notes.txt
   1.251 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/html
   1.252 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/samples
   1.253 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/flea
   1.254 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/man/man1/flea.1
   1.255 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/muttbug
   1.256 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/man/man1/muttbug.1
   1.257 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.258 +
   1.259 +    #   install additional files
   1.260 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.261 +        %{SOURCE muttrc} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/Muttrc
   1.262 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.263 +        %{SOURCE mailcap} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/mailcap
   1.264 +
   1.265 +    #   determine installation files
   1.266 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.267 +        %{l_files_std} \
   1.268 +        '%config %{l_prefix}/etc/mutt/*'
   1.269 +
   1.270 +%files -f files
   1.271 +
   1.272 +%clean
   1.273 +

mercurial