michael@478: ## michael@478: ## mutt.spec -- OpenPKG RPM Package Specification michael@478: ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. michael@478: ## michael@478: ## Permission to use, copy, modify, and distribute this software for michael@478: ## any purpose with or without fee is hereby granted, provided that michael@478: ## the above copyright notice and this permission notice appear in all michael@478: ## copies. michael@478: ## michael@478: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@478: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@478: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@478: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@478: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@478: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@478: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@478: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@478: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@478: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@478: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@478: ## SUCH DAMAGE. michael@478: ## michael@478: michael@478: # package version michael@478: %define V_mutt 1.5.21 michael@478: %define V_mutt_patches 1.5.21 michael@478: michael@478: # package information michael@478: Name: mutt michael@478: Summary: Mail User Agent michael@478: URL: http://www.mutt.org/ michael@478: Vendor: Michael Elkins michael@478: Packager: OpenPKG Foundation e.V. michael@478: Distribution: OpenPKG Community michael@478: Class: BASE michael@478: Group: Mail michael@478: License: BSD michael@478: Version: %{V_mutt} michael@479: Release: 20120800 michael@478: michael@478: # build options michael@478: %option with_pop yes michael@478: %option with_imap yes michael@478: %option with_smtp yes michael@478: %option with_sasl yes michael@478: %option with_ssl yes michael@478: %option with_ncurses yes michael@478: %option with_hcache no michael@478: %option with_comp no michael@478: %option with_nntp no michael@478: %option with_initials no michael@478: %option with_quote no michael@478: %option with_sidebar no michael@478: michael@478: # list of sources michael@478: Source0: ftp://ftp.mutt.org/mutt/devel/mutt-%{V_mutt}.tar.gz michael@478: Source1: mailcap michael@478: Source2: muttrc michael@478: Patch0: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.rr.compressed.gz michael@478: Patch1: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.nntp.gz michael@478: Patch2: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.initials.gz michael@478: Patch3: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.quote.gz michael@478: Patch4: mutt.patch.sidebar michael@478: Patch5: mutt.patch michael@478: michael@478: # build information michael@478: BuildPreReq: OpenPKG, openpkg >= 20100101, make, perl michael@478: PreReq: OpenPKG, openpkg >= 20100101 michael@478: BuildPreReq: libidn, libiconv michael@478: PreReq: libidn, libiconv michael@478: %if "%{with_ssl}" == "yes" michael@478: BuildPreReq: openssl michael@478: PreReq: openssl michael@478: %endif michael@478: %if "%{with_sasl}" == "yes" michael@479: BuildPreReq: sasl, pkgconfig michael@478: PreReq: sasl michael@478: %endif michael@478: %if "%{with_hcache}" == "yes" michael@478: BuildPreReq: qdbm michael@478: PreReq: qdbm michael@478: %endif michael@478: %if "%{with_ncurses}" == "yes" michael@478: BuildPreReq: ncurses michael@478: PreReq: ncurses michael@478: %else michael@478: BuildPreReq: slang michael@478: PreReq: slang michael@478: %endif michael@478: michael@478: %description michael@478: Mutt is a small but very powerful text based program for reading michael@478: electronic mail under Unix operating systems, including support for michael@478: color terminals, MIME, and a threaded sorting mode. michael@478: michael@478: %track michael@478: prog mutt = { michael@478: version = %{V_mutt} michael@478: url = ftp://ftp.mutt.org/mutt/devel/ michael@478: regex = mutt-(__VER__)\.tar\.gz michael@478: } michael@478: prog mutt:patch_rr_compressed = { michael@478: version = %{V_mutt_patches} michael@478: url = ftp://ftp.mutt.org.ua/pub/mutt/ michael@478: regex = mutt-(1\.5(\.\d+)+) michael@478: url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/ michael@478: regex = patch-(__VER__)\.rr\.compressed\.gz michael@478: } michael@478: prog mutt:patch_vvv_initials = { michael@478: version = %{V_mutt_patches} michael@478: url = ftp://ftp.mutt.org.ua/pub/mutt/ michael@478: regex = mutt-(1\.5(\.\d+)+) michael@478: url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/ michael@478: regex = patch-(__VER__)\.vvv\.initials\.gz michael@478: } michael@478: prog mutt:patch_vvv_nntp = { michael@478: version = %{V_mutt_patches} michael@478: url = ftp://ftp.mutt.org.ua/pub/mutt/ michael@478: regex = mutt-(1\.5(\.\d+)+) michael@478: url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/ michael@478: regex = patch-(__VER__)\.vvv\.nntp\.gz michael@478: } michael@478: prog mutt:patch_vvv_quote = { michael@478: version = %{V_mutt_patches} michael@478: url = ftp://ftp.mutt.org.ua/pub/mutt/ michael@478: regex = mutt-(1\.5(\.\d+)+) michael@478: url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/ michael@478: regex = patch-(__VER__)\.vvv\.quote\.gz michael@478: } michael@478: michael@478: %prep michael@478: %setup -q -n mutt-%{V_mutt} michael@478: %if "%{with_comp}" == "yes" michael@478: %{l_gzip} -d -c <%{PATCH0} |\ michael@478: sed -e '/^diff.*Makefile\.am/,/^diff/d' \ michael@478: -e '/^diff.*configure\.in /,/^diff/d' \ michael@478: -e '/^diff.*acconfig\.h /,/^diff/d' |\ michael@478: %{l_patch} -p1 michael@478: # add target without requiring autoconf(1) to rebuild Makefile.in michael@478: # from Makefile.am since definitions of the patch are wrongly michael@478: # placed at the very beginning of Makefile.in and get overwritten michael@478: # latter. michael@478: %{l_shtool} subst -s \ michael@478: -e 's;^\( \| \{8,\}\)\(crypt.c cryptglue.c .*\)$; compress.c \2;' \ michael@478: -e 's;^\( attach.h buffy.h charset.h \)\(copy.h .*\)$;\1compress.h \2;' \ michael@478: -e 's;^\( buffy.$(OBJEXT) color.$(OBJEXT) \)\(.*\)$;\1compress.$(OBJEXT) \2;' \ michael@478: Makefile.in michael@478: %endif michael@478: %if "%{with_nntp}" == "yes" michael@478: %{l_gzip} -d -c <%{PATCH1} |\ michael@478: sed -e '/^diff.*configure\.in /,/^diff/d' \ michael@478: -e '/^diff.*acconfig\.h /,/^diff/d' |\ michael@478: %{l_patch} -p1 michael@478: %endif michael@478: %if "%{with_initials}" == "yes" michael@478: %patch -p1 -P 2 michael@478: %endif michael@478: %if "%{with_quote}" == "yes" michael@478: %patch -p1 -P 3 michael@478: %endif michael@478: %if "%{with_sidebar}" == "yes" michael@478: %patch -p0 -P 4 michael@478: %endif michael@478: %patch -p0 -P 5 michael@478: %{l_shtool} subst \ michael@478: -e 's;\(Mutt/%%s\);\1 %{l_openpkg_release -F "OpenPKG/%%t"};' \ michael@478: sendlib.c michael@478: michael@478: %build michael@478: # configure for particular platform michael@478: options='' michael@478: export CC="%{l_cc}" michael@478: export CFLAGS="%{l_cflags -O}" michael@478: %if "%{with_ncurses}" == "yes" michael@478: export CPPFLAGS="%{l_cppflags ncurses libidn .}" michael@478: %else michael@478: export CPPFLAGS="%{l_cppflags libidn .}" michael@478: %endif michael@478: export LDFLAGS="-Limap %{l_ldflags}" michael@478: export LIBS="" michael@478: export INSTALL="%{l_shtool} install%{l_nil} -c" michael@478: case "%{l_platform -t}" in michael@478: *-freebsd* ) options="--enable-flock --disable-fcntl" ;; michael@478: *-linux* ) LIBS="$LIBS -ldl" ;; michael@478: esac michael@478: %if "%{with_sasl}" == "yes" michael@478: CFLAGS="$CFLAGS `pkg-config sasl --cflags`" michael@478: LDFLAGS="$LDFLAGS `pkg-config sasl --libs-only-L`" michael@478: LIBS="$LIBS `pkg-config sasl --libs-only-l`" michael@478: %endif michael@478: ./configure \ michael@478: --prefix=%{l_prefix} \ michael@478: --mandir=%{l_prefix}/man \ michael@478: --sysconfdir=%{l_prefix}/etc/mutt \ michael@478: --with-docdir=%{l_prefix}/share/mutt \ michael@478: %if "%{with_ncurses}" == "yes" michael@478: --with-curses=%{l_prefix} \ michael@478: %else michael@478: --with-slang=%{l_prefix} \ michael@478: %endif michael@478: %if "%{with_pop}" == "yes" michael@478: --enable-pop \ michael@478: %endif michael@478: %if "%{with_imap}" == "yes" michael@478: --enable-imap \ michael@478: %endif michael@478: %if "%{with_smtp}" == "yes" michael@478: --enable-smtp \ michael@478: %endif michael@478: %if "%{with_sasl}" == "yes" michael@478: --with-sasl=%{l_prefix} \ michael@478: %endif michael@478: %if "%{with_ssl}" == "yes" michael@478: --with-ssl=%{l_prefix} \ michael@478: %endif michael@478: %if "%{with_hcache}" == "yes" michael@478: --enable-hcache \ michael@478: --with-qdbm=%{l_prefix} \ michael@478: %endif michael@478: %if "%{with_comp}" == "yes" michael@478: --enable-compressed \ michael@478: %endif michael@478: %if "%{with_nntp}" == "yes" michael@478: --enable-nntp \ michael@478: %endif michael@478: --enable-pgp \ michael@478: --enable-smime \ michael@478: --enable-iconv \ michael@478: --disable-warnings \ michael@478: --disable-nls \ michael@478: $options michael@478: michael@478: # perform standard build procedure michael@478: %{l_make} %{l_mflags} michael@478: michael@478: %install michael@478: michael@478: # perform standard installation procedure michael@478: %{l_shtool} subst \ michael@478: -e "s;chmod 2755;true;" \ michael@478: -e "s;chgrp mail;true;" \ michael@478: Makefile michael@478: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@478: michael@478: # strip down installation tree michael@478: rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/[A-Za-d]* michael@478: rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/patch-notes.txt michael@478: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/html michael@478: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/samples michael@478: rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/flea michael@478: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/flea.1 michael@478: rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/muttbug michael@478: rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/muttbug.1 michael@478: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@478: michael@478: # install additional files michael@478: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@478: %{SOURCE muttrc} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/Muttrc michael@478: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@478: %{SOURCE mailcap} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/mailcap michael@478: michael@478: # determine installation files michael@478: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@478: %{l_files_std} \ michael@478: '%config %{l_prefix}/etc/mutt/*' michael@478: michael@478: %files -f files michael@478: michael@478: %clean michael@478: