#
# spec file for package libcddb-utils
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           libcddb-utils
# WARNING: Do not edit this auto generated file.
#%(sh %{_sourcedir}/libcddb_spec-prepare.sh %{_sourcedir} %{name})
# To break libcddb<->libcdio dependency loop, this package is built in two stages.
%define BUILD_CORE 0
%define BUILD_UTILS 1
%define _name libcddb
Version:        1.3.2
Release:        25.23
Url:            http://libcddb.sourceforge.net/
Summary:        CDDB Access Library Utilities
License:        LGPL-2.1+
Group:          Productivity/Multimedia/Other
%if %BUILD_CORE
# bug437293
%ifarch ppc64
Obsoletes:      libcddb-64bit
%endif
%endif
Source:         http://downloads.sourceforge.net/project/%{_name}/%{_name}/%{version}/%{_name}-%{version}.tar.bz2
Source1:        %{_name}_spec-prepare.sh
Source2:        baselibs.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libtool
BuildRequires:  pkgconf-pkg-config
%if %BUILD_UTILS
BuildRequires:  libcdio-devel
%if !%BUILD_CORE
BuildRequires:  libcddb-devel
%endif
%endif
Patch:          libcddb-no-examples.patch

%description
Libcddb is a library that implements the different protocols (CDDBP,
HTTP, and SMTP) to access data on a CDDB server (http://freedb.org). It
tries to be as cross-platform as possible.

%if %BUILD_UTILS
%if %BUILD_CORE

%package -n libcddb-utils
Summary:        CDDB Access Library Utilities
Group:          Productivity/Multimedia/Other

%description -n libcddb-utils
Libcddb is a library that implements the different protocols (CDDBP,
HTTP, and SMTP) to access data on a CDDB server (http://freedb.org). It
tries to be as cross-platform as possible.

%endif
%endif
%if %BUILD_CORE

%package -n libcddb2
Summary:        CDDB Access Library
Group:          System/Libraries
# bug437293
%ifarch ppc64
Obsoletes:      libcddb-64bit
%endif
#
Provides:       %{_name} = %{version}
#opensuse 10.3
Obsoletes:      %{_name} <= 1.3.0

%description -n libcddb2
Libcddb is a library that implements the different protocols (CDDBP,
HTTP, and SMTP) to access data on a CDDB server (http://freedb.org). It
tries to be as cross-platform as possible.

%package devel
Summary:        CDDB Access Library
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       libcddb2 = %{version}
# bug437293
%ifarch ppc64
Obsoletes:      libcddb-devel-64bit
%endif

%description devel
Libcddb is a library that implements the different protocols (CDDBP,
HTTP, and SMTP) to access data on a CDDB server (http://freedb.org). It
tries to be as cross-platform as possible.

%endif

%prep
%setup -q -n %{_name}-%{version}
%if !%BUILD_UTILS
%patch
%endif
%if !%BUILD_CORE
sed -i 's:\(\.\.\|\$(top_builddir)\)/[^/]*/lib\([^ ]*\)\.la:-l\2:g' */Makefile.am
%endif

%build
autoreconf -f -i
%configure\
	--disable-rpath\
	--disable-static\
	--with-pic
%if !%BUILD_CORE
cd examples
%endif
make %{?jobs:-j%jobs}

%install
%if !%BUILD_CORE
cd examples
%endif
make DESTDIR=$RPM_BUILD_ROOT install
%{__rm} -f %{buildroot}%{_libdir}/libcddb.la

%clean
rm -rf $RPM_BUILD_ROOT
%if %BUILD_UTILS

%files -n libcddb-utils
%defattr (-, root, root)
%{_bindir}/*
%endif
%if %BUILD_CORE

%post -n libcddb2 -p /sbin/ldconfig

%postun -n libcddb2 -p /sbin/ldconfig

%files -n libcddb2
%defattr (-, root, root)
%{_libdir}/*.so.2*

%files devel
%defattr (-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README THANKS TODO
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/cddb
%endif

%changelog
* Thu Apr 11 2013 mmeister@suse.com
- Added url as source.
  Please see http://en.opensuse.org/SourceUrls
* Thu Feb 16 2012 coolo@suse.com
- move license outside a %%if to fix build of libcddb-utils
* Thu Jan 19 2012 coolo@suse.com
- fix pre_checkin.sh
* Thu Dec  1 2011 coolo@suse.com
- add libtool as buildrequire to avoid implicit dependency
* Sun Jan 31 2010 jengelh@medozas.de
- Package baselibs.conf
* Thu Aug  6 2009 sbrabec@suse.cz
- Updated to version 1.3.2:
  * ported to more platforms
  * new functions in the API
  * minor fixes
- Build in two stages to break build loop without removing
  utilities.
* Wed Dec 10 2008 olh@suse.de
- use Obsoletes: -XXbit only for ppc64 to help solver during distupgrade
  (bnc#437293)
* Thu Dec  4 2008 olh@suse.de
- obsolete old -XXbit packages (bnc#437293)
* Thu Nov 27 2008 ro@suse.de
- update baselibs.conf
* Thu Apr 10 2008 ro@suse.de
- added baselibs.conf file to build xxbit packages
  for multilib support
* Tue Oct  9 2007 crrodriguez@suse.de
- fix build using library packaging policy
- remove static libraries and useless libtool archive
- permanently break build loop by removing the example code that caused it
* Tue Sep 11 2007 sbrabec@suse.cz
- Break build loop libcddb -> libcdio -> libcddb.
* Fri Oct 20 2006 sbrabec@suse.cz
- Updated to version 1.3.0:
  * Support for the 'album' command of the freedb2.org.
  * Functions to set or reset some flags.
* Fri Oct  6 2006 sbrabec@suse.cz
- Updated to version 1.2.2:
  * Correct character set is specified when submitting data.
* Fri Jun 30 2006 sbrabec@suse.cz
- Fixed cyclic dependencies in a correct way.
* Thu Jun 22 2006 sbrabec@suse.cz
- Simpler solution of cyclic dependencies.
* Tue Jan 31 2006 sbrabec@suse.cz
- Enabled parallel build.
- Fixed devel splitting.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Oct 26 2005 sbrabec@suse.cz
- Build with libcdio-0.76.
* Fri Aug  5 2005 sbrabec@suse.cz
- Updated to version 1.2.1.
* Fri Jul 29 2005 sbrabec@suse.cz
- Updated to version 1.2.0.
* Mon May  9 2005 sbrabec@suse.cz
- Updated to version 1.0.2.
* Tue Apr 26 2005 sbrabec@suse.cz
- Updated to version 1.0.1.
* Tue Nov  9 2004 sbrabec@suse.cz
- New SuSE package, version 0.9.6.