# to activate, add --with mono to rpmbuild
%bcond_with mono

Summary: Library for the GNOME Bluetooth Subsystem
Summary(ja): GNOME Bluetooth サブシステム用ライブラリ
Name: libbtctl
Version: 0.11.1
Release: 2%{?_dist_release}
License: GPLv2+ and LGPLv2.1+
Group: System Environment/Libraries
URL: http://live.gnome.org/GnomeBluetooth 

Source0: http://ftp.gnome.org/pub/gnome/sources/libbtctl/0.11/%{name}-%{version}.tar.bz2
Patch5: libbtctl-0.11.1-lib64.patch
# Vine Patch
# to build with openobex 1.7.1
Patch100: libbtctl-0.11.1-unicode.patch

ExcludeArch: s390 s390x
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: autoconf automake libtool gettext intltool
BuildRequires: bluez-libs-devel
BuildRequires: glib2-devel
BuildRequires: gtk-doc
BuildRequires: gtk2-devel
BuildRequires: openobex-devel
BuildRequires: pygtk2-devel
BuildRequires: python
BuildRequires: python-devel

%if %{with mono}
BuildRequires: mono-devel gtk-sharp-gapi gtk-sharp
%endif

Packager: babasaki

%description
Library for the GNOME Bluetooth Subsystem

%description -l ja
GNOME Bluetooth サブシステム用ライブラリです。


%package devel
Summary: Development files for libbtctl
Summary(ja): libbtctl の開発用ファイル
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: glib2-devel

%description devel
This package contains the files needed for developing applications,
which use libbtctl.

%description devel -l ja
libbtctl を使用するアプリケーション開発に必要なファイルを含んでいます。


%prep
%setup -q
%ifarch x86_64
%patch5 -p0 -b .lib64
%endif

%patch100 -p1 -b .unicode

%build
autoreconf -fiv

%if %{with mono}
%configure --disable-static
%else
%configure --disable-mono --disable-static
%endif

make 


%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

# we do not want .la files
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT/%{python_sitearch}/*.la
%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 AUTHORS ChangeLog NEWS README 
%{_libdir}/lib*.so.*
%{python_sitearch}/*btctl*
%if %{with mono}
%{_libdir}/mono/gac/btctl/*/btctl.dll
%{_libdir}/mono/libbtctl/btctl.dll
%{_datadir}/gapi/btctl-api.xml
%endif

%files devel
%defattr(-, root, root)
%{_libdir}/lib*.so
#%{_libdir}/lib*.a
%{_libdir}/pkgconfig/libbtctl.pc
%{_includedir}/libbtctl
%{_datadir}/gtk-doc/html/libbtctl
%if %{with mono}
%{_libdir}/pkgconfig/libbtctl-sharp.pc
%endif


%changelog
* Tue Nov 11 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.11.1-2
- added Patch100 to build with openobex-1.7.1

* Mon Oct 04 2010 Shu KONNO <owa@bg.wakwak.com> 0.11.1-1
- updated libbtctl to 0.11.1
- dropt Patch2: libbtctl-0.4.1-pydir.patch
- added Patch5: libbtctl-0.11.1-lib64.patch (on x86_64)
- uninstall *.a
- move "Maintainers:" to "packager:"
- spec in utf-8 (too)
- changed spec file name as vine style
- rebuilt with new environment and rpm-4.8.1

* Fri Oct 24  2008 Seiichirou Babasaki 0.10.0-6
- Update to 0.10.0 (VineSeed)
- added "# Maintainers: " comments.
- changed UTF-8 encode at libbtctl.vs.spec
- FedoraCore - LOGS
-- 0.10.0-5
- Rebuild with patch for BlueZ 4.x
-- 0.10.0-3
-- made doc subpackage to avoid conflict on multiarch env.
-- Resolves: #341931
-- 0.10.0-2
-- gcc43 rebuild
-- 0.10.0-1
-- Update to 0.10.0

* Wed Jan 16 2008 Seiichirou Babasaki 0.9.0-4
- Import bluez-libbtctl - Packager: Babasaki
- fixed wrong Source URL 
- Updated specfile

* Tue Sep 18 2007 - Ondrej Vasik <ovasik@redhat.com> - 0.9.0-3
- fixed wrong Source URL 

* Thu Aug 23 2007 - Ondrej Vasik <ovasik@redhat.com> - 0.9.0-2
- rebuilt for F8
- changed License tag to GPL+

* Thu Jul 12 2007 - Bastien Nocera <bnocera@redhat.com> - 0.9.0-1
- Update to 0.9.0
- Remove out-dated patches

* Wed Feb 28 2007 Harald Hoyer <harald@redhat.com> - 0.8.2-3%{?dist}
- specfile review
- portet crash patch to 0.8.2

* Thu Dec  7 2006 Jeremy Katz <katzj@redhat.com> - 0.8.2-2%{?dist}
- rebuild for python 2.5

* Mon Nov 13 2006 Harald Hoyer <harald@redhat.com> - 0.8.2-1%{?dist}
- version 0.8.2
- Resolves: rhbz#215230

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 0.6.0-9.1
- rebuild

* Wed Jun 14 2006 Harald Hoyer <harald@redhat.com> - 0.6.0-9
- rebuilt for openobex

* Sun Jun 11 2006 Jesse Keating <jkeating@redhat.com> - 0.6.0-8
- Bump for new libbluetooth

* Wed Jun  7 2006 Harald Hoyer <harald@redhat.com> - 0.6.0-7
- printf format corrected
- more build requires

* Wed May 17 2006 Harald Hoyer <harald@redhat.com> 0.6.0-6
- added more build requirements (bug #191981)

* Thu Feb 23 2006 Matthias Clasen <mclasen@redhat.com> 0.6.0-5
- try a fix for (#179413)

* Thu Feb 23 2006 Harald Hoyer <harald@redhat.com> 0.6.0-2
- rebuild

* Thu Feb 16 2006 Harald Hoyer <harald@redhat.com> 0.6.0-1
- version 0.6.0

* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 0.5.0-1.2.1
- bump again for double-long bug on ppc(64)

* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 0.5.0-1.2
- rebuilt for new gcc4.1 snapshot and glibc changes

* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt

* Wed Sep 28 2005 Harald Hoyer <harald@redhat.com> 0.5.0-1
- new version 0.5.0

* Tue Jul 19 2005 Harald Hoyer <harald@redhat.com> 0.4.1-8
- added gtk2-devel to BuildRequires

* Thu Apr 21 2005 Harald Hoyer <harald@redhat.com> 0.4.1-7
- rebuild with requires python-abi

* Wed Mar 30 2005 Warren Togami <wtogami@redhat.com> 0.4.1-6
- devel req glib2-devel for pkgconfig (#152497)

* Wed Mar 02 2005 Harald Hoyer <harald@redhat.com> 
- rebuilt

* Wed Feb 09 2005 Harald Hoyer <harald@redhat.com>
- rebuilt

* Fri Oct 08 2004 Harald Hoyer <harald@redhat.de> 0.4.1-3
- buildrequires pygtk2-devel

* Fri Sep 24 2004 Harald Hoyer <harald@redhat.de> 0.4.1-2
- split out devel package
- require openobex >= 1.0.1
- patch for lib64 python path

* Thu Jul 22 2004 Harald Hoyer <harald@redhat.de> 0.4.1-1
- version 0.4.1

* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue May 25 2004 Harald Hoyer <harald@redhat.de> 0.3-6
- buildrequire bluez-libs-devel and glib2-devel

* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Tue Aug  5 2003 Harald Hoyer <harald@redhat.de> 0.3-4
- make shared library

* Tue Aug  5 2003 Harald Hoyer <harald@redhat.de> 0.3-3
- BuildRequires bluez-sdp

* Tue Jun 24 2003 Harald Hoyer <harald@redhat.de> 0.3-2
- exclude arch s390

* Wed Jun  5 2003 Harald Hoyer <harald@redhat.de> 0.3-1
- initial RPM


