Whamcloud - gitweb
LU-9215 build: Re-add the lustre-devel package 28/40728/5
authorJames Simmons <jsimmons@infradead.org>
Sun, 6 Dec 2020 02:03:22 +0000 (21:03 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 17 Dec 2020 17:00:39 +0000 (17:00 +0000)
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/40728
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
config/lustre-build.m4
debian/control
debian/control.main
debian/lustre-dev.install
lustre.spec.in
lustre/utils/.gitignore
lustre/utils/Makefile.am
lustre/utils/lustre.pc.in [new file with mode: 0644]

index a4abb21..e6219eb 100644 (file)
@@ -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
index ead0fdd..b7b07c8 100644 (file)
@@ -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
index ead0fdd..b7b07c8 100644 (file)
@@ -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
index 851d6af..3fefe7a 100644 (file)
@@ -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
index 1a7bf96..8c9c400 100644 (file)
@@ -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
index 8c57e3b..fb8c74e 100644 (file)
@@ -5,6 +5,7 @@
 /tunefs.lustre
 /lctl
 /lfs
+/lustre.pc
 /wirecheck
 /wiretest
 /llog_reader
index 22cc532..d7d7bdb 100644 (file)
@@ -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 (file)
index 0000000..9621f53
--- /dev/null
@@ -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