File blocxx.spec of Package blocxx

#
# spec file for package blocxx
#
# Copyright (c) 2012 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:           blocxx
%define blocxx_version 2.1.0
Version:        2.1.0.342
Release:        0
Summary:        BloCXX--C++ Framework for Application Development
License:        BSD-3-Clause
Group:          Development/Libraries/C and C++
Url:            http://sourceforge.net/projects/blocxx/
# current blocxx sources
Source:         %{name}-%{blocxx_version}.tar.bz2
Source2:        baselibs.conf
Patch0:         %{name}-no-fqdn-dot-check.dif
Patch1:         %{name}-no_ipv6_run_check.dif
Patch2:         %{name}-no-condition-test.dif
Patch3:         %{name}-pkgconfig.diff
Patch4:         %{name}-2.1.0-gcc44.dif
Patch5:         %{name}-2.1.0-asneeded.dif
Patch6:         %{name}-2.1.0-memorybarrier.diff
Patch7:         %{name}-2.1.0-catch-gcc45-bug_is_pod.diff
Patch8:         %{name}-2.1.0-std-ptrdiff.diff
Patch9:         blockcxx-openssl.patch
Patch10:        blocxx-gcc47.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  pcre-devel
BuildRequires:  pkgconfig
%if 0%{?suse_version} >= 1030
BuildRequires:  libopenssl-devel
%else
BuildRequires:  openssl-devel
%endif
%define         blocxx_docdir %{_defaultdocdir}/blocxx

%description
BloCXX is a general C++ framework for application development. This
package contains the BloCXX library.

%package -n libblocxx-devel
Summary:        BloCXX--C++ Framework for Application Development
Group:          Development/Libraries/C and C++
Requires:       libblocxx6 = %{version}
Requires:       libstdc++-devel
Requires:       pcre-devel
%if 0%{?suse_version} >= 1030
Requires:       libopenssl-devel
%else
Requires:       openssl-devel
%endif
Obsoletes:      %{name}-devel < %{version}
Provides:       %{name}-devel = %{version}
# bug437293
%ifarch ppc64
Obsoletes:      blocxx-devel-64bit
%endif
#

%description -n libblocxx-devel
BloCXX is a general C++ framework for application development. This
package contains the BloCXX library.

%package -n libblocxx6
Summary:        BloCXX--C++ Framework for Application Development
Group:          System/Libraries
# bug437293
%ifarch ppc64
Obsoletes:      blocxx-64bit
%endif
#
#satisfy debuginfo package
Provides:       blocxx = %{version}-%{release}
Obsoletes:      blocxx < %{version}

%description -n libblocxx6
BloCXX is a general C++ framework for application development. This
package contains the BloCXX library.

%prep
%setup -q -n blocxx-%{blocxx_version}
%patch0 -p0
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p0
%patch8 -p0
%patch9
%patch10 -p0

%build
if test -f ./bootstrap.sh ; then
    ./bootstrap.sh
else
    %{?suse_update_config:%{suse_update_config -f}}
    :
fi
autoreconf -fi

%if %{?_with_debug:1}%{!?_with_debug:0}
#
# configure a special debug version
#
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
%configure \
	%ifarch hppa
	--target=hppa2.0-suse-linux-gnu \
	%endif
	--enable-ipv6 \
	%ifarch %ix86
	--enable-valgrind-support \
	%endif
	--enable-stack-trace \
	--enable-debug-mode \
	--disable-Werror
%else
#
# configure normal version
#
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fvisibility-inlines-hidden" \
%configure \
	%ifarch hppa
	--target=hppa2.0-suse-linux-gnu \
	%endif
	--enable-ipv6 \
	--enable-iconv \
	--disable-Werror
%endif
#
# compile
#
make %{?_smp_mflags}

%check
#
# run testsuites
%if !0%{?qemu_user_space_build:1}
make check %{?_smp_mflags}
%endif
#

%install
#
# install the library completely
#
make DESTDIR=${RPM_BUILD_ROOT} install
#
# add version to the library file name
#
mv -f ${RPM_BUILD_ROOT}%_libdir/libblocxx.so.6 \
      ${RPM_BUILD_ROOT}%_libdir/libblocxx.so.6.%{blocxx_version}
ln -s libblocxx.so.6.%{blocxx_version} \
      ${RPM_BUILD_ROOT}%_libdir/libblocxx.so.6
#
# install documentation files
#
install -m755 -d ${RPM_BUILD_ROOT}/%{blocxx_docdir}
for f in LICENSE AUTHORS ChangeLog ; do
  install -m644 $f ${RPM_BUILD_ROOT}/%{blocxx_docdir}/
done
# --disable-static not implemented here
rm -fv %{buildroot}%{_libdir}/*.a

%post -n libblocxx6 -p /sbin/ldconfig

%postun -n libblocxx6 -p /sbin/ldconfig

%files -n libblocxx-devel
%defattr(-,root,root)
%_includedir/blocxx
%_libdir/libblocxx.so
%_libdir/pkgconfig/blocxx.pc
%_datadir/aclocal/blocxx.m4
%dir %blocxx_docdir
%doc %blocxx_docdir/LICENSE
%doc %blocxx_docdir/AUTHORS
%doc %blocxx_docdir/ChangeLog

%files -n libblocxx6
%defattr(-,root,root)
%_libdir/libblocxx.so.6
%_libdir/libblocxx.so.6.%{blocxx_version}

%changelog