#1 Allow disabling CMake support
Closed 5 years ago by amigadave. Opened 6 years ago by ppisar.
rpms/ ppisar/dbus optionalcmake  into  master

@@ -0,0 +1,57 @@ 

+ From 0a3b0f906b971df07fc0f2fbf24ce5ee53458b02 Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>

+ Date: Mon, 2 Oct 2017 17:05:34 +0200

+ Subject: [PATCH] Add --disable-cmake configure option

+ MIME-Version: 1.0

+ Content-Type: text/plain; charset=UTF-8

+ Content-Transfer-Encoding: 8bit

+ 

+ This option allows to disable installing CMake rules.

+ 

+ Signed-off-by: Petr Písař <ppisar@redhat.com>

+ ---

+  Makefile.am  | 2 ++

+  configure.ac | 4 ++++

+  2 files changed, 6 insertions(+)

+ 

+ diff --git a/Makefile.am b/Makefile.am

+ index 970b90d..7a82102 100644

+ --- a/Makefile.am

+ +++ b/Makefile.am

+ @@ -3,9 +3,11 @@ SUBDIRS=dbus bus tools test doc

+  pkgconfigdir = $(libdir)/pkgconfig

+  pkgconfig_DATA = dbus-1.pc

+  

+ +if ENABLE_CMAKE

+  cmakeconfigdir = $(libdir)/cmake/DBus1

+  cmakeconfig_DATA = cmake/DBus1Config.cmake       \

+                     cmake/DBus1ConfigVersion.cmake

+ +endif

+  

+  DISTCLEANFILES = 		\

+  	${pkgconfig_DATA}       \

+ diff --git a/configure.ac b/configure.ac

+ index cc52b8d..5de7ecf 100644

+ --- a/configure.ac

+ +++ b/configure.ac

+ @@ -210,6 +210,7 @@ AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue suppor

+  AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)

+  AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)

+  AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)

+ +AC_ARG_ENABLE(cmake, AS_HELP_STRING([--disable-cmake],[build without cmake support]),enable_cmake=$enableval,enable_cmake=yes)

+  

+  AC_ARG_WITH(session-socket-dir, AS_HELP_STRING([--with-session-socket-dir=[dirname]],[Where to put sockets for the per-login-session message bus]))

+  AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))

+ @@ -1207,6 +1208,9 @@ fi

+  # can override this with ./configure SYSTEMCTL=/bin/systemctl

+  AC_PATH_PROG([SYSTEMCTL], [systemctl], [/usr/bin/systemctl])

+  

+ +dnl cmake

+ +AM_CONDITIONAL(ENABLE_CMAKE, test x$enable_cmake = xyes)

+ +

+  # libaudit detection

+  if test x$enable_libaudit = xno ; then

+      have_libaudit=no;

+ -- 

+ 2.13.6

+ 

file modified
+15 -6
@@ -1,3 +1,10 @@ 

+ # Allow extra dependencies required for some tests to be disabled.

+ %bcond_without tests

+ # Disabled in June 2014: http://lists.freedesktop.org/archives/dbus/2014-June/016223.html

+ %bcond_with check

+ # Enable support for CMake

+ %bcond_without dbus_enables_cmake

+ 

  %global _hardened_build 1

  %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}

  
@@ -7,12 +14,7 @@ 

  

  %global dbus_user_uid           81

  

- %global dbus_common_config_opts --enable-libaudit --enable-selinux=yes --with-system-socket=/run/dbus/system_bus_socket --with-dbus-user=dbus --libexecdir=/%{_libexecdir}/dbus-1 --enable-user-session --docdir=%{_pkgdocdir} --enable-installed-tests

- 

- # Allow extra dependencies required for some tests to be disabled.

- %bcond_without tests

- # Disabled in June 2014: http://lists.freedesktop.org/archives/dbus/2014-June/016223.html

- %bcond_with check

+ %global dbus_common_config_opts --enable-libaudit --enable-selinux=yes --with-system-socket=/run/dbus/system_bus_socket --with-dbus-user=dbus --libexecdir=/%{_libexecdir}/dbus-1 --enable-user-session --docdir=%{_pkgdocdir} --enable-installed-tests --%{?with_dbus_enables_cmake:enable}%{?!with_dbus_enables_cmake:disable}-cmake

  

  Name:    dbus

  Epoch:   1
@@ -28,6 +30,8 @@ 

  #VCS:    git:git://git.freedesktop.org/git/dbus/dbus

  Source0: http://dbus.freedesktop.org/releases/%{name}/%{name}-%{version}.tar.gz

  Source1: 00-start-message-bus.sh

+ # Control CMake rules installation, bug #1497257

+ Patch0:  dbus-1.11.18-Add-disable-cmake-configure-option.patch

  

  BuildRequires: autoconf-archive

  BuildRequires: libtool
@@ -45,8 +49,10 @@ 

  # For building XML documentation.

  BuildRequires: /usr/bin/xsltproc

  BuildRequires: xmlto

+ %if %{with dbus_enables_cmake}

  # For AutoReq cmake-filesystem.

  BuildRequires: cmake

+ %endif

  

  #For macroized scriptlets.

  %{?systemd_requires}
@@ -124,6 +130,7 @@ 

  

  %prep

  %setup -q

+ %patch0 -p1

  

  

  %build
@@ -351,7 +358,9 @@ 

  %{_datadir}/xml/dbus-1

  %{_libdir}/lib*.so

  %dir %{_libdir}/dbus-1.0

+ %if %{with dbus_enables_cmake}

  %{_libdir}/cmake/DBus1

+ %endif

  %{_libdir}/dbus-1.0/include/

  %{_libdir}/pkgconfig/dbus-1.pc

  %{_includedir}/*

There is a problem with adding dbus-devel package into Platform
module because there is no cmake, thus dbus-devel cannot be installed
and applications built against dbus.

This patch adds a build-time condition that allows to disable
installing CMake rule files and thus remove dependency on
cmake-filesystem.

The default behavior is unchanged and the CMake files are installed.

See https://bugzilla.redhat.com/show_bug.cgi?id=1497257.

Pull-Request has been closed by amigadave

5 years ago