# TODO:
# - backport man-pages from pine.spec
-# - alpine should obsolete pine, link pine -> alpine should be made
-# - review patches from pine:
-# - home_etc support
-# - ....many more
# - separate package with tcl web-frontend
+# - fix as-needed
Summary: University of Washington Pine mail user agent
Summary(pl.UTF-8): Klient pocztowy Pine z Uniwersytetu w Waszyngtonie
Name: alpine
-%define ver 0.9999
-%define patchlevel 38
+%define ver 0.99999
+%define patchlevel 4
Version: %{ver}.%{patchlevel}
Release: 1
Epoch: 1
#Source0: ftp://ftp.cac.washington.edu/alpine/%{name}-%{version}.tar.gz
# Source with applied patches from http://staff.washington.edu/chappa/alpine/
Source0: http://staff.washington.edu/chappa/alpine/patches/alpine-%{ver}/%{name}-%{ver}_%{patchlevel}.tar.gz
-# Source0-md5: 77953f8d0fc7f8b2d0aa3787bb0982de
+# Source0-md5: 055a67734af8190a709949f40211c3ed
Source1: pico.desktop
Source2: %{name}.desktop
Source3: %{name}.png
-Patch0: %{name}-thread_end.patch
-Patch1: %{name}-index_display.patch
+Patch0: %{name}-index_display.patch
+Patch1: %{name}-doc.patch
+Patch2: %{name}-filter.patch
+Patch3: %{name}-quote.patch
+Patch4: %{name}-fhs.patch
+Patch5: %{name}-segfix.patch
+Patch6: %{name}-libc-client.patch
+Patch7: %{name}-fixhome.patch
+Patch8: %{name}-ssl.patch
+Patch9: %{name}-no_1777_warning.patch
+Patch10: %{name}-home_etc.patch
URL: http://www.washington.edu/alpine/
BuildRequires: autoconf
BuildRequires: automake
+BuildRequires: home-etc-devel
BuildRequires: krb5-devel
BuildRequires: ncurses-devel
-BuildRequires: openldap-devel
+BuildRequires: openldap-devel >= 2.4.6
BuildRequires: openssl-devel
BuildRequires: pam-devel
-# Only for web-frontend
-BuildRequires: tcl-devel
+# Only for web-frontend:
+#BuildRequires: tcl-devel
+Obsoletes: pine
+Provides: pine = 4.98
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define alpineconfdir /etc/%{name}
+%define filterout_ld -Wl,--as-needed
%description
Alpine -- an Alternatively Licensed Program for Internet News & Email
%setup -q -n %{name}-%{ver}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
%build
-%{__autoconf}
+rm -f libtool missing
+%{__libtoolize}
%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
%{__automake}
%configure \
--enable-quotas \
+ --without-tcl \
--with-smtp-msa=%{_libdir}/sendmail \
--with-spellcheck-prog=aspell \
--with-system-pinerc=%{alpineconfdir}/%{name}.conf \
--with-system-fixed-pinerc=%{alpineconfdir}/%{name}.conf.fixed \
--with-krb5-dir=%{_prefix} \
--with-ldap-dir=%{_prefix} \
- --with-system-mail-directory=/var/mail
-%{__make}
+ --with-system-mail-directory=/var/mail \
+ --with-passfile=.pine.pwd
+
+%{__make} \
+ GCCOPTLEVEL="%{rpmcflags}"
%install
rm -rf $RPM_BUILD_ROOT
install %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}
install %{SOURCE3} $RPM_BUILD_ROOT%{_pixmapsdir}
+ln -s alpine $RPM_BUILD_ROOT%{_bindir}/pine
+
+$RPM_BUILD_ROOT%{_bindir}/alpine -conf > $RPM_BUILD_ROOT%{alpineconfdir}/alpine.conf
+cat <<EOF > $RPM_BUILD_ROOT%{alpineconfdir}/alpine.conf.fixed
+#
+# Alpine system-wide enforced configuration file - customize as needed
+#
+# This file holds the system-wide enforced values for alpine configuration
+# settings. Any values set in it will override values set in the
+# system-wide default configuration file (%{alpineconfdir}/alpine.conf) and
+# the user's own configuration file (~/.pinerc).
+# For more information on the format of this file, read the
+# comments at the top of %{alpineconfdir}/alpine.conf
+
+EOF
+
%clean
rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc README doc/tech-notes.txt
%dir %{alpineconfdir}
+%config(noreplace) %verify(not md5 mtime size) %{alpineconfdir}/alpine.conf
+%config(noreplace) %verify(not md5 mtime size) %{alpineconfdir}/alpine.conf.fixed
%attr(755,root,root) %{_bindir}/%{name}
+%attr(755,root,root) %{_bindir}/pine
%attr(755,root,root) %{_bindir}/rpload
%attr(755,root,root) %{_bindir}/rpdump
%{_mandir}/man1/%{name}.1*