# # spec file for package alpine (Version 0.9999) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: alpine # # Package configuration: # %define obsolete_pine 0 %define provide_pico_and_pilot 0 %define build_alpined 0 # For debugging only: %define use_mudflap 0 %define build_vanilla 0 %define apply_all_in_one_patch 1 # Summary: Alpine mail user agent BuildRequires: imap-devel krb5-devel libgssapi ncurses-devel openldap2-devel openssl-devel pam-devel update-desktop-files %if %build_alpined BuildRequires: blt tcl-devel %endif %if %{use_mudflap} BuildRequires: libmudflap %endif # pgp4pine requires pine: Provides: pine %if %obsolete_pine Obsoletes: pine4 Provides: pine4 %else Conflicts: pine4 %endif Version: 0.9999 Release: 6 License: The Apache Software License Group: Productivity/Networking/Email/Clients AutoReqProv: on Url: http://www.washington.edu/alpine/ # # Fix for #308533: Remove files with unclear license, which are not needed # from the distributed source tarball: # %define USE_CLEANED_UP_TARBALL_FORBUILD 1 %if %USE_CLEANED_UP_TARBALL_FORBUILD != 1 Source: ftp://ftp.cac.washington.edu/alpine/%{name}-%{version}.tar.bz2 %else #This caret is only here to prevent confusing spec file checking tools: #%( cd %{_sourcedir};cp %{name}-%{version}{,-build}.tar.bz2 bunzip2 %{name}-%{version}-build.tar.bz2 tar --delete --file=%{name}-%{version}-build.tar \ ./alpine-0.9999/pico/msmem.c ./alpine-0.9999/imap/docs echo >%{name}-%{version}.README.SUSE <compile-warnings-allowed.log fi # Upstream patches: %patch200 # # Show that this is the openSUSE build of alpine and which version: # %patch103 -p1 echo %{version}-openSUSE-%{release} >VERSION # # Apply Eduardo Chappa's patch set as one patch (501 documents his patch): # %if %{apply_all_in_one_patch} %patch500 -p1 %patch501 -p1 %endif # # This simply adds a colon if it's missing in the all.patch: # [ $(grep -c "including creation date of the patch is$" pith/pine.hlp) = 1 ] && sed -i 's/including creation date of the patch is$/&:/' pith/pine.hlp # # SuSE patches - warning fixes, etc: # %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch10 -p1 %patch20 -p1 %patch40 -p1 %patch60 -p1 %patch90 -p1 %endif # # End of non-vanilla-patch section # %build %if %{suse_version} <= 1010 %define _host_os %{_os}%{?_gnu} %define _host %{_host_cpu}-%{_host_vendor}-%{_host_os} %endif autoreconf -fi export CFLAGS="${RPM_OPT_FLAGS/-O2/-Os}" # # Comments on disabled warnings: The disabled warnings are rather harmless # (If they were not, alpine would not work at all, they are trigged in mass, # because until recently developers did use gcc-3.x exclusivley) # and disabling them allows one to focus on the warnings which could indicate # real bugs. By alpine-0.9999, several warnings have been eliminated however: # export CFLAGS="$CFLAGS \ %if %{suse_version} >= 1010 -Wno-strict-aliasing -Wno-pointer-sign -Wno-unused \ %endif %if %{suse_version} == 1030 -Wno-address \ %endif %if %{use_mudflap} -fmudflap -fmudflapir \ %endif " # # On -Waddress: # # Added with gcc-4.2: It warns when the address of a variable (not a pointer) # is used in an expression. Since addresses of variables are # always non-zero, # they are always true and can be safely removed from the expression, # but the code is safe nontheless. # # -Waddress generates >100 warnings in alpine and we disabled them to # concentrate on the really important warnings which could be real bugs better. # # # Used in conjunction with signal-and-panic-improvements.diff: # export LDFLAGS="-rdynamic" # -rdynamic is used for backtrace_symbols: # # In case one wants to compile alpine with libmudflap to instrument all risky # pointer/array dereferencing operations, some standard library string/heap # functions, and some other associated constructs with range/validity tests. # Modules so instrumented should be immune to buffer overflows, invalid heap # use, and some other classes of C/C++ programming errors. Disabled by default, # but may be used for debugging issues which are otherwise hard to catch: # %if %{use_mudflap} export EXTRALDFLAGS="-lmudflap" LDFLAGS="$LDFLAGS $EXTRALDFLAGS" %endif %configure --with-tcl-lib=tcl8.4 \ %if %{use_mudflap} --without-pthread \ %endif --with-smtp-msa=/usr/sbin/sendmail \ --with-password-prog=/usr/bin/passwd \ --with-npa=/usr/bin/inews \ --with-spellcheck-prog="please set Speller to eg. 'aspell -c' in SETUP/Configuration"\ --with-system-pinerc=/etc/pine.conf \ --with-system-fixed-pinerc=/etc/pine.conf.fixed \ --with-debug-level=0 \ --with-debug-files=2 \ --with-file=.alpine-debug \ --with-default-mail-directory=Mail \ --with-passfile=.pinepw || { grep -B9 -A20 'failed program was' config.log | grep -A24 checking exit 5 } # # imap does not use CFLAGS from configure, needs EXTRAFCLAGS: # make EXTRACFLAGS="$CFLAGS" EXTRALDFLAGS="$EXTRALDFLAGS" 2>&1 | tee make.log | grep -v -e '^mv ' -e '/usr/bin/[a-z]*' -e '^echo ' -e ' -l' | sed 's/.*gcc .* -o .*\.o /-----> /;/^-----/s/;.*//;/^then/d' %install install -D -m755 alpine/alpine $RPM_BUILD_ROOT%{_bindir}/alpine # # When called as alpinef, alpine uses function keys instead of Control keys: # ln $RPM_BUILD_ROOT%{_bindir}/alpine $RPM_BUILD_ROOT%{_bindir}/alpinef install -m755 alpine/{rpload,rpdump} $RPM_BUILD_ROOT%{_bindir} install -m755 imap/mailutil/mailutil $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1 install -m644 doc/{alpine.1,rpdump.1,rpload.1} $RPM_BUILD_ROOT%{_mandir}/man1/ install -m644 imap/src/mailutil/mailutil.1 $RPM_BUILD_ROOT%{_mandir}/man1/ install -D -m644 %{SOURCE1} $RPM_BUILD_ROOT/usr/share/pixmaps/%name.png install -D -m644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/applications/%name.desktop %suse_update_desktop_file %name %if %obsolete_pine ln -sf alpine $RPM_BUILD_ROOT%{_bindir}/pine %endif %if %provide_pico_and_pilot install -m755 pico/{pico,pilot} $RPM_BUILD_ROOT%{_bindir} install -m644 doc/{pico.1,pilot.1} $RPM_BUILD_ROOT%{_mandir}/man1/ %endif %check #since where are no logs in the package at the moment, there are no checks, #but the warning logs can be recreated for regresstion tracking in warnings: if [ -s %{_sourcedir}/compile-warnings-%{suse_version}-%{_arch}.log ]; then grep -e '^[a-z0-9_]*.[cho]:' -e 'Entering directory' make.log | sed "s/^make\[.\]: //;/Entering directory/s/[\`']//g;" \ >compile-warnings-%{suse_version}-%{_arch}.log # Sort the combined allowed warnings: grep -v -e 'In function' -e 'Entering directory' \ compile-warnings-allowed.log | sort -u > compile-warnings-%{suse_version}-%{_arch}-reference.sort # Sort the warnings which occured now: grep -v -e 'In function' -e 'Entering directory' \ compile-warnings-%{suse_version}-%{_arch}.log | sed 's/:[0-9]*//' | sort -u \ >compile-warnings-%{suse_version}-%{_arch}-thisbuild.sort # diff them: diff compile-warnings-%{suse_version}-%{_arch}-{reference,thisbuild}.sort | tee compile-warnings-%{suse_version}-%{_arch}-sorted.diff if test -s compile-warnings-%{suse_version}-%{_arch}-sorted.diff; then grep '^>' compile-warnings-%{suse_version}-%{_arch}-sorted.diff >new-warnings ||: if [ -s new-warnings ]; then diff -u %{_sourcedir}/compile-warnings-%{suse_version}-%{_arch}.log \ compile-warnings-%{suse_version}-%{_arch}.log || echo "New warnings:" cat new-warnings sed 's/> //;s/:/:[0-9]*:/' new-warnings >new-warnings.pattern : diff: %_builddir}/compile-warnings-%{suse_version}-%{_arch}-sorted.diff grep -B1 -f new-warnings.pattern compile-warnings-%{suse_version}-%{_arch}.log grep -e 'Entering directory' -f new-warnings.pattern \ compile-warnings-%{suse_version}-%{_arch}.log | grep -B1 -f new-warnings.pattern | tee warnings.where while IFS='[: ]' read file line message; do if [ "$file" = Entering ]; then dir="${message#%_builddir/%buildsubdir/}" else path="$dir/$file" echo "$path:$line: $message" >>warnings-with-code head -"$line" "$path"|tail -1 >>warnings-with-code fi done