Name:           libdesktop-agnostic
Version:        0.3.92
Release:        2%{?_dist_release}
Summary:        Provides an extensible configuration API

Group:          System Environment/Libraries
License:        GPLv2+ and LGPLv2+
URL:            https://launchpad.net/libdesktop-agnostic
Source0:        http://launchpad.net/libdesktop-agnostic/0.4/%{version}/+download/%{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  pygtk2-devel
BuildRequires:  python-devel
BuildRequires:  gobject-introspection-devel
BuildRequires:  GConf2-devel
BuildRequires:  vala
BuildRequires:  gtk+-devel
BuildRequires:  gnome-desktop-devel
BuildRequires:  glade3-devel
BuildRequires:  gettext
BuildRequires:  intltool

%description
This library provides an extensible configuration API.
A unified virtual file system API, and a desktop item editor.

%package        bin
Summary:        Helper applications for %{name}
Group:          Applications/System
Requires:       %{name} = %{version}-%{release}

%description bin
This package contains helper applications for libdesktop-agnostic, such as a 
schema converter.

%package        -n python-desktop-agnostic
Summary:        Python bindings for %{name}
Group:		Development/Languages
Requires:       %{name} = %{version}-%{release}

%description    -n python-desktop-agnostic
This package contains the Python bindings for the core library.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:	pkgconfig

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
%setup -q
sed -i "s/gladeui-1.0/gladeui-2.0/g" data/wscript


%build
export CFLAGS="%{optflags}"
PYTHONDIR=%{python_sitearch} ./waf configure \
      --prefix=%{_prefix} \
      --libdir=%{_libdir} \
      --sysconfdir=%{_sysconfdir} \
      --enable-debug \
      --config-backends=gconf \
      --vfs-backends=gio \
      --desktop-entry-backends=glib \
      --with-glade \
      --disable-gi
./waf -v build

%install
rm -rf $RPM_BUILD_ROOT
DESTDIR=$RPM_BUILD_ROOT ./waf install

# install man files
#mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
#install -D -p -m 0644 debian/lda*1 $RPM_BUILD_ROOT%{_mandir}/man1

# fix permissions so debuginfo is stripped from .so files
find $RPM_BUILD_ROOT%{_libdir} -name *.so -exec chmod 755 {} \;

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc COPYING COPYING.GPL-2 debian/changelog
%config(noreplace) %{_sysconfdir}/xdg/libdesktop-agnostic/desktop-agnostic.ini
%{_libdir}/*.so.*
%dir %{_libdir}/desktop-agnostic
%dir %{_libdir}/desktop-agnostic/modules
%{_libdir}/desktop-agnostic/modules/libda-*.so

%files bin
%defattr(-,root,root,-)
%{_bindir}/lda-desktop-entry-editor
%{_bindir}/lda-schema-to-gconf
#%{_mandir}/man1/lda*1.gz

%files -n python-desktop-agnostic
%defattr(-,root,root,-)
%dir %{python_sitearch}/desktopagnostic
%{python_sitearch}/desktopagnostic/__init__.p*
%{python_sitearch}/desktopagnostic/*.so

%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_datadir}/pygtk/2.0/defs/desktopagnostic*defs
%{_datadir}/vala/vapi/desktop-agnostic*
%{_datadir}/glade/catalogs/desktop-agnostic.xml
%{_libdir}/pkgconfig/desktop-agnostic.pc
%{_libdir}/*.so


%changelog
* Wed Feb 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.3.92-2
- rebuild with python-2.7.2

* Mon Mar 14 2011 Kazutaka HARADA <kazutaka@vinelinux.org> 0.3.92-1
- initial build for Vine Linux based on fedora development

* Wed Feb 09 2011 Leigh Scott <leigh123linux@googlemail.com> - 0.3.90-13
- merge all upstream changes
- add disable gi
- add Br intltool gettext

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.90-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Mon Dec 06 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.90-11
- rebuilt

* Sat Jul 31 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> - 0.3.90-10
- Hack to fool the builder the .gir file version. May need real fix.
- Comment out BR: waf

* Fri Jul 23 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.90-9
- drop Br gir-repository-devel

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.3.90-8
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Sat Apr 24 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.90-7
- fix mistake in spec file

* Mon Apr 19 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.90-6
- merge the remaining sub-package libs into the main package

* Thu Apr 15 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.90-5
- merge gir sub-package into main package
- fix license tag

* Thu Apr 15 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.90-4
- make recommended review changes

* Thu Apr 15 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.90-3
- add requires pkgconfig to devel package
- drop unwanted sub-packages

* Mon Apr 12 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.90-2
- move vala package and python defs to devel

* Mon Apr 12 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.90-1
- update to 0.3.90

* Tue Mar 30 2010 leigh scott <leigh123linux@googlemail.com> - 0.3.9-bzr383.01
- inital build
