# Note that this is NOT a relocatable package
# DON'T FORGET TO UPDATE THE MOZILLA DEPENDENCY
%define ver      @VERSION@
%define rel      1
%define prefix   /usr
%define sysconfdir	/etc

Summary:   Galeon
Name:      galeon
Version:   %ver
Release:   %rel
Copyright: GPL
Group:     Applications/Internet
Source:    galeon-%{PACKAGE_VERSION}.tar.gz
URL:       http://galeon.sourceforge.net
BuildRoot: /tmp/galeon-%{PACKAGE_VERSION}-root
Packager:  Marco Pesenti Gritti <mpeseng@tin.it>
Autoreq: 0
BuildRequires: 	gettext >= 0.10.38
BuildRequires:	mozilla-devel = @MOZILLA_REQUIRED@
BuildRequires:	glib-devel
BuildRequires:	gtk+-devel >= @GTK_REQUIRED@
BuildRequires:	libxml-devel >= @LIBXML_REQUIRED@
BuildRequires:	gnome-libs-devel >= @GNOME_LIBS_REQUIRED@
BuildRequires:	GConf-devel >= @GCONF_REQUIRED@
BuildRequires:	ORBit-devel >= @ORBIT_REQUIRED@
BuildRequires:	oaf-devel >= @OAF_REQUIRED@
BuildRequires:	gnome-vfs-devel >= @GNOME_VFS_REQUIRED@
BuildRequires:	gdk-pixbuf-devel >= @GDK_PIXBUF_REQUIRED@
BuildRequires:	libglade-devel >= @LIBGLADE_REQUIRED@
Requires:	glib
Requires:       gtk+ >= @GTK_REQUIRED@
Requires:       libxml >= @LIBXML_REQUIRED@
Requires:       gnome-libs >= @GNOME_LIBS_REQUIRED@
Requires:       GConf >= @GCONF_REQUIRED@
Requires:       ORBit >= @ORBIT_REQUIRED@
Requires:       oaf >= @OAF_REQUIRED@
Requires:       gnome-vfs >= @GNOME_VFS_REQUIRED@
Requires:       gdk-pixbuf >= @GDK_PIXBUF_REQUIRED@
Requires: 	libglade >= @LIBGLADE_REQUIRED@
Requires: 	mozilla = @MOZILLA_REQUIRED@

%description
Galeon is a web browser built around Gecko (Mozilla 's rendering engine) 
and Necko (Mozilla's networking engine). It's a GNOME web browser, 
designed to take advantage of as many GNOME technologies as makes sense. 
Galeon was written to do just one thing - browse the web.
%prep
%setup

%build
if [ ! -f configure ]; then
	CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%{prefix} \
		--with-gnome --without-debug --sysconfdir=%{sysconfdir} \
		--disable-install-schemas
else
	CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} \
		--with-gnome --without-debug --sysconfdir=%{sysconfdir} \
		--disable-install-schemas
fi

if [ "$SMP" != "" ]; then
  (make "MAKE=make -k -j $SMP"; exit 0)
  make
else
  make
fi

%install
rm -rf $RPM_BUILD_ROOT

make prefix=$RPM_BUILD_ROOT%{prefix} sysconfdir=$RPM_BUILD_ROOT%{sysconfdir} install

%clean
rm -rf $RPM_BUILD_ROOT

%files

%defattr(0555, bin, bin, 755)

%doc AUTHORS COPYING COPYING.README ChangeLog NEWS README INSTALL THANKS TODO FAQ FAQ.html

%{_bindir}/galeon
%{_bindir}/galeon-bin
%{_bindir}/galeon-config-tool

%{_libdir}/galeon/components

%defattr (0444, bin, bin,755)
%config %{_sysconfdir}/gconf/schemas/galeon.schemas
%config %{_sysconfdir}/sound/events/galeon.soundlist 
%{_datadir}/gnome/apps/Internet/*.desktop
%{_datadir}/galeon
%{_datadir}/locale/*/LC_MESSAGES/*.mo
%{_datadir}/oaf/GNOME_Galeon_Automation.oaf
%{_datadir}/pixmaps/*
%{_datadir}/sounds/galeon

# FIXME I guess there is a better way
%{prefix}/man/man1/galeon.1*

%defattr (-, root, root)
%{_datadir}/gnome/help/*
%{_datadir}/omf/galeon/*

%post
%{_bindir}/galeon-config-tool --fix-gconf-permissions
%{_bindir}/galeon-config-tool --pkg-install-schemas
if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update; fi

%postun
if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update; fi

