# Set with_gtkspell to 1 compile with gtkspell, 0 to compile without
%define with_gtkspell 1

%{?_with_gtkspell: %{expand: %%define with_gtkspell 1}}
%{?_without_gtkspell: %{expand: %%define with_gtkspell 0}}

Summary:        The Pan newsreader
Name:           pan
Version:        0.14.0
Release:        1mdk90
Epoch:          1
License:        GPL
Group:          Networking/News
URL:            http://pan.rebelbase.com/
Vendor:         ChimPanXi
Source0:        http://pan.rebelbase.com/download/releases/%{version}/SOURCE/%{name}-%{version}.tar.bz2
Source2:        %{name}-32.png
Source3:        %{name}-16.png
Source4:        %{name}-48.png

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%if %{with_gtkspell}
BuildRequires:  libgtkspell-devel >= 2.0.2
%endif
BuildRequires:  glib2-devel >= 2.0.4
BuildRequires:  libgtk+2.0-devel >= 2.0.5
BuildRequires:  libxml2-devel >= 2.4.22
BuildRequires:  libgnet1.1-devel >= 1.1.5

Requires:       libxml2 >= 2.4.22
Requires:       libgnet >= 1.1.5
%if %{with_gtkspell}
Requires:       aspell
Requires:       libgtkspell0 >= 2.0.2
%endif

Provides: %{name}

%description
Pan is a newsreader, loosely based on Agent and Gravity, which attempts
to be pleasant to use for new and advanced users alike. It has all the
typical features found in newsreaders and also supports offline newsreading,
sophisticated filtering, multiple connections, and a number of extra features
for power users and alt.binaries fans.  It's also the only Unix newsreader
to get a perfect score on the Good Net-Keeping Seal of Approval evalutions.
See http://pan.rebelbase.com/features/ for the whole sales pitch.

%prep
rm -rf $RPM_BUILD_ROOT

%setup -q

%build

%configure2_5x \
%if %{with_gtkspell}
--enable-gtkspell
%else
--disable-gtkspell
%endif

%make

%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

%makeinstall_std

%{find_lang} %{name}

# Menu
mkdir -p $RPM_BUILD_ROOT%{_menudir}
cat >$RPM_BUILD_ROOT%{_menudir}/%{name} <<EOF
?package(%{name}): command="%{_bindir}/%{name}" needs="X11" \
icon="%{name}.png" section="Networking/News" \
title="Pan" longtitle="Read News from Usenet" \
startup_notify="yes"
EOF

#icon
install -d $RPM_BUILD_ROOT/%{_iconsdir}
install -d $RPM_BUILD_ROOT/%{_liconsdir}
install -d $RPM_BUILD_ROOT/%{_miconsdir}
cp -f %{SOURCE2} $RPM_BUILD_ROOT/%{_iconsdir}/%{name}.png
cp -f %{SOURCE3} $RPM_BUILD_ROOT/%{_miconsdir}/%{name}.png
# png is anti-aliased when put on the gnome panel
cp -f %{SOURCE4} $RPM_BUILD_ROOT/%{_liconsdir}/%{name}.png

%post
%{update_menus}

%postun
%{clean_menus}

%files -f %{name}.lang
%defattr(-,root,root)
%doc README ChangeLog AUTHORS TODO COPYING CREDITS
%attr(755,root,root) %{_bindir}/%{name}
%{_menudir}/%{name}
%{_iconsdir}/%{name}.png
%{_liconsdir}/%{name}.png
%{_miconsdir}/%{name}.png
%{_datadir}/gnome/apps/Internet/%{name}.desktop
%{_datadir}/pixmaps/*

%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

%changelog
* Tue May 06 2003 Torstein Sunde <[email protected]> 0.14.0-1mdk90
- Release 0.14.0

* Thu Apr 24 2003 Torstein Sunde <[email protected]> 0.13.96-1mdk90
- Release 0.13.96

* Tue Apr 22 2003 Torstein Sunde <[email protected]> 0.13.95-1mdk90
- Release 0.13.95

* Tue Apr 01 2003 Torstein Sunde <[email protected]> 0.13.93-1mdk90
- Release 0.13.93

* Mon Mar 24 2003 Torstein Sunde <[email protected]> 0.13.92-1mdk90
- Release 0.13.92

* Fri Mar 14 2003 Torstein Sunde <[email protected]> 0.13.91-1mdk90
- Release 0.13.91

* Fri Mar 07 2003 Torstein Sunde <[email protected]> 0.13.90-1mdk90
- Release 0.13.90

* Thu Feb 27 2003 Torstein Sunde <[email protected]> 0.13.4-1mdk90
- Release 0.13.4

* Thu Feb 13 2003 Torstein Sunde <[email protected]> 0.13.3.93-1mdk90
- Release 0.13.3.93

* Mon Feb 10 2003 Torstein Sunde <[email protected]> 0.13.3.92-1mdk90
- Release 0.13.3.92 built for Mandrake 9.0.
- Merged spec files from Mandrakesoft and pan.rebelbase.com.