From a6aa05240b686d3c5ee2ccf3c282511e93cb62d1 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Wed, 22 Oct 2014 16:05:18 +0400 Subject: [PATCH] LU-5760 rpm: remove Red Hat specific check for init scripts The issue with build under mock-based environments is related to a sloppy heuristic of checking for the existence of checking for two files under /etc, and assuming that is a good way to identify a Red Hat system. We had a concern about this for other systems. So, let's remove this Red Hat specific check of /etc files. Signed-off-by: Dmitry Eremin Change-Id: Ibc6af75ebea51b39d5ff4c8473db2e3828ffea68 Reviewed-on: http://review.whamcloud.com/12377 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Christopher J. Morrone Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- config/lustre-build.m4 | 24 ++---------------------- lustre.spec.in | 18 ++++++++---------- lustre/conf/Makefile.am | 2 +- lustre/scripts/Makefile.am | 2 +- 4 files changed, 12 insertions(+), 34 deletions(-) diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 5c31b67..6f771e5 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -252,7 +252,6 @@ AC_ARG_ENABLE([utils], [disable building of Lustre utility programs]), [], [enable_utils="yes"]) AC_MSG_RESULT([$enable_utils]) -AS_IF([test "x$enable_utils" = xyes], [LB_CONFIG_INIT_SCRIPTS]) ]) # LB_CONFIG_UTILS # @@ -310,26 +309,6 @@ AC_SUBST(ENABLE_DOC) ]) # LB_CONFIG_DOCS # -# LB_CONFIG_INIT_SCRIPTS -# -# our init scripts only work on red hat linux -# -AC_DEFUN([LB_CONFIG_INIT_SCRIPTS], [ -ENABLE_INIT_SCRIPTS=0 -AS_IF([test x$enable_utils = xyes], [ - AC_CACHE_CHECK([whether to install init scripts], [lb_cv_enable_init_scripts], [ - # our scripts only work on red hat systems - AS_IF([test -f /etc/init.d/functions -a -f /etc/sysconfig/network], - [lb_cv_enable_init_scripts="yes"], - [lb_cv_enable_init_scripts="no"]) - ]) - AS_IF([test "x$lb_cv_enable_init_scripts" = xyes], - [ENABLE_INIT_SCRIPTS=1]) -]) -AC_SUBST(ENABLE_INIT_SCRIPTS) -]) - -# # LB_CONFIG_HEADERS # # add -include config.h @@ -422,10 +401,11 @@ AM_CONDITIONAL([MODULES], [test x$enable_modules = xyes]) AM_CONDITIONAL([UTILS], [test x$enable_utils = xyes]) AM_CONDITIONAL([TESTS], [test x$enable_tests = xyes]) AM_CONDITIONAL([DOC], [test x$ENABLE_DOC = x1]) -AM_CONDITIONAL([INIT_SCRIPTS], [test x$ENABLE_INIT_SCRIPTS = x1]) AM_CONDITIONAL([LINUX], [test x$lb_target_os = xlinux]) AM_CONDITIONAL([USES_DPKG], [test x$uses_dpkg = xyes]) AM_CONDITIONAL([USE_QUILT], [test x$use_quilt = xyes]) +AM_CONDITIONAL([RHEL], [test x$RHEL_KERNEL = xyes]) +AM_CONDITIONAL([SUSE], [test x$SUSE_KERNEL = xyes]) # Sanity check for PCLMULQDQ instruction availability # PCLMULQDQ instruction is a new instruction available beginning with diff --git a/lustre.spec.in b/lustre.spec.in index 625d858..f58d3f9 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -373,25 +373,23 @@ make install DESTDIR=$RPM_BUILD_ROOT :> lustre.files -%if %{with servers} +%if %{with servers} && %{with lustre_utils} # The .ha_v2 extension identifies the heartbeat resource agent as using # legacy syntax. Install a compatibility symlink to avoid conflicts when # newer-style agents are added. -%if %{with lustre_utils} ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files %endif -if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lustre ]; then - echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files - echo '%{_sysconfdir}/init.d/lustre' >>lustre.files -fi +%if %{_vendor}=="redhat" +# The following scripts are Red Hat specific +%if %{with servers} +echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files +echo '%{_sysconfdir}/init.d/lustre' >>lustre.files +%endif +echo '%{_sysconfdir}/init.d/lnet' >>lustre.files %endif - -if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lnet ]; then - echo '%{_sysconfdir}/init.d/lnet' >>lustre.files -fi # Create the pristine source directory. cd $RPM_BUILD_DIR/lustre-%{version} diff --git a/lustre/conf/Makefile.am b/lustre/conf/Makefile.am index 61f19a2..7e4f3ba 100644 --- a/lustre/conf/Makefile.am +++ b/lustre/conf/Makefile.am @@ -48,7 +48,7 @@ endif udevrulesdir = $(sysconfdir)/udev/rules.d udevrules_DATA = 99-lustre.rules -if INIT_SCRIPTS +if RHEL if SERVER sysconfigdir = $(sysconfdir)/sysconfig sysconfig_DATA = lustre diff --git a/lustre/scripts/Makefile.am b/lustre/scripts/Makefile.am index 6df5770..196ba20 100644 --- a/lustre/scripts/Makefile.am +++ b/lustre/scripts/Makefile.am @@ -41,7 +41,7 @@ genscripts = lc_modprobe lc_net lc_hb lc_cluman lc_md lc_lvm lustre_start sbin_SCRIPTS = lustre_rmmod -if INIT_SCRIPTS +if RHEL initdir = $(sysconfdir)/init.d init_SCRIPTS = lnet if SERVER -- 1.8.3.1