From 16af4e5ed634942cf6d8a847832684c5542a956c Mon Sep 17 00:00:00 2001 From: James Simmons Date: Sat, 5 Dec 2020 21:03:22 -0500 Subject: [PATCH] LU-9215 build: Re-add the lustre-devel package Traditonally on rpm systems a special devel package exist that contains userland headers and symlinks for the libraries. This patch creates such a package. The introduction of this new package changes the dependency of lustre-test packages since the user land headers are tested to make sure they compile for user land applications. Update the dpk package as well. Lastly we add pkg-config support to Lustre as well. This means that if do configure --prefix=special_place it will not break external applications if they use pkg-config. Change-Id: I3e856d85239d1712e21f7ecc633d9fae569238e6 Test-Parameters: trivial Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/40728 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Nathaniel Clark Reviewed-by: Alexey Lyashkov Reviewed-by: Oleg Drokin --- config/lustre-build.m4 | 1 + debian/control | 2 +- debian/control.main | 2 +- debian/lustre-dev.install | 1 + lustre.spec.in | 41 ++++++++++++++++++++++++++++++++--------- lustre/utils/.gitignore | 1 + lustre/utils/Makefile.am | 3 +++ lustre/utils/lustre.pc.in | 10 ++++++++++ 8 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 lustre/utils/lustre.pc.in diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index a4abb21..e6219eb 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -460,6 +460,7 @@ AC_DEFUN([LB_CONFIG_FILES], [ AC_PACKAGE_TARNAME[-dkms.spec] ldiskfs/Makefile ldiskfs/autoMakefile + lustre/utils/lustre.pc lustre-iokit/Makefile lustre-iokit/obdfilter-survey/Makefile lustre-iokit/ost-survey/Makefile diff --git a/debian/control b/debian/control index ead0fdd..b7b07c8 100644 --- a/debian/control +++ b/debian/control @@ -84,7 +84,7 @@ Package: lustre-tests Section: utils Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 Priority: optional -Depends: lustre-iokit (= ${binary:Version}), attr, rsync, perl, lsof, libtool, libtool-bin, mpi-default-bin, selinux-utils +Depends: lustre-iokit (= ${binary:Version}), lustre-dev (= ${binary:Version}), attr, rsync, perl, lsof, libtool, libtool-bin, mpi-default-bin, selinux-utils Description: Test suite for the Lustre filesystem Lustre is a scalable, secure, robust, highly-available cluster file system. This release is maintained by Whamcloud and available from diff --git a/debian/control.main b/debian/control.main index ead0fdd..b7b07c8 100644 --- a/debian/control.main +++ b/debian/control.main @@ -84,7 +84,7 @@ Package: lustre-tests Section: utils Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 Priority: optional -Depends: lustre-iokit (= ${binary:Version}), attr, rsync, perl, lsof, libtool, libtool-bin, mpi-default-bin, selinux-utils +Depends: lustre-iokit (= ${binary:Version}), lustre-dev (= ${binary:Version}), attr, rsync, perl, lsof, libtool, libtool-bin, mpi-default-bin, selinux-utils Description: Test suite for the Lustre filesystem Lustre is a scalable, secure, robust, highly-available cluster file system. This release is maintained by Whamcloud and available from diff --git a/debian/lustre-dev.install b/debian/lustre-dev.install index 851d6af..3fefe7a 100644 --- a/debian/lustre-dev.install +++ b/debian/lustre-dev.install @@ -1,3 +1,4 @@ debian/tmp/usr/include/lustre/* usr/include/lustre +debian/tmp/usr/lib/pkgconfig/* usr/lib/pkgconfig debian/tmp/usr/lib/*.so usr/lib debian/tmp/usr/lib/*.a usr/lib diff --git a/lustre.spec.in b/lustre.spec.in index 1a7bf96..8c9c400 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -317,6 +317,22 @@ A set of scripts to operate Lustre resources in a High Availablity environment for both Pacemaker and rgmanager. %endif +%package devel +Summary: Lustre include headers +Group: Development/Kernel +Provides: lustre-devel = %{version} +Requires: %{lustre_name} = %{version} +Requires: %{requires_kmod_name} = %{requires_kmod_version} + +%description devel +This package contains the header files needed for building additional +applications against the Lustre / LNet utilities libraries. + +:> lustre-devel.files +%if %{with lustre_modules} +find . -type f -name '*.h' | grep uapi | sed 's/.*uapi\//usr\/include\//' >> lustre-devel.files +%endif + %if %{with lustre_tests} %package tests Summary: Lustre testing framework @@ -325,7 +341,7 @@ Provides: lustre-tests = %{version} %if %{with lustre_iokit} Requires: lustre-iokit %endif -Requires: lustre-client = %{version} +Requires: lustre-devel = %{version} %if %{with lustre_modules} Requires: %{requires_kmod_name} = %{requires_kmod_version} Requires: %{requires_kmod_tests_name} = %{requires_kmod_version} @@ -550,7 +566,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/liblnetconfig.la echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files %endif %if %{with shared} -echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files +echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre-devel.files echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so.*' >>lustre.files %endif @@ -590,6 +606,19 @@ if [ -n "$MPI_BIN" ]; then fi %endif +%files devel -f lustre-devel.files +%defattr(-,root,root) +%{_libdir}/pkgconfig/lustre.pc +%if %{with static} +%{_libdir}/liblustreapi.a +%endif +%if %{with shared} +%{_libdir}/liblustreapi.so +%endif +%{_includedir}/lustre +%{_includedir}/linux/lnet +%{_includedir}/linux/lustre + %files -f lustre.files %defattr(-,root,root) %{_sbindir}/* @@ -623,15 +652,9 @@ fi %{_mandir}/man?/* %endif -%if %{with static} -%{_libdir}/liblustreapi.a -%endif %if %{with shared} -%{_libdir}/liblustreapi.so* +%{_libdir}/liblustreapi.so.* %endif -%{_includedir}/lustre -%{_includedir}/linux/lnet -%{_includedir}/linux/lustre %{_sysconfdir}/udev/rules.d/99-lustre.rules %if %{with servers} %{_sysconfdir}/udev/rules.d/99-lustre-server.rules diff --git a/lustre/utils/.gitignore b/lustre/utils/.gitignore index 8c57e3b..fb8c74e 100644 --- a/lustre/utils/.gitignore +++ b/lustre/utils/.gitignore @@ -5,6 +5,7 @@ /tunefs.lustre /lctl /lfs +/lustre.pc /wirecheck /wiretest /llog_reader diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am index 22cc532..d7d7bdb 100644 --- a/lustre/utils/Makefile.am +++ b/lustre/utils/Makefile.am @@ -105,6 +105,9 @@ liblustreapi_la_LDFLAGS = $(LIBREADLINE) -version-info 1:0:0 \ -Wl,--version-script=liblustreapi.map liblustreapi_la_LIBADD = $(top_builddir)/libcfs/libcfs/libcfs.la +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = lustre.pc + if UTILS LIB_TARGETS = if PLUGINS diff --git a/lustre/utils/lustre.pc.in b/lustre/utils/lustre.pc.in new file mode 100644 index 0000000..9621f53 --- /dev/null +++ b/lustre/utils/lustre.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ + +Name: lustreapi +Description: Library that applications can use to take advantage of Lustre's advance features +Version: @PACKAGE_VERSION@ +Cflags: -I${includedir}/lustre +Libs: -L${libdir} -llustreapi -- 1.8.3.1