packaging: Create separate package for pcp pmda
authorMartin Schwenke <martin@meltin.net>
Tue, 28 May 2013 04:19:32 +0000 (14:19 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 28 May 2013 04:24:16 +0000 (14:24 +1000)
To build ctdb-pcp-pmda package, run packaging/RPM/makerpms.sh script with
"--with pmda" option.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 85e11b9b13b3add88c1b8957be51793cc1db4f2d)

ctdb/packaging/RPM/ctdb.spec.in

index 98724279472ba80892dc16a15bbe402709c2ed40..44bd46f6ca06fb3f18244265a4c946494595a7a6 100644 (file)
@@ -45,6 +45,12 @@ BuildRequires: libtdb-devel >= %{libtdb_version}
 BuildRequires: libtevent-devel >= %{libtevent_version}
 %endif
 
+# To build the ctdb-pcp-pmda package, run rpmbuild with "--with pmda"
+%define with_pcp_pmda  %{?_with_pmda: 1} %{?!_with_pmda: 0}
+%if %with_pcp_pmda
+BuildRequires: pcp-libs-devel
+%endif
+
 %description
 ctdb is the clustered database used by samba
 
@@ -80,6 +86,9 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE" ./configure \
 %endif
 %if %with_included_tevent
        --with-included-tevent \
+%endif
+%if %with_pcp_pmda
+       --enable-pmda \
 %endif
        --prefix=%{_prefix} \
        --sysconfdir=%{_sysconfdir} \
@@ -216,6 +225,24 @@ test suite for ctdb
 %{_bindir}/ctdb_run_cluster_tests
 %doc tests/README
 
+%if %with_pcp_pmda
+
+%package pcp-pmda
+Summary: CTDB PCP pmda support
+Group: Development/Tools
+Requires: ctdb = %{version}
+Requires: pcp-libs
+
+%description pcp-pmda
+Performance Co-Pilot (PCP) support for CTDB
+
+%files pcp-pmda
+%dir /var/lib/pcp/pmdas/ctdb
+/var/lib/pcp/pmdas/ctdb/*
+
+%endif
+
+
 
 %changelog
 * Thu Mar 1 2012 : Version 1.13