tdb/tdb.spec
Aurelien Aptel 61e61e8474 Accepting request 452617 from home:dmdiss:samba-ceph-ctdb
Specify https URLs. osc service localrun download_files doesn't like
the http->https redirect.

OBS-URL: https://build.opensuse.org/request/show/452617
OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/tdb?expand=0&rev=88
2017-01-26 12:22:08 +00:00

237 lines
6.6 KiB
RPMSpec

#
# spec file for package tdb
#
# Copyright (c) 2017 SUSE LINUX 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/
#
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?py3_soflags: %global py3_soflags cpython-%{python3_version_nodots}m}
%if 0%{?suse_version} > 1310 || 0%{?fedora_version} > 20
%define with_python3 1
%else
%define with_python3 0
%endif
Name: tdb
%if 0%{?suse_version} == 0 || 0%{?suse_version} > 1140
%define build_make_smp_mflags %{?_smp_mflags}
%else
%define build_make_smp_mflags %{?jobs:-j%jobs}
%endif
BuildRequires: autoconf
BuildRequires: docbook-xsl-stylesheets
BuildRequires: doxygen
BuildRequires: libxslt
%if 0%{?suse_version} > 1020
BuildRequires: pkg-config
%else
BuildRequires: pkgconfig
%endif
BuildRequires: python-devel
%if %{with_python3}
BuildRequires: python3-devel
%endif
Url: https://tdb.samba.org/
Version: 1.3.12
Release: 0
Summary: Samba Trivial Database
License: GPL-3.0+
Group: System/Libraries
Source: https://download.samba.org/pub/tdb/tdb-%{version}.tar.gz
Source1: https://download.samba.org/pub/tdb/tdb-%{version}.tar.asc
Source2: tdb.keyring
Source4: baselibs.conf
Patch0: ignore-tdb1-run-transaction-expand.diff
Patch1: build_pie.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
TDB is a Trivial Database. In concept, it is very much like GDBM, and BSD's DB
except that it allows multiple simultaneous writers and uses locking
internally to keep writers from trampling on each other. TDB is also extremely
small.
%if 0%{?suse_version} > 0
%define libtdb_name libtdb1
%else
%define libtdb_name libtdb
%endif
%package -n %{libtdb_name}
Summary: Libraries and Header Files to Develop Programs with tdb1 Support
Group: System/Libraries
PreReq: /sbin/ldconfig
%description -n %{libtdb_name}
TDB is a Trivial Database. In concept, it is very much like GDBM, and BSD's DB
except that it allows multiple simultaneous writers and uses locking
internally to keep writers from trampling on each other. TDB is also extremely
small.
This package contains the tdb1 library.
%package -n libtdb-devel
Summary: Libraries and Header Files to Develop Programs with tdb1 Support
Group: Development/Libraries/C and C++
Requires: %{libtdb_name} = %{version}
%if 0%{?suse_version} > 1020
Requires: pkg-config
%else
Requires: pkgconfig
%endif
%description -n libtdb-devel
TDB is a Trivial Database. In concept, it is very much like GDBM, and BSD's DB
except that it allows multiple simultaneous writers and uses locking
internally to keep writers from trampling on each other. TDB is also extremely
small.
This package contains libraries and header files need for development.
%package -n tdb-tools
Summary: Tools to manipulate tdb files
Group: Development/Libraries/C and C++
%description -n tdb-tools
TDB is a Trivial Database. In concept, it is very much like GDBM, and BSD's DB
except that it allows multiple simultaneous writers and uses locking
internally to keep writers from trampling on each other. TDB is also extremely
small.
This package contains tools to manage Tdb files.
%package -n python-tdb
Summary: Python bindings for the Tdb library
Group: Development/Libraries/Python
Requires: %{libtdb_name} = %{version}
Conflicts: python3-tdb
PreReq: /sbin/ldconfig
%description -n python-tdb
This package contains the python bindings for the Tdb library.
%if %{with_python3}
%package -n python3-tdb
Summary: Python3 bindings for the Tdb library
Group: Development/Libraries/Python
Requires: %{libtdb_name} = %{version}
Conflicts: python-tdb
PreReq: /sbin/ldconfig
%description -n python3-tdb
This package contains the python3 bindings for the Tdb library.
%endif
%prep
%setup -n tdb-%{version} -q
%ifarch ppc ppc64 ppc64le
%patch0 -p1
%endif
%patch1 -p1
%build
%if 0%{?suse_version} && 0%{?suse_version} < 911
OPTIMIZATION="-O"
%else
# use the default optimization
unset OPTIMIZATION
%endif
export CFLAGS="${RPM_OPT_FLAGS} -D_GNU_SOURCE ${OPTIMIZATION} -D_LARGEFILE64_SOURCE -DIDMAP_RID_SUPPORT_TRUSTED_DOMAINS"
CONFIGURE_OPTIONS="\
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--disable-rpath \
--disable-rpath-install \
--disable-silent-rules \
--bundled-libraries=NONE \
%if %{with_python3}
--extra-python=/usr/bin/python3 \
%endif
"
./configure ${CONFIGURE_OPTIONS}
%{__make} %{build_make_smp_mflags} \
all
doxygen doxy.config
%check
%if 0%{!?qemu_user_space_build:1}
%{__make} test
%endif
%install
DESTDIR=${RPM_BUILD_ROOT} make install
# Install API documentation
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man3/
cp -a docs/man/man3/tdb.3 $RPM_BUILD_ROOT/%{_mandir}/man3/
%post -n %{libtdb_name} -p /sbin/ldconfig
%postun -n %{libtdb_name} -p /sbin/ldconfig
%post -n python-tdb -p /sbin/ldconfig
%postun -n python-tdb -p /sbin/ldconfig
%if %{with_python3}
%post -n python3-tdb -p /sbin/ldconfig
%postun -n python3-tdb -p /sbin/ldconfig
%endif
%files -n %{libtdb_name}
%defattr(-,root,root)
%{_libdir}/libtdb.so.*
%files -n libtdb-devel
%defattr(-,root,root)
%{_includedir}/tdb.h
%{_libdir}/libtdb.so
%{_libdir}/pkgconfig/tdb.pc
%{_mandir}/man3/tdb.3.*
%files -n tdb-tools
%defattr(-,root,root)
%{_bindir}/tdbbackup
%{_bindir}/tdbdump
%{_bindir}/tdbrestore
%{_bindir}/tdbtool
%if 0%{?suse_version} == 0 || 0%{?suse_version} > 1100
%{_mandir}/man8/tdbbackup.8*
%{_mandir}/man8/tdbdump.8*
%{_mandir}/man8/tdbrestore.8*
%{_mandir}/man8/tdbtool.8*
%endif
%files -n python-tdb
%defattr(-,root,root)
%{python_sitearch}/tdb.so
%{python_sitearch}/_tdb_text.py*
%if %{with_python3}
%files -n python3-tdb
%defattr(-,root,root)
%{python3_sitearch}/tdb.%{py3_soflags}.so
%{python3_sitearch}/_tdb_text.py
%if 0%{?centos_version} > 599 || 0%{?fedora_version} > 11 || 0%{?rhel_version} > 599
%{python3_sitearch}/__pycache__/_tdb_text.cpython-*.py[co]
%endif
%endif
%changelog