# Note that this is NOT a relocatable package
%define ver      @VERSION@
%define rel      1

Summary:             Devhelp
Name:                devhelp
Version:             %ver
Release:             %rel
Copyright:           GPL
Group:               Applications/Development
Source:              devhelp-%{PACKAGE_VERSION}.tar.gz
BuildRoot:           /tmp/devhelp-%{PACKAGE_VERSION}-root
Packager:            Johan Dahlin <zilch.am@home.se>
Autoreq:             0

BuildRequires:       gettext >= 0.10.35
BuildRequires:       glib-devel >= @GLIB_REQUIRED@
BuildRequires:       gtk+-devel >= @GTK_REQUIRED@
BuildRequires:       gnome-libs-devel >= @GNOME_LIBS_REQUIRED@
BuildRequires:       gnome-print-devel >= @GNOME_PRINT_REQUIRED@
BuildRequires:       gnome-vfs-devel >= @GNOME_VFS_REQUIRED@
BuildRequires:       gdk-pixbuf-devel >= @GDK_PIXBUF_REQUIRED@
BuildRequires:       libxml-devel >= @LIBXML_REQUIRED@
BuildRequires:       libglade-devel >= @LIBGLADE_REQUIRED@
BuildRequires:       gtkhtml-devel >= @GTKHTML_REQUIRED@
BuildRequires:       ORBit-devel >= @ORBIT_REQUIRED@
BuildRequires:       oaf-devel >= @OAF_REQUIRED@
BuildRequires:       bonobo-devel >= @BONOBO_REQUIRED@ 
BuildRequires:       GConf-devel >= @GCONF_REQUIRED@
Requires:            glib >= @GLIB_REQUIRED@
Requires:            gtk+ >= @GTK_REQUIRED@
Requires:            gnome-libs >= @GNOME_LIBS_REQUIRED@ 
Requires:            gnome-print >= @GNOME_PRINT_REQUIRED@
Requires:            gnome-vfs >= @GNOME_VFS_REQUIRED@
Requires:            gdk-pixbuf >= @GDK_PIXBUF_REQUIRED@
Requires:            libxml >= @LIBXML_REQUIRED@
Requires:            libglade >= @LIBGLADE_REQUIRED@
Requires:            gtkhtml >= @GTKHTML_REQUIRED@
Requires:            ORBit >= @ORBIT_REQUIRED@
Requires:            oaf >= @OAF_REQUIRED@
Requires:            bonobo >= @BONOBO_REQUIRED@ 
Requires:            GConf >= @GCONF_REQUIRED@

%description
A developers help program
%prep
%setup

%build

if [ ! -f configure ]; then
	CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%{_prefix} \
		--sysconfdir=%{_sysconfdir} --without-debug \
		--disable-install-schemas
else
	CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix} \
		--sysconfdir=%{_sysconfdir} --without-debug \
		--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(-, root, root)

%doc AUTHORS COPYING ChangeLog NEWS README INSTALL

%{_bindir}/devhelp
%{_libdir}/libdevhelp.*

%config %{_sysconfdir}/gconf/schemas/devhelp.schemas
%{_datadir}/gnome/apps/Development/*.desktop
%{_datadir}/devhelp
%{_datadir}/locale/*/LC_MESSAGES/*.mo
%{_datadir}/oaf/GNOME_DevHelp.oaf
%{_datadir}/gnome/ui/GNOME_DevHelp.ui
%{_datadir}/gnome/ui/GNOME_DevHelp_Controller.ui
%{_datadir}/pixmaps/*
%{_datadir}/images/*

%post
# Fix gconf permissions
killall gconfd-1 2>/dev/null >/dev/null
chmod o+rX /etc/gconf -R

# Install schemas
gconftool-1 --shutdown
SOURCE=xml::/etc/gconf/gconf.xml.defaults
GCONF_CONFIG_SOURCE=$SOURCE�\
    gconftool-1 --makefile-install-rule \
    /etc/gconf/schemas/devhelp.schemas \
    2>/dev/null >/dev/null || exit 1
		

	
