build_lipe() {
local source="$1"
+ local build_type="$2"
local lustre_install_root
local lustre_rpm=''
local lustre_devel_rpm=''
local name
+ local config_params=''
# Extract headers and libraries from lustre RPM for build.
lustre_install_root=$(mktemp -d ${TOPDIR}/root.XXXXXXXX)
# Find the lustre rpm
for rpm in ${source}/*.rpm; do
name=$(rpm --query --queryformat '%{NAME}\n' --package "$rpm")
- if [[ "$name" == "lustre" ]]; then
+ if [[ "$name" == "lustre${build_type}" ]]; then
lustre_rpm="$rpm"
fi
- if [[ "$name" == "lustre-devel" ]]; then
+ if [[ "$name" == "lustre${build_type}-devel" ]]; then
lustre_devel_rpm="$rpm"
fi
done
fi
sh autogen.sh
+ if [[ ${build_type} = *client* ]]; then
+ config_params='--disable-server'
+ fi
CPPFLAGS="\
-I${lustre_install_root}/usr/include/linux/lnet \
LDFLAGS="\
-L${lustre_install_root}/usr/lib64 \
" \
- ./configure || fatal 1 "Error in configure lipe."
+ ./configure ${config_params} || fatal 1 "Error in configure lipe."
make rpms || fatal 1 "Error building rpms for lipe"
mv -f build/RPMS/${TARGET_ARCH}/lipe*.rpm $TOPDIR/RPMS/${TARGET_ARCH}/
local linux="$1"
local linuxobj="$2"
local configure_args=""
+ local client="-client"
cp "$LUSTRE" SOURCES
popd >/dev/null
- if [ $PATCHLESS == false ] && ! build_lipe $TOPDIR/RPMS/${TARGET_ARCH}; then
- return 255
+ if [[ $DISTROMAJ =~ rhel ]] && [[ ${TARGET_ARCH} == 'x86_64' ]]; then
+ [[ $PATCHLESS == false ]] && client=""
+ if ! build_lipe $TOPDIR/RPMS/${TARGET_ARCH} ${client}; then
+ return 255
+ fi
fi
if type -p cleanup_rpmmacros; then
cleanup_rpmmacros
# Declare rpmbuild --with/--without parameters
%bcond_with laudit
+%bcond_with server
%bcond_with zfs
%bcond_with hotpool
%description pylustre
Pylustre is a python library for managing Lustre file system.
+%package lpcc
+Summary: LPCC (Lustre Persisted Client Cache)
+Requires: lipe-pylustre = %{version}-%{release}
+Provides: lipe-lpcc = %{version}-%{release}
+Group: Applications/System
+
+%description lpcc
+Tools for LPCC (Lustre Persisted Client Cache).
+
+%post lpcc
+%if %{with systemd}
+%systemd_post lipe.service
+%endif
+
+%preun lpcc
+%if %{with systemd}
+%systemd_preun lpcc.service
+%else
+/sbin/service lpcc stop >/dev/null 2>&1 ||:
+/sbin/chkconfig --del lpcc
+%endif
+
+%postun lpcc
+%if %{with systemd}
+%systemd_postun_with_restart lpcc.service
+%else
+/sbin/service lpcc condrestart >/dev/null 2>&1 ||:
+%endif
+
+%if %{with server}
%package loris
Summary: Lustre Online Reliability Improvement System
Requires: lipe-pylustre = %{version}-%{release}
/sbin/service lipe_test_scheduler condrestart >/dev/null 2>&1 ||:
%endif
-%package lpcc
-Summary: LPCC (Lustre Persisted Client Cache)
-Requires: lipe-pylustre = %{version}-%{release}
-Provides: lipe-lpcc = %{version}-%{release}
-Group: Applications/System
-
-%description lpcc
-Tools for LPCC (Lustre Persisted Client Cache).
-
-%post lpcc
-%if %{with systemd}
-%systemd_post lipe.service
-%endif
-
-%preun lpcc
-%if %{with systemd}
-%systemd_preun lpcc.service
-%else
-/sbin/service lpcc stop >/dev/null 2>&1 ||:
-/sbin/chkconfig --del lpcc
-%endif
-
-%postun lpcc
-%if %{with systemd}
-%systemd_postun_with_restart lpcc.service
-%else
-/sbin/service lpcc condrestart >/dev/null 2>&1 ||:
-%endif
-
%package server
Summary: Lipe Server Package
Requires: lustre
%description client
Provides lipe tools run on lustre client.
+%endif # end server
Generated using options: @ac_configure_args@
make V=1
-python2 -m py_compile pyclownfish/*.py
python2 -m py_compile pylustre/*.py
+%if %{with server}
+python2 -m py_compile pyclownfish/*.py
python2 -m py_compile pylipe/*.py
python2 -m py_compile pyloris/*.py
python2 -m py_compile pyltest/*.py
+%endif
find pyclownfish pylustre pylipe pyloris pyltest -maxdepth 1 -type f -a -name "*.python_checked" -o -name "*.py" | xargs rm -f
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
cp \
+ lpcc \
+ lipe_virt \
+ src/lpcc_purge \
+ $RPM_BUILD_ROOT%{_bindir}
+
+cp -a pylustre $RPM_BUILD_ROOT%{python_sitelib}
+cp -a \
+ example_configs/clownfish/seperate_mgs/lipe_virt.conf \
+ lpcc.conf \
+ $RPM_BUILD_ROOT%{_sysconfdir}
+
+%if %{with server}
+cp \
ldsync \
lipe_find \
lipe_convert_expr \
lipe_test_console \
lipe_test_launch \
lipe_test_scheduler \
- lipe_virt \
loris_backup \
loris_crontab \
loris_test \
- lpcc \
- src/lpcc_purge \
src/ext4_inode2path \
src/lcreatemany \
src/ldumpstripe \
cp -a pyclownfish $RPM_BUILD_ROOT%{python_sitelib}
cp -a pylipe $RPM_BUILD_ROOT%{python_sitelib}
cp -a pyloris $RPM_BUILD_ROOT%{python_sitelib}
-cp -a pylustre $RPM_BUILD_ROOT%{python_sitelib}
cp -a pyltest $RPM_BUILD_ROOT%{python_sitelib}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
cp -a \
example_configs/loris/loris.conf \
example_configs/ltest/lipe_test_scheduler.conf \
lipe.conf \
- example_configs/clownfish/seperate_mgs/lipe_virt.conf \
- lpcc.conf \
$RPM_BUILD_ROOT%{_sysconfdir}
%if %{with laudit}
%if %{with hotpool}
cp -a example_configs/hotpool/* $RPM_BUILD_ROOT%{_sysconfdir}/
%endif
+%endif # end server
%if %{with systemd}
mkdir -p $RPM_BUILD_ROOT%{_unitdir}/
install -m 0644 -D systemd/lpcc.service $RPM_BUILD_ROOT%{_unitdir}/lpcc.service
+%if %{with server}
install -m 0644 -D systemd/lipe_test_scheduler.service \
$RPM_BUILD_ROOT%{_unitdir}/lipe_test_scheduler.service
%if %{with hotpool}
install -m 0644 -D systemd/lamigo@.service \
$RPM_BUILD_ROOT%{_unitdir}/lamigo@.service
%endif
+%endif # end server
%else
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
install -m 0744 -D init.d/lpcc \
$RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/lpcc
+%if %{with server}
install -m 0744 -D init.d/lipe_test_scheduler \
$RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/lipe_test_scheduler
+%endif # end server
%endif
-install -m 0644 man/lipe_scan.1 $RPM_BUILD_ROOT%{_mandir}/man1/
-install -m 0644 man/lipe_find.1 $RPM_BUILD_ROOT%{_mandir}/man1/
-install -m 0644 man/lfill.1 $RPM_BUILD_ROOT%{_mandir}/man1/
install -m 0644 man/lpcc.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 0644 man/lpcc-start.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 0644 man/lpcc-stop.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 0644 man/lpcc-status.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 0644 man/lpcc.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/
+%if %{with server}
+install -m 0644 man/lipe_scan.1 $RPM_BUILD_ROOT%{_mandir}/man1/
+install -m 0644 man/lipe_find.1 $RPM_BUILD_ROOT%{_mandir}/man1/
+install -m 0644 man/lfill.1 $RPM_BUILD_ROOT%{_mandir}/man1/
%if %{with laudit}
install -m 0644 man/laudit.1 $RPM_BUILD_ROOT%{_mandir}/man1/
install -m 0644 man/laudit-report.1 $RPM_BUILD_ROOT%{_mandir}/man1/
install -m 0644 man/laudit.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/
%endif
+%endif #end server
%clean
rm -rf $RPM_BUILD_ROOT
-%files clownfish
-%{python2_sitelib}/pyclownfish
-%{_bindir}/lcreatemany
-%config(noreplace) %{_sysconfdir}/clownfish.conf
-
-%files loris
-%{python2_sitelib}/pyloris
-%{_bindir}/loris_backup
-%{_bindir}/loris_crontab
-%{_bindir}/loris_test
-%config(noreplace) %{_sysconfdir}/loris.conf
-
%files pylustre
%{python2_sitelib}/pylustre
%{_bindir}/lipe_virt
%config(noreplace) %{_sysconfdir}/lipe_virt.conf
-%files pyltest
-%{python2_sitelib}/pyltest
-%{_bindir}/lipe_test_console
-%{_bindir}/lipe_test_launch
-%{_bindir}/lipe_test_scheduler
-%config(noreplace) %{_sysconfdir}/lipe_test_scheduler.conf
-%if %{with systemd}
- %{_unitdir}/lipe_test_scheduler.service
-%else
- %{_sysconfdir}/rc.d/init.d/lipe_test_scheduler
-%endif
-
%files lpcc
%defattr(-,root,root)
%{_bindir}/lpcc
%{_mandir}/man8/lpcc-status.8*
%{_mandir}/man5/lpcc.conf.5*
+%if %{with server}
+%files loris
+%{python2_sitelib}/pyloris
+%{_bindir}/loris_backup
+%{_bindir}/loris_crontab
+%{_bindir}/loris_test
+%config(noreplace) %{_sysconfdir}/loris.conf
+
+%files clownfish
+%{python2_sitelib}/pyclownfish
+%{_bindir}/lcreatemany
+%config(noreplace) %{_sysconfdir}/clownfish.conf
+
+%files pyltest
+%{python2_sitelib}/pyltest
+%{_bindir}/lipe_test_console
+%{_bindir}/lipe_test_launch
+%{_bindir}/lipe_test_scheduler
+%config(noreplace) %{_sysconfdir}/lipe_test_scheduler.conf
+%if %{with systemd}
+ %{_unitdir}/lipe_test_scheduler.service
+%else
+ %{_sysconfdir}/rc.d/init.d/lipe_test_scheduler
+%endif
+
%files server
%defattr(-,root,root)
%{_bindir}/ext4_inode2path
%{_mandir}/man1/lipe_scan.1*
%{_mandir}/man1/lipe_find.1*
%{_mandir}/man1/lfill.1*
+%endif # end server
%changelog
AM_LDFLAGS = -llnetconfig -llustreapi -lpthread $(json_c_LIBS)
bin_PROGRAMS = \
+ lpcc_purge
+
+noinst_PROGRAMS = generate_definition
+
+if BUILD_SERVER
+bin_PROGRAMS += \
ext4_inode2path \
lcreatemany \
ldumpstripe \
lfill \
lipe_scan \
- lipe_scan2 \
- lpcc_purge
+ lipe_scan2
-noinst_PROGRAMS = lipe_expression_test generate_definition
+noinst_PROGRAMS += lipe_expression_test
if BUILD_LAUDIT
bin_PROGRAMS += laudit laudit-report
if BUILD_HOTPOOL_UTILS
bin_PROGRAMS += lamigo lpurge
endif
+endif
-ext4_inode2path_SOURCES = debug.c debug.h ext4_inode2path.c
-LIPE_SOURCES = cmd.c cmd.h debug.c debug.h \
+LIPE_SOURCES = debug.c debug.h \
flist.c flist.h misc.c misc.h \
lustre_ea.c lustre_ea.h \
lipe_ldiskfs.c lipe_ldiskfs.h \
lipe_object_attrs.h \
lipe_version.c \
lipe_version.h \
- list.h policy.h policy.c \
+ policy.c policy.h \
ldiskfs_read_ldd.c ldiskfs_read_ldd.h \
general_policy.h general_policy.c \
lustre_ea_ldiskfs.c lustre_ea_ldiskfs.h \
posix.c posix.h posix_ea.c posix_ea.h
+
+if BUILD_SERVER
+ext4_inode2path_SOURCES = debug.c debug.h ext4_inode2path.c
+
+LIPE_SOURCES += cmd.c cmd.h \
+ list.h
+endif
+
LIPE_CFLAGS = -Wall -Werror -g -I/usr/include $(json_c_CFLAGS)
LIPE_LDFLAGS = $(AM_LDFLAGS)
LIPE_CFLAGS += $(zfs_CFLAGS)
endif
+if BUILD_SERVER
lipe_scan_SOURCES = lipe_scan.c lipe_config.c lipe_config.h lipe_result.c lipe_result.h $(LIPE_SOURCES)
lipe_scan_CFLAGS = $(LIPE_CFLAGS)
lipe_scan_LDFLAGS = $(LIPE_LDFLAGS) -lssl -lcrypto -lyaml
lpurge_CFLAGS = $(LIPE_CFLAGS)
lpurge_LDFLAGS = $(LIPE_LDFLAGS)
-lpcc_purge_SOURCES = lpcc_purge.c $(LIPE_SOURCES)
-lpcc_purge_CFLAGS = $(LIPE_CFLAGS)
-lpcc_purge_LDFLAGS = $(LIPE_LDFLAGS)
-
lipe_expression_test_SOURCES = lipe_expression_test.c $(LIPE_SOURCES)
lipe_expression_test_CFLAGS = $(LIPE_CFLAGS)
lipe_expression_test_LDFLAGS = $(LIPE_LDFLAGS)
+endif
+
generate_definition_SOURCES = generate_definition.c debug.c debug.h \
general_policy.h
generate_definition_CFLAGS = -Wall -Werror -Wall -Werror -g
generate_definition_LDFLAGS =
+lpcc_purge_SOURCES = lpcc_purge.c $(LIPE_SOURCES)
+lpcc_purge_CFLAGS = $(LIPE_CFLAGS)
+lpcc_purge_LDFLAGS = $(LIPE_LDFLAGS)
+
C_FILES = $(wildcard *.c *.h)
C_CHECKS = $(C_FILES:%=%.c_checked)
CHECKS = $(C_CHECKS)