endif
endif
+@TESTS_TRUE@BUILD_TESTS = true
+@TESTS_FALSE@BUILD_TESTS = false
+
include build/autoMakefile.am.toplevel
EXTRA_DIST += config.h.in debian/*
build/mptlinux.spec.patch build/patches
rpms-real: @PACKAGE_TARNAME@.spec dist Makefile
- rpmbuild -ta $(distdir).tar.gz
+ CONFIGURE_ARGS=$$(echo $$(eval echo $(ac_configure_args)) | sed -re 's/--(en|dis)able-tests//'); \
+ RPMARGS="--define \"configure_args $$CONFIGURE_ARGS\""; \
+ if ! $(BUILD_TESTS); then \
+ RPMARGS="$$RPMARGS --define \"build_lustre_tests 0\""; \
+ fi; \
+ eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
srpm-real: @PACKAGE_TARNAME@.spec dist Makefile
- rpmbuild -ts $(distdir).tar.gz
+ if ! $(BUILD_TESTS); then \
+ RPMARGS="--define \"build_lustre_tests 0\""; \
+ fi; \
+ eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
rpms:
for subdir in $(RPM_SUBDIRS) ; do \
# not in the target file any more
CONFIG=
+# build the lustre-tests rpm?
+LUSTRE_TESTS=true
+
DATE=$(date)
USE_DATESTAMP=1
echo NORPM mode. Only compiling.
fi
- # convert the $PATCHLESS boolean to an empty/no-empty boolean
+ # convert the $PATCHLESS boolean to an empty/not-empty boolean
# as silly as this seems, it makes the syntax of the rpmbuild command
# simpler and not need an eval to deal with the quotes in the quotes
local is_patchless=""
if $PATCHLESS; then
is_patchless="yes"
fi
+
+ # ditto for the lustre-tests boolean
+ local lustre_tests=""
+ if ! $LUSTRE_TESTS; then
+ lustre_tests="no"
+ fi
+
$RPMBUILD $targets $rpmbuildopt ../lustre.spec \
${is_patchless:+--define "lustre_name lustre-client"} \
+ ${lustre_tests:+--define "build_lustre_tests 0"} \
+ --define "configure_args $confoptions ${CONFIGURE_FLAGS}" \
--define "_tmppath $TMPDIR" \
--define "_topdir $TOPDIR" 2>&1 || \
fatal 1 "Error building rpms for $BUILD_ARCHS."
;;
--)
shift
+ # there are actually some lustre configure flags that we need to
+ # handle ourselves (but we still give them to configure)
+ if [[ \ $@\ == *\ --disable-tests\ * ]]; then
+ LUSTRE_TESTS=false
+ fi
CONFIGURE_FLAGS=$@
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-liblustre --enable-liblustre-tests"
break
RPMBUILD=
XEN=false
+# build the lustre-tests rpm?
+LUSTRE_TESTS=true
+
canon()
{
pushd $1 >/dev/null
#bash -c "$@" &
("$@") &
child_pid=$!
-
+
(sleep $SLEEP_TIME
kill -TERM -$child_pid 2>/dev/null
sleep 5
-e s^@VERSION@^${LUSTRE_VERSION}^g \
-e s^@LINUXRELEASE@^${FULL_VERSION}^g \
-e s^@RELEASE@^${FULL_VERSION//-/_}^g \
- -e s^@ac_configure_args@^"--with-linux=${PWD}/linux ${CONFIGURE_FLAGS}"^g \
< lustre.spec.in \
> lustre.spec
+ # convert the $LUSTRE_TESTS boolean to an empty/not-empty boolean
+ # as silly as this seems, it makes the syntax of the rpmbuild command
+ # simpler and not need an eval to deal with the quotes in the quotes
+ # ditto for the lustre-tests boolean
+ local lustre_tests=""
+ if ! $LUSTRE_TESTS; then
+ lustre_tests="no"
+ fi
+
$RPMBUILD --target ${TARGET_ARCH} -bb lustre.spec \
- ${PATCHLESS:+--define "lustre_name lustre-client"} \
+ --define "configure_args --with-linux=${PWD}/linux ${CONFIGURE_FLAGS}" \
+ ${lustre_tests:+--define "build_lustre_tests 0"} \
--define "_tmppath $TMPDIR" \
--define "_topdir $(lbuild_topdir)" 2>&1 || \
fatal 1 "Error building Lustre rpms."
KVERREL="${VERSION}${EXTRA_VERSION_DELIMITER}${EXTRA_VERSION}"
# deal with the kernel headers that are version specific
-
+
saveddir="$RPM_BUILD_ROOT/usr/src/linux-${KVERREL}/savedheaders/${TARGET_ARCH}/${TARGET_CONFIG:-up}"
mkdir -p "$saveddir"
install -m 644 include/linux/autoconf.h "$saveddir/autoconf.h"
options=$(getopt -o hj: -l "$longopts" -- "$@")
eval set -- "$options"
-
+
while [ "$1" ] ; do
case "$1" in
'')
;;
--)
shift
+ # there are actually some lustre configure flags that we need to
+ # handle ourselves (but we still give them to configure)
+ if [[ \ $@\ == *\ --disable-tests\ * ]]; then
+ LUSTRE_TESTS=false
+ fi
CONFIGURE_FLAGS=$@
break
;;
# /sbin/update-modules.dep compares when the modules were built, rather
# than installed, so force modules.dep to be recreated
echo "rm -f /lib/modules/%{KVERREL}${delim_flavor}/modules.dep" >> ${script}
- echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
+ echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" -e "s^%flavor^${flavor}^" %{SOURCE26} >> ${script}
echo "else" >> ${script}
echo "fi" >> ${script}
;;
postun)
- echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
+ echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE27} >> ${script}
- echo "else" >> ${script}
+ echo "else" >> ${script}
sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE30} >> ${script}
echo "fi" >> ${script}
;;
if [ -z "${flavor}" ] ; then
cat >> ${script} <<EOF
cd /boot
-%ifnarch ia64
+%ifnarch ia64
ln -sf vmlinuz-%{KVERREL} vmlinuz
%endif
ln -sf System.map-%{KVERREL} System.map
%{!?kversion: %define kversion @LINUXRELEASE@}
%{!?release: %define release @RELEASE@}
%{!?lustre_name: %define lustre_name lustre}
+%{!?build_lustre_tests: %define build_lustre_tests 1}
%define is_client %(bash -c "if [[ %{lustre_name} = *-client ]]; then echo -n '1'; else echo -n '0'; fi")
# for those uses that don't want the -smp/-bigsmp on the end of %kversion
# override %optflags so that the vendor's overzealous flags don't create
# build failures
%define optflags -g -O2 -Werror
-%configure @ac_configure_args@ %{?configure_flags:configure_flags}
+CONFIGURE_ARGS=""
+%if %{build_lustre_tests}
+CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests --enable-liblustre-tests"
+%else
+CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
+%endif
+%configure %{?configure_args:%configure_args} $CONFIGURE_ARGS
make -j $RPM_BUILD_NCPUS -s
%install
echo '%attr(-, root, root) /usr/include/linux/lustre_types.h' >>lustre.files
fi
+%if %{build_lustre_tests}
echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
echo '%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
-modules_excludes="llog_test"
+modules_excludes="|llog_test"
if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
fi
+%endif
pushd $RPM_BUILD_ROOT >/dev/null
-find lib/modules/%{kversion}/kernel -type f | awk "!/($modules_excludes)/ {print \"%attr(-, root, root) /\"\$0}" >>$RPM_BUILD_DIR/lustre-%{version}/lustre-modules.files
+find lib/modules/%{kversion}/kernel -type f | awk "!/(ZZZZZZZZZZ$modules_excludes)/ {print \"%attr(-, root, root) /\"\$0}" >>$RPM_BUILD_DIR/lustre-%{version}/lustre-modules.files
popd >/dev/null
%files -f lustre.files
# %files deps-sles
# %files deps-rhel
+%if %{build_lustre_tests}
%files tests -f lustre-tests.files
+%endif
%post modules
if [ -f /boot/System.map-%{kversion} ]; then
depmod -ae %{kversion} || exit 0
fi
+%if %{build_lustre_tests}
%post tests
if [ -f /boot/System.map-%{kversion} ]; then
depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
else
depmod -ae %{kversion} || exit 0
fi
+%endif
%clean
rm -rf $RPM_BUILD_ROOT