alpine/alpine.spec

378 lines
12 KiB
RPMSpec

#
# spec file for package alpine (Version 1.10)
#
# Copyright (c) 2008 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:
#
%if %{suse_version} > 1030
%define obsolete_pine 1
%define provide_pico_and_pilot 1
%else
%define obsolete_pine 0
%define provide_pico_and_pilot 0
%endif
%define build_alpined 0
#
# For debugging only:
%define use_mudflap 0
%define build_vanilla 0
# Set this if you want to apply Eduardo Chappa's patches.all.gz:
%define apply_all_in_one_patch 0
#
Summary: Alpine mail user agent
BuildRequires: imap-devel krb5-devel libgssapi lzma 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: 1.10
Release: 1
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
#This caret is only here to prevent confusing spec file checking tools:
#%(
cd %{_sourcedir};cp %{name}-%{version}{,-build}.tar.lzma
lzma -d %{name}-%{version}-build.tar.lzma
tar --delete --file=%{name}-%{version}-build.tar \
./%{name}-%{version}/pico/msmem.c ./%{name}-%{version}/imap/docs
echo >%{name}-%{version}.README.SUSE <<END
Some files which are not needed for compilation have been removed from
this tarball. You can get the full tarball from %{URL}.
END
tar --append ./%{name}-%{version}.README.SUSE \
--file=%{name}-%{version}-build.tar
lzma -9 %{name}-%{version}-build.tar
)
%endif
Source: %{name}-%{version}.tar.lzma
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source1: %name.png
Source2: %name.desktop
Patch1: hide-release_number-in-titlebar.c
Patch2: make-use-of-strncat-safer.diff
Patch3: operation-may-be-undefined-warning.diff
Patch10: pico-fix-spurious-undef-warnings.diff
Patch20: pine-expression-warnings.diff
Patch40: pico-stripwhitespace.diff
Patch60: signal-and-panic-improvements.diff
#
# Eduardo Chappa's patches. Currently, We only use the 'all_in_one' version:
#
%if !%{apply_all_in_one_patch}
Source600: chappa-cherrypick.sh
Source601: chappa-patches.tar.lzma
%else
#Patch500: staff.washington.edu/chappa/alpine/patches/alpine-%{version}/all.patch.gz
%endif
%description
Alpine is an major update of Pine, most importantly featuring improved
support for UTF-8 (Unicode) and is licensed under an OSI-approved
license (the Apache License).
Though originally designed for inexperienced email users, Alpine
supports many advanced features, and an ever-growing number of
configuration and personal-preference options.
%{?debug_package}
%package -n pico
License: Any permissive
Summary: A small, easy to use editor
Group: Productivity/Editors/Other
AutoReqProv: on
%description -n pico
Pico is a simple, display-oriented text editor based on the Pine
message system composer. As with Pine, commands are displayed at the
bottom of the screen, and context-sensitive help is provided.
Characters are inserted into the text as they are typed.
%package -n pilot
License: Any permissive
Summary: Simple file system browser
Group: Productivity/File utilities
AutoReqProv: on
%description -n pilot
Pilot is a simple, display-oriented file system browser based on the
Pine message system composer. As with Pine, commands are displayed at
the bottom of the screen, and context-sensitive help is provided.
%prep
%setup -q
%if !%{build_vanilla}
#
# This is here to support checking if any patches add new warnings:
#
if [ ! -s %{_sourcedir}/compile-warnings-%{suse_version}-%{_arch}.log ]; then
echo "No warnings check possible, set build_vanilla to 1 and"
echo "add compile-warnings-%{suse_version}-%{_arch}.log from"
echo "that build to the rpm build process so that it's found here".
else
sed 's/:[0-9]*//' %{_sourcedir}/compile-warnings-%{suse_version}-%{_arch}.log \
>compile-warnings-allowed.log
fi
#
# People which want, can use the full all.patch.gz with apply_all_in_one_patch:
#
%if %{apply_all_in_one_patch}
%patch500 -p1
%else
sh %{SOURCE600} --apply %{SOURCE601}
%endif
#
# SuSE patches - warning fixes, etc:
#
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch10 -p1
%patch20 -p1
%patch40 -p1
%patch60 -p1
%endif # End of "if !{build_vanilla}"
%build
# Workaround for older distros which slashed the gnu:
%if %{suse_version} <= 1010
%define _host_os %{_os}%{?_gnu}
%define _host %{_host_cpu}-%{_host_vendor}-%{_host_os}
%endif
#
# Comment on disabled warnings: The disabled warnings are rather harmless
# and disabling them allows to focus on the really serious warnings:
#
export CFLAGS="${RPM_OPT_FLAGS/-O2/-Os} \
%if %{suse_version} >= 1010
-Wno-unused-value -Wno-strict-aliasing -Wno-pointer-sign -Wno-unused \
%endif
%if %{suse_version} >= 1030
-Wno-address \
%endif
%if %{use_mudflap}
-fmudflap \
%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:
#-fmudflap -fmudflapir \
%if %{use_mudflap}
export EXTRALDFLAGS="-lmudflap"
# Silences warnings at startup (faster, could be used for production builds):
#export EXTRALDFLAGS="-lmudflapir"
LDFLAGS="$LDFLAGS $EXTRALDFLAGS"
%endif
:
%configure --with-tcl-lib=tcl8.4 \
%if %{use_mudflap}
%( : 'mudflap(th) does not work with with threads:' )\
--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=%_sysconfdir/pine.conf \
--with-system-fixed-pinerc=%_sysconfdir/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 EXTRACFLAGS/EXTRALDFLAGS:
#
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 <warnings.where
cat warnings-with-code
exit 5
else
echo "Fixed warnings:"
grep '^<' compile-warnings-%{suse_version}-%{_arch}-sorted.diff
fi
else
echo "No fixed warnings and no new warnings"
fi
fi
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc %{_mandir}/man1/alpine.1.gz
%doc %{_mandir}/man1/rpdump.1.gz
%doc %{_mandir}/man1/rpload.1.gz
%doc %{_mandir}/man1/mailutil.1.gz
%doc README NOTICE LICENSE
%doc doc/mailcap.unx doc/mime.types doc/tech-notes.txt doc/tech-notes/*.html
%{_bindir}/*pine
%{_bindir}/alpinef
%{_bindir}/rp*
%{_bindir}/mailutil
/usr/share/applications/%name.desktop
/usr/share/pixmaps/%name.png
%if %provide_pico_and_pilot
%files -n pico
%defattr(-, root, root)
%{_bindir}/pico
%doc %{_mandir}/man1/pico.1.gz
%files -n pilot
%defattr(-, root, root)
%{_bindir}/pilot
%doc %{_mandir}/man1/pilot.1.gz
%endif
%changelog
* Fri Apr 25 2008 bk@suse.de
- Update to alpine-1.10 and update fixes suggested for this version
* Fri Jan 11 2008 bk@suse.de
- Update to alpine-1.00 and apply fixes suggested for this version
* Tue Sep 25 2007 bk@suse.de
- Use only select patches from Eduardo (fixes crash in mail reader)
* Wed Sep 19 2007 bk@suse.de
- Remove files with unclear license from packaged sources (#308533)
- Add small bug fix: Postponed messages which were labelled as UTF-8
- Spec file cleanup: Comments improved, obsoleted some warning flags
* Tue Sep 04 2007 bk@suse.de
- Update to final prerelease 0.9999 with updates from Eduardo Chappa
* Thu Aug 09 2007 bk@suse.de
- add a number of critcally needed fixes for some crashes (and more)
* Thu Aug 02 2007 bk@suse.de
- initial version 0.999 + assorted feature patches and some fixes