Packaging: add options to ctdb.spec.in to force use of bundled libraries
authorMartin Schwenke <martin@meltin.net>
Wed, 9 May 2012 06:03:00 +0000 (16:03 +1000)
committerMartin Schwenke <martin@meltin.net>
Fri, 11 May 2012 00:33:27 +0000 (10:33 +1000)
Ideas borrowed from the Fedora samba4 spec file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 14a630cbc638d2f3bf699de5d94131e5f7d1a3ea)

ctdb/packaging/RPM/ctdb.spec.in

index 26e738ab10269010c056b46aa69e332403397fc8..4db49f9d9c34d7a6d1e4acf7ba404f00cc07dd3a 100644 (file)
@@ -20,10 +20,30 @@ Provides: ctdb = %{version}
 Prefix: /usr
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 
+# Always use the bundled versions of these libraries.
+%define with_included_talloc 1
+%define with_included_tdb 1
+%define with_included_tevent 1
+
+# If the above options are changed then mandate minimum system
+# versions.
+%define libtalloc_version 2.0.6
+%define libtdb_version 1.2.9
+%define libtevent_version 0.9.13
+
+%if ! %with_included_talloc
+BuildRequires: libtalloc-devel >= %{libtalloc_version}
+%endif
+%if ! %with_included_tdb
+BuildRequires: libtdb-devel >= %{libtdb_version}
+%endif
+%if ! %with_included_tevent
+BuildRequires: libtevent-devel >= %{libtevent_version}
+%endif
+
 %description
 ctdb is the clustered database used by samba
 
-
 #######################################################################
 
 
@@ -48,6 +68,15 @@ export CC
 ./autogen.sh
 
 CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE -DCTDB_VERS=\"%{version}-%{release}\"" ./configure \
+%if %with_included_talloc
+       --with-included-talloc \
+%endif
+%if %with_included_tdb
+       --with-included-tdb \
+%endif
+%if %with_included_tevent
+       --with-included-tevent \
+%endif
        --prefix=%{_prefix} \
        --sysconfdir=%{_sysconfdir} \
        --mandir=%{_mandir} \