mutt/mutt.spec

Fri, 07 Sep 2012 19:08:07 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 07 Sep 2012 19:08:07 +0200
changeset 667
9dacbd1d1aa2
parent 478
804dbcd7beb4
permissions
-rw-r--r--

Correct build configuration in Solaris subdir, correct english grammar,
remove irrelevant strip notice, introduce custom CFLAG logic, facilitate
use of Solaris Studio compiler with needed build configuration
adjustments, conditionally build 64 bit position independent code,
and accommodate tun(7) in newer Solaris releases by renaming driver
and module from conflicting 'tun' to 'vtun'. These changes include
some nonstandard 'I give up' logic causing out of tree builds by
manipulating the PATH, for example.

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

mercurial