%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Summary:        Python bindings for libnotify
Summary(ja):    libnotify の python バインディング

Name:           notify-python
Version:        0.1.1
Release:        6%{?_dist_release}

Group:          System Environment/Libraries
# No version specified, just COPYING.
License:        LGPLv2+
URL:            http://www.galago-project.org/specs/notification
Source0:        http://www.galago-project.org/files/releases/source/notify-python/notify-python-%{version}.tar.gz
Patch0:		libnotify07.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

BuildRequires:  python-devel, pkgconfig, libnotify-devel, pygtk2-devel
BuildRequires:  gtk2-devel, dbus-devel, dbus-glib-devel

Requires:   libnotify
Requires:   notification-daemon

Vendor: Project Vine
Distribution: Vine Linux

%define pypkgname pynotify

%description
Python bindings for libnotify

%prep
%setup -q
%patch0 -p1 -b .libnotify07

# WARNING - we touch src/pynotify.override in build because upstream did not rebuild pynotify.c
# from the input definitions, this forces pynotify.c to be regenerated, at some point this can be removed

%build
CFLAGS="$RPM_OPT_FLAGS"
PYTHON=%{__python}
%configure
touch src/pynotify.override
make

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
# remove unnecessary la file
rm $RPM_BUILD_ROOT/%{python_sitearch}/gtk-2.0/%{pypkgname}/_%{pypkgname}.la

 
%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc
%{python_sitearch}/gtk-2.0/%{pypkgname}
%{_datadir}/pygtk/2.0/defs/%{pypkgname}.defs
%{_libdir}/pkgconfig/%{name}.pc

%changelog
* Mon Jan 26 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.1.1-6
- moved main package to System Environment/Libraries Group

* Thu Feb 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.1.1-5
- rebuild with python-2.7.2

* Sun Aug 14 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.1.1-4
- rebuild with libnotify-0.7.2
- add Patch0 (libnotify07.patch) from fedora

* Sat Oct 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.1.1-3
- rebuilt with rpm-4.8.1 for pkg-config

* Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.1.1-2
- rebuild with python-2.6

* Mon Nov 10 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 0.1.1-1
- initial build for Vine Linux

* Mon Aug 11 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.1.1-4
- fix license tag

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.1.1-3
- Autorebuild for GCC 4.3

* Fri Jan  4 2008  <jdennis@redhat.com> - 0.1.1-2
- Resolves bug# 427499: attach_to_status_icon not created
  force regeneration of pynotify.c

* Wed Jan  2 2008 John Dennis <jdennis@redhat.com> - 0.1.1-1
- upgrade to current upstream
- no longer remove package config file (notify-python.pc), resolves bug #427001

* Thu Dec  7 2006 Jeremy Katz <katzj@redhat.com> - 0.1.0-4
- rebuild for python 2.5

* Tue Aug 15 2006 Luke Macken <lmacken@redhat.com> - 0.1.0-3
- Add notify-python-0.1.0-attach_to_status_icon.patch to allow the attaching
  notifications to status icons.

* Thu Jul 20 2006 John Dennis <jdennis@redhat.com> - 0.1.0-2
- change use of python_sitelib to python_sitearch, add BuildRequires

* Wed Jul 19 2006 John Dennis <jdennis@redhat.com> - 0.1.0-1
- Initial build