File gtkextra2.spec of Package gtkextra2

#
# spec file for package gtkextra2
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#

# norootforbuild

%define realname gtk+extra

Name:		gtkextra2
Version:	2.1.2
Release:	1
Summary:	Additional Widget Library for GTK
Source:		http://prdownloads.sourceforge.net/scigraphica/gtk+extra-%{version}.tar.bz2
Patch0:		configure-genmarshal.patch
Patch1: 	gtkitementry-gtk2.21.patch
Patch2:		fedora17.patch
Patch3:		%{name}-configure-ac.patch
Url:	 	http://gtkextra.sourceforge.net/
Group:		System/Libraries
License:	LGPL-3.0
BuildRequires:	gtk2-devel glib2-devel pkgconfig pcre-devel
BuildRequires:	gtk-doc intltool libtool
Vendor:		openSUSE-Education
BuildRoot:	%{_tmppath}/build-%{name}-%{version}

%description
%{name} is a library with additional wigets for GTK.
 
%package -n libgtkextra-x11-2_0-1
Summary:	Shared libraries from %name
Group:		Development/Libraries/C and C++
Obsoletes:	%name < %{version}
Provides:	%name = %{version}-%{release}

%description -n libgtkextra-x11-2_0-1
Shared libraries from %name for GTK wigets.

 
%package devel
Summary:	Additional Widget Library for GTK
Group:		Development/Libraries/C and C++
Requires:	gtk2-devel glib2-devel pango-devel atk-devel 
Requires:	cairo-devel fontconfig-devel freetype2-devel
%if ! 0%{?centos_version}
Requires:	gdk-pixbuf-devel
%endif
Requires:	%name = %{version}-%{release}
 
%description devel
%{name} is a library with additional wigets for GTK.

This package contains development files (headers, shared library links)
and is only needed to build applications with %{name}
It is not needed at runtime.
 
 
%package docs
Summary:        Documentation files for gtkextra2
Group:          Development/Libraries/C and C++
%if 0%{?suse_version}
Recommends:     %{name} = %{version}
%endif

%description docs
GtkExtra is a library with additional wigets for GTK.
 
This package contains extra documentation files:
* a reference and a 
* tutorial
 
 
Authors:
--------
    Adrian E. Feiguin <adrian@ifir.ifir.edu.ar>
 
%prep
%setup -q -n "gtk+extra-%{version}"
chmod a-x ChangeLog
sed -i 's/\r//' docs/{gtk*.ChangeLog,HELP,README,TODO,VERSION}
sed -i 's/\r//' docs/reference/*.html
sed -i 's/\r//' docs/tutorial/{*.html,gtksheet/*.{c,html}}

%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build

#autoreconf -fiv
libtoolize -f
autoreconf -i

# CentOS fails without this
mkdir -p m4

%configure --disable-static --with-pic

# on openSUSE 11.4, make faults over spaces instead of tabs
find . -name Makefile -exec sed -i.bal -e 's/^        /\t/' {} \;

# this file is not correctly remade
rm gtkextra/gtkextra-marshal.h
echo 'VOID:INT,BOXED' >> gtkextra/gtkextra-marshal.list

%__make %{?jobs:-j%{jobs}}
 
%install
%makeinstall
%__install -D -m 0644 gtkextra-2.0.m4 "%{buildroot}%{_datadir}/aclocal/gtkextra-2.0.m4"
chmod 0644 AUTHORS ChangeLog COPYING README
mkdir -p %{buildroot}%{_datadir}/doc/%name
cp -r docs/tutorial %{buildroot}%{_datadir}/doc/%name/
 
cat > %{buildroot}%{_datadir}/doc/%name/index.html << EOF
<HTML>
<HEAD>
<TITLE>GTK+ Reference Manual</TITLE>
</HEAD>
<BODY CLASS="BOOK" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF">
    <table width="100%" border="1">
      <tr>
        <td bgcolor="#000000"><div align="center"><a href="reference/index.html">GTK+EXTRA Reference Manual</a></div></td>
      </tr>
      <tr>
        <td bgcolor="#000000"><div align="center"><a href="tutorial/index.html">GTK+EXTRA Tutorial</a></div></td>
      </tr>
    </table>
</BODY>
</HTML>
EOF
 
%clean
%__rm -rf "%{buildroot}"
 
%post   -n libgtkextra-x11-2_0-1 -p /sbin/ldconfig
%postun -n libgtkextra-x11-2_0-1 -p /sbin/ldconfig
 
%files -n libgtkextra-x11-2_0-1
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING README
%{_libdir}/libgtkextra-x11-2.0.so.*
 
%files docs
%defattr(0644,root,root,0755)
%doc docs/COPYING docs/HELP docs/README docs/TODO docs/VERSION docs/*ChangeLog
%dir %{_datadir}/doc/gtkextra2
%doc %{_datadir}/doc/gtkextra2/*
%doc %{_datadir}/gtk-doc/html/gtkextra

%files devel
%defattr(-,root,root)
%{_includedir}/gtkextra-2.0
%{_libdir}/libgtkextra-x11-2.0.so
%{_libdir}/libgtkextra-x11-2.0.la
%{_libdir}/pkgconfig/gtkextra-2.0.pc
%{_datadir}/aclocal/gtkextra-2.0.m4

%changelog
openSUSE Build Service is sponsored by