From: James Simmons Date: Fri, 11 Aug 2017 18:50:52 +0000 (-0400) Subject: LU-9870 build: handle SNMP missing on build box X-Git-Tag: 2.10.2-RC1~64 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7984cabd07745a301d397d3f1c6d5c9175b961fc;p=fs%2Flustre-release.git LU-9870 build: handle SNMP missing on build box Currently the lustre spec file doesn't handle the case when SNMP is missing. So even if the user does configure --disable-snmp our rpm build process will ignore this and fail to build rpms. Pass to the rpm build process the missing SNMP case. Lustre-commit: 574451a4402df65d26d7af96d94a7bf0875c86af Lustre-change: https://review.whamcloud.com/28494 Test-Parameters: trivial Change-Id: Ia6dcfd31b50f4f67afe7a4545fe417c32df6e559 Signed-off-by: James Simmons Reviewed-by: Minh Diep Reviewed-by: Giuseppe Di Natale Reviewed-by: Nathaniel Clark Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/28987 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond --- diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 164c069..96643a3 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -509,6 +509,9 @@ fi if test x$USE_DLC = xyes ; then RPMBINARGS="$RPMBINARGS --with lnet_dlc" fi +if test x$enable_snmp != xyes ; then + RPMBINARGS="$RPMBINARGS --without snmp" +fi if test x$enable_manpages != xyes ; then RPMBINARGS="$RPMBINARGS --without manpages" fi diff --git a/lustre.spec.in b/lustre.spec.in index 47607cb..55cd0d5 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -9,6 +9,7 @@ %bcond_without lustre_iokit %bcond_without lustre_modules %bcond_with lnet_dlc +%bcond_with snmp %bcond_without manpages %bcond_without shared %bcond_without static @@ -309,6 +310,7 @@ fi %{!?with_servers:--disable-server} \ %{!?with_zfs:--without-zfs} \ %{!?with_lnet_dlc:--disable-dlc} \ + %{!?with_snmp:--disable-snmp} \ %{!?with_manpages:--disable-manpages} \ %{!?with_systemd:--with-systemdsystemunitdir=no} \ %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \ @@ -399,13 +401,16 @@ echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so.*' >>lustre.files echo '%{_libdir}/libiam.a' >>lustre.files %endif -if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then - echo '%{_libdir}/lustre/snmp' >>lustre.files -fi +%if %{with snmp} +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/lustre/snmp +echo '%{_libdir}/lustre/snmp' >>lustre.files +%endif %if %{with lustre_utils} mkdir -p $RPM_BUILD_ROOT/%{_datadir}/lustre -find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ -name \*.la -type f -exec rm -f {} \; +if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre ] ; then + find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ -name \*.la -type f -exec rm -f {} \; +fi %endif %if %{with lustre_modules}