%define name dillo
%define realversion 0.8.4
%define version 0.8.4
%define release 2
#################################################################################
# Identify which distribution we're building on.
# This will determine any changes in menu structure or release number (i.e. .mdk)
# Eventually, need to make this configurable from the rpmbuild command line.
%define freedesktop %(if [ -e /usr/share/applications ]; then echo 1; else echo 0; fi;)
%{?_with_freedesktop: %{expand: %%global freedesktop 1}}
%define conectiva %(if [ -e /etc/conectiva-release ]; then echo 1; else echo 0; fi;)
%{?_with_conectiva: %{expand: %%global conectiva 1}}
%define mdk %(if [ -e /etc/mandrake-release ]; then echo 1; else echo 0; fi;)
%{?_with_mdk: %{expand: %%global mdk 1}}
%define suse %(if [ -e /etc/SuSE-release ]; then echo 1; else echo 0; fi;)
%define oldsuse 0
%if %{suse}
%define oldsuse %(if [ `grep VERSION /etc/SuSE-release | sed -e "s/VERSION = //"` \\< 8.0 ]; then echo 1; else echo 0; fi;)
%endif
%{?_with_suse: %{expand: %%global suse 1}}
%define oldredhat %(if [ -e /etc/redhat-release ]; then echo 1; else echo 0; fi;) && !%{mdk} && !%{suse} && !%{conectiva} && !%{freedesktop}
%{?_with_oldredhat: %{expand: %%global oldredhat 1}}
%define plain !%{mdk} && !%{suse} && !%{conectiva} && !%{oldredhat} && !%{freedesktop}
%define subversion %{release}
%if %{mdk}
%define subversion %{release}.mdk
%endif
%if %{conectiva}
%define subversion %{release}cl
%endif
#################################################################################
Name: %{name}
Summary: Lightweight web browser
Version: %{version}
Release: %{subversion}
Copyright: GPL
Source0: http://www.dillo.org/download/dillo-%{realversion}.tar.bz2
Source1: dillo.desktop
Source2: dillo.png
Patch5: dillo-remote-0.8.4.patch
URL: http://www.dillo.org/
Packager: Hyperborea
Buildroot: /var/tmp/%{name}-%{version}-buildroot
Group: Applications/Internet
Provides: webclient
#################################################################################
# GTK Dependencies
%if %{mdk}
BuildRequires: libgtk+-devel >= 1.2.0
%endif
%if %{suse}
BuildRequires: gtk-devel >= 1.2.0
%endif
%if !%{suse} && !%{mdk}
BuildRequires: gtk+-devel >= 1.2.0
%endif
# XFree86 dependencies. Should be covered by dependency on GTK+ except
# under old SuSE releases.
%if %{oldsuse}
BuildRequires: xdevel
%else
BuildRequires: libpng-devel >= 1.0
BuildRequires: libjpeg-devel
%endif
# Other dependencies. DPIs for FTP, HTTPS, downloading require wget.
Requires: wget
# Autoconf/Automake - needed for CVS and some patched versions
# (Uncomment these further below as well)
#BuildRequires: autoconf
#BuildRequires: automake
#################################################################################
%description
What's Dillo?
* Dillo is a web browser project completely written in C.
* Dillo is small: source is less than 420 KB, and the binary is around 350 KB!
* Dillo aims to be a multi-platform browser alternative that's small, stable,
developer-friendly, usable, fast, and extensible.
* Dillo is mainly based on GTK+ (GNOME is NOT required!)
* Dillo is a free-SW project in the terms of the GNU general public license.
* Dillo's bug meter is a tool to help towards standards compliance.
* Current code uses an improved html-parser (formerly based on gzilla's), and
almost everything else was rewritten from scratch!.
* Dillo is very fast!
#################################################################################
%prep
%setup -n dillo-%{realversion}
%patch5 -p1
# Avoid autoconf compatibility problems
#aclocal
#autoheader
#autoconf
#automake -a
#################################################################################
%build
./configure --prefix=/usr --sysconfdir=/etc
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
#################################################################################
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/usr/share/applications
mkdir -p $RPM_BUILD_ROOT/usr/share/icons
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
mkdir -p $RPM_BUILD_ROOT/usr/X11R6/share/icons/png/hicolor/misc/apps
mkdir -p $RPM_BUILD_ROOT/etc/X11/applnk/Internet
mkdir -p $RPM_BUILD_ROOT/etc/X11/susewm/AddEntrys/SuSE/Internet/WWW
%if %{mdk} || %{conectiva}
mkdir -p $RPM_BUILD_ROOT%{_menudir}
%endif
make install-strip DESTDIR=$RPM_BUILD_ROOT
######################################
%if %{mdk}
# Mandrake/Conectiva menu & icon
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/icons/dillo.png
cat << EOF > $RPM_BUILD_ROOT%{_menudir}/dillo
?package(dillo): icon="dillo.png" needs="x11" section="Networking/WWW" title="Dillo" longtitle="A compact web browser" mimetypes="text/html" accept_url="true" multiple_files="false" command="/usr/bin/dillo" startup_notify="true"
EOF
%endif
%if %{conectiva}
# Mandrake/Conectiva menu & icon
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/icons/dillo.png
cat << EOF > $RPM_BUILD_ROOT%{_menudir}/dillo
?package(dillo): icon="dillo.png" needs="x11" section="Internet" title="Dillo" longtitle="A compact web browser" mimetypes="text/html" accept_url="true" multiple_files="false" command="/usr/bin/dillo" startup_notify="true"
EOF
%endif
%if %{freedesktop}
# Freedesktop menu & icon
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/usr/share/applications/hyperborea-dillo.desktop
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/pixmaps/dillo.png
%endif
%if %{suse} && !%{freedesktop}
# SuSE menu & icon
# This location looks like it should work, but I'm not sure if it's appropriate
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/X11/susewm/AddEntrys/SuSE/Internet/WWW/dillo.desktop
# I'm not sure if this is the right place (based on the 'icons' package)
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/X11R6/share/icons/png/hicolor/misc/apps
%endif
%if %{oldredhat}
# Old-style Red Hat menu & icon
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/X11/applnk/Internet/dillo.desktop
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/pixmaps/dillo.png
%endif
######################################
mv doc developers
rm -f developers/Makefile*
#################################################################################
%clean
rm -rf $RPM_BUILD_ROOT
#################################################################################
# Reload Mandrake/Conectiva Menus
%if %{mdk} || %{conectiva}
%post
%{update_menus}
%postun
%{clean_menus}
%endif
#################################################################################
%files
%defattr(-,root,root)
%doc README COPYING AUTHORS NEWS ChangeLog developers
%config /etc/dillorc
%config /etc/dpidrc
/usr/bin/dillo
/usr/bin/dpid
/usr/bin/dpidc
/usr/lib/dillo
######################################
%if %{mdk} || %{conectiva}
# Mandrake/Conectiva menu & icon
/usr/share/icons/dillo.png
%{_menudir}/dillo
%endif
%if %{freedesktop}
# Freedsktop menu & icon
/usr/share/pixmaps/dillo.png
/usr/share/applications/hyperborea-dillo.desktop
%endif
%if %{suse} && !%{freedesktop}
# SuSE menu & icon
/etc/X11/susewm/AddEntrys/SuSE/Internet/WWW/dillo.desktop
/usr/X11R6/share/icons/png/hicolor/misc/apps/dillo.png
%endif
%if %{oldredhat}
# Old-style Red Hat menu & icon
/usr/share/pixmaps/dillo.png
/etc/X11/applnk/Internet/dillo.desktop
%endif
#################################################################################
%changelog
* Thu Jan 13 2005 Kelson Vibber
- Updated remote-control patch (there seems to be some interest)
* Tue Jan 11 2005 Kelson Vibber
- Upgrade to 0.8.4
- Includes security fix for CAN-2005-0012
- Update the RPM description
* Mon Oct 25 2004 Kelson Vibber
- Upgrade to 0.8.3
- First try at making distro layout configurable
* Tue Jul 6 2004 Kelson Vibber
- Upgrade to 0.8.2
* Sat May 15 2004 Kelson Vibber
- Upgrade to 0.8.1
* Thu Apr 1 2004 Kelson Vibber
- Remove explicit Requires: for XFree86 (many distros are moving to other
X implementations)
- Remove all Requires: for libraries, since RPM will take care of this
automatically. (Cleaner spec, fewer probs w/ renaming/replacing packages)
* Sun Feb 8 2004 Kelson Vibber
- Update to release 0.8.0
- Switch to freedesktop.org menu where appropriate
* Tue Feb 3 2004 Kelson Vibber
- make changes for building current CVS version in preparation for 0.8.0
- only create _menudir on distributions that define it
- use DESTDIR instead of changing prefix on make install
- remove configure patch (now merged in)
* Sun Oct 12 2003 Kelson Vibber
- move prefix settings from configure to install.
- correct menu structure for Conectiva
- check for versions of SuSE <= 7.3 that use different package names
and include development headers in libpng and libjpeg
- tidied & commented spec file
* Sat Oct 04 2003 Kelson Vibber
- add build dependency on XFree86-devel.
- remove libpng dependency for Conectiva because they rename their packages;
rely on library dependencies instead
* Mon Sep 01 2003 Kelson Vibber
- check for presence of libjpeg
* Tue Aug 12 2003 Kelson Vibber
- patch to compile on SuSE 8.1. Shouldn't affect RH <= 9 or Mdk <= 9.1
* Wed Aug 06 2003 Kelson Vibber
- attempt to build for Conectiva
* Tue Aug 05 2003 Kelson Vibber
- update to 0.7.3
* Thu Jul 24 2003 Kelson Vibber
- modified to account for limitations in nested if macros in
some versions of RPM (such as that shipped with Mandrake 8.2)
* Thu Jun 26 2003 Kelson Vibber
- patch to update links to use www.dillo.org
- modified to build for SuSE (but manu/icon may need adjustment)
* Mon Jun 23 2003 Kelson Vibber
- modified to build for Mandrake Linux menus and auto-detect Mandrake/Red Hat
* Tue May 6 2003 Kelson Vibber
- minor fix to dillo.desktop file
* Tue Apr 29 2003 Kelson Vibber
- Update to 0.7.2, separated patched/vanilla versions
* Thu Feb 27 2003 Kelson Vibber
- Added patch to fix loss of bookmarks.
* Mon Feb 17 2003 Kelson Vibber
- Start from scratch for 0.7.0 release. Melvin Hadasht's patches have been
incorporated into the main tree. The remote and encodings patches are now
out of date; I'll put them back in when they catch up or when I have a
chance to update them myself.
* Fri Nov 22 2002 Kelson Vibber
- Updated localization patches to work with /etc/dillo.encodings
* Wed Oct 16 2002 Kelson Vibber
- Added localization patches from http://bobuk.ipost.ru/packages/dillo/
* Tue Oct 15 2002 Kelson Vibber
- Added new version of Melvin Hadasht's patch
* Tue Sep 17 2002 Kelson Vibber
- Added icon
- Added patch for Mosaic-style remote control from http://xemacs.seanm.ca/
- Added combined command-line help, full-window, local-only and embeddable
patches from http://melvin.hadasht.free.fr/home/index.html
* Sun Sep 15 2002 Kelson Vibber
- First version of RPM spec