[ctpl] do not build the CLI tool when building for EPEL

Dominic Hopf dmaphy at fedoraproject.org
Sun Dec 18 16:12:07 UTC 2011


commit e6019b17b040e66af9ddeda8f1c48325aca43293
Author: Dominic Hopf <dmaphy at fedoraproject.org>
Date:   Sun Dec 18 17:12:06 2011 +0100

    do not build the CLI tool when building for EPEL

 ctpl-0.3.2-add-disable-cli-tool.patch |   77 +++++++++++++++++++++++++++++++++
 ctpl.spec                             |   25 ++++++++++-
 2 files changed, 101 insertions(+), 1 deletions(-)
---
diff --git a/ctpl-0.3.2-add-disable-cli-tool.patch b/ctpl-0.3.2-add-disable-cli-tool.patch
new file mode 100644
index 0000000..adc3dca
--- /dev/null
+++ b/ctpl-0.3.2-add-disable-cli-tool.patch
@@ -0,0 +1,77 @@
+From fdf8e8a8e5a190ff03aefbd9dc80bcc083a2854b Mon Sep 17 00:00:00 2001
+From: Colomban Wendling <ban at herbesfolles.org>
+Date: Thu, 3 Nov 2011 23:47:05 +0100
+Subject: [PATCH] Allow to explicitly enable or disable building the CLI tool
+
+---
+ README.in    |    6 ++++++
+ configure.ac |   25 ++++++++++++++++++++++---
+ 2 files changed, 28 insertions(+), 3 deletions(-)
+
+diff --git a/README.in b/README.in
+index 7dbca47..9bb76df 100644
+--- a/README.in
++++ b/README.in
+@@ -29,6 +29,12 @@ For detailed installation instructions, see the INSTALL file.
+ If you are working on Windows, you may want to consider using the alternate
+ build system, see below.
+ 
++Optional features
++-----------------
++
++You can explicitly enable or disable building of the command-line tool by giving
++the --enable-cli-tool or --disable-cli-tool argument to configure.
++
+ 
+ Alternate installation, Waf
+ ===========================
+diff --git a/configure.ac b/configure.ac
+index 286babf..338e977 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -15,6 +15,23 @@ AC_CONFIG_HEADERS([config.h])
+ 
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+ 
++
++# CLI-tool specific macros to enable/disable it
++AC_ARG_ENABLE([cli-tool],
++              AS_HELP_STRING([--disable-cli-tool],
++                             [Disable the standalone command-line tool [[default=auto]]]),
++              [enable_cli_tool="$enableval"],
++              [enable_cli_tool="auto"])
++
++# Output or not $1 as an error or a warning depending on $enable_cli_tool
++AC_DEFUN([CLI_TOOL_MSG_ERROR],
++[
++  AS_IF([test "x$enable_cli_tool" = "xyes"],
++        [AC_MSG_ERROR([$1])],
++        [test "x$enable_cli_tool" != "xno"],
++        [AC_MSG_WARN([$1])])
++])
++
+ #
+ # revision of the library (libtool stuff)
+ # 
+@@ -49,13 +66,15 @@ HAVE_GIO_UNIX="no"
+ PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0],
+                   [HAVE_GIO_UNIX="yes"],
+                   [HAVE_GIO_UNIX="no"
+-                   AC_MSG_WARN([The ctpl command-line utility will not be built because of the following error: ${GIO_UNIX_PKG_ERRORS}])])
++                   CLI_TOOL_MSG_ERROR([Cannot build the CLI tool: ${GIO_UNIX_PKG_ERRORS}])
++                   enable_cli_tool="no"])
+ HAVE_GIO_2_24="no"
+ PKG_CHECK_MODULES([GIO_2_24], [gio-2.0 >= 2.24],
+                   [HAVE_GIO_2_24="yes"],
+                   [HAVE_GIO_2_24="no"
+-                   AC_MSG_WARN([The ctpl command-line utility will not be built because of the following error: ${GIO_2_24_PKG_ERRORS}])])
+-AM_CONDITIONAL([BUILD_CTPL], [test x$HAVE_GIO_UNIX = xyes -a x$HAVE_GIO_2_24 = xyes])
++                   CLI_TOOL_MSG_ERROR([Cannot build the CLI tool: ${GIO_2_24_PKG_ERRORS}])
++                   enable_cli_tool="no"])
++AM_CONDITIONAL([BUILD_CTPL], [test "x$enable_cli_tool" != xno])
+ 
+ # needed for the math functions checks to work
+ AC_CHECK_LIB([m], [acos])
+-- 
+1.7.2.5
+
diff --git a/ctpl.spec b/ctpl.spec
index 557da5b..837b856 100644
--- a/ctpl.spec
+++ b/ctpl.spec
@@ -2,13 +2,19 @@
 
 Name:           ctpl
 Version:        0.3.2
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Template library and engine written in C
 
 Group:          Development/Tools
 License:        GPLv3+
 URL:            http://ctpl.tuxfamily.org/
 Source0:        http://download.tuxfamily.org/ctpl/releases/ctpl-%{version}.tar.gz
+
+# Patch adds possibility to disable the build of the command line tool.
+# The patch is pulled from upstream at
+# http://git.tuxfamily.org/ctpl/ctpl/?p=gitroot/ctpl/ctpl.git;a=summary
+Patch0:         ctpl-0.3.2-add-disable-cli-tool.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  glib2-devel >= 2.10
@@ -71,8 +77,20 @@ rm -f waf
 rm -f wscript
 
 
+# The CLI tool only needs to be disabled on RHEL because of GIO dependency issues,
+# see RHBZ#749874 for more detailed information.
+%if 0%{?rhel}
+%patch0 -p1
+%endif
+
+
 %build
+%if 0%{?rhel}
+%configure --docdir %{ctpl_docdir} --disable-cli-tool
+%else
 %configure --docdir %{ctpl_docdir}
+%endif
+
 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
 make %{?_smp_mflags}
@@ -94,10 +112,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libctpl.la
 rm -rf $RPM_BUILD_ROOT
 
 
+%if ! 0%{?rhel}
 %files
 %defattr(-,root,root,-)
 %doc %{_mandir}/man1/%{name}.1.*
 %{_bindir}/%{name}
+%endif
 
 
 %files libs
@@ -126,6 +146,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Sun Dec 18 2011 Dominic Hopf <dmaphy at fedoraproject.org> - 0.3.2-4
+- do not build the CLI tool when building for EPEL
+
 * Wed May 25 2011 Dominic Hopf <dmaphy at fedoraproject.org> - 0.3.2-3
 - remove depedency on gtk-doc (fixes #707547)
 


More information about the scm-commits mailing list