%define name dillo
%define realversion 2.1.1
%define version 2.1.1
%define release 0%{?_with_ssl:.ssl}
#################################################################################
# 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 -E "VERSION = [1-7]\\." /etc/SuSE-release` ]; 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
#################################################################################
# Enable building with local FLTK library
%define localfltk 0
%{?_with_localfltk: %{expand: %%global localfltk 1}}
#################################################################################
Name: %{name}
Summary: Lightweight web browser
Version: %{version}
Release: %{subversion}
License: GPL
Source0: http://www.dillo.org/download/dillo-%{realversion}.tar.bz2
Source1: dillo.desktop
Source2: dillo.png
Patch1: dillo-local-fltk.patch
URL: http://www.dillo.org/
Packager: Hyperborea
Buildroot: /var/tmp/%{name}-%{version}-buildroot
Group: Applications/Internet
Provides: webclient
#################################################################################
# Build dependencies
# TODO: Add Xorg dependencies.
BuildRequires: libpng-devel >= 1.0
BuildRequires: libjpeg-devel
%if !%{localfltk}
# FLTK 2.x is still in development, but we're providing a SRPM for building.
BuildRequires: fltk2
%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)
%if %{localfltk}
BuildRequires: autoconf
BuildRequires: automake
%endif
#################################################################################
%description
What's Dillo?
* Dillo is a multi-platform graphical web browser known for its speed and
small size.
* Dillo is written in C and C++.
* Dillo is based on FLTK2, the Fast Light ToolKit.
* Dillo is free software made available under the terms of the GNU General
Public License (GPL3).
* Dillo strives to be friendly both to users and developers.
* Dillo helps web authors to comply with web standards by using the bug
meter.
#################################################################################
%prep
%setup -n dillo-%{realversion}
%if %{localfltk}
%patch1 -p0
# Avoid autoconf compatibility problems
aclocal
autoheader
autoconf
automake -a
%endif
#################################################################################
%build
./configure \
--prefix=/usr \
%{?_with_ssl: --enable-ssl } \
%{!?_with_ssl: --disable-ssl } \
--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/dillo
/usr/bin/dillo
/usr/bin/dpid
/usr/bin/dpidc
/usr/lib/dillo
/usr/share/man/man1/dillo.1.gz
######################################
%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
* Sat Jul 4 2009 Kelson Vibber
- update to 2.1.1
* Fri Jun 19 2009 Kelson Vibber
- updated to RC3, make ssl optional using --with-ssl
* Wed Jun 17 2009 Kelson Vibber
- enable ssl
* Tue Jun 16 2009 Kelson Vibber
- Update to Dillo 2.1, move config files to /etc/dillo, add man page
* Mon Oct 13 2008 Kelson Vibber
- First stab at update to Dillo 2.
* Thu Apr 27 2006 Kelson Vibber
- Apply patch to enable building against a locally-installed FLTK
* Wed Apr 26 2006 Kelson Vibber
- Upgrade to 0.8.6 final.
* Fri Mar 24 2006 Kelson Vibber
- Upgrade to 0.8.6-rc2.
- FLTK2 is not typically available to RPM, so provide option to disable the
downloads GUI when building by passing "--without fltk" to rpmbuild
- Fix autodetect problem with SuSE 10
* Mon Jun 20 2005 Kelson Vibber
- Rebuild with official 0.8.5 tarball to fix build problems on older Mandrake
* Thu Jun 16 2005 Kelson Vibber
- Upgrade to 0.8.5 using 0.8.5-rc1 tarball
* 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