All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] keyutils: Add pkg-config file for keyutils library
@ 2018-10-12 18:08 Dave Jiang
  2018-10-12 18:11 ` Dan Williams
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dave Jiang @ 2018-10-12 18:08 UTC (permalink / raw)
  To: keyrings

This is needed so that other projects can add a dependency on libkeyutils
via PKG_CHECK_MODULES([KEYUTILS], [keyutils]).  This enabling makes 'make
install' do the right thing, and of course individual distros will need to
add enabling to their associated packages (rpm, deb, etc.) so the package
manager installs do the right thing.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 Makefile       |   22 ++++++++++++++++++++++
 keyutils.pc.in |   10 ++++++++++
 keyutils.spec  |    1 +
 3 files changed, 33 insertions(+)
 create mode 100644 keyutils.pc.in

diff --git a/Makefile b/Makefile
index 5ce6746..fdd96d8 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ MAN8		:= $(MANDIR)/man8
 INCLUDEDIR	:= /usr/include
 LN		:= ln
 LNS		:= $(LN) -sf
+PREFIX 		:= /usr
 
 ###############################################################################
 #
@@ -78,6 +79,9 @@ endif
 endif
 endif
 
+PKGCONFIG 	:= keyutils.pc
+PKGCONFIG_DIR 	:= $(USRLIBDIR)/pkgconfig
+
 ###############################################################################
 #
 # This is necessary if glibc doesn't know about the key management error codes
@@ -163,6 +167,15 @@ dns.afsdb.o: dns.afsdb.c key.dns.h
 # Install everything
 #
 ###############################################################################
+pkgconfig:
+	sed \
+	-e 's,@VERSION\@,$(VERSION),g' \
+	-e 's,@prefix\@,$(PREFIX),g' \
+	-e 's,@exec_prefix\@,$(PREFIX),g' \
+	-e 's,@libdir\@,$(USRLIBDIR),g' \
+	-e 's,@includedir\@,$(INCLUDEDIR),g' \
+	< $(PKGCONFIG).in > $(PKGCONFIG) || rm $(PKGCONFIG)
+
 install: all
 ifeq ($(NO_ARLIB),0)
 	$(INSTALL) -D -m 0644 $(ARLIB) $(DESTDIR)$(USRLIBDIR)/$(ARLIB)
@@ -172,6 +185,15 @@ ifeq ($(NO_SOLIB),0)
 	$(LNS) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
 	mkdir -p $(DESTDIR)$(USRLIBDIR)
 	$(LNS) $(LIBDIR)/$(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB)
+	sed \
+	-e 's,@VERSION\@,$(VERSION),g' \
+	-e 's,@prefix\@,$(PREFIX),g' \
+	-e 's,@exec_prefix\@,$(PREFIX),g' \
+	-e 's,@libdir\@,$(USRLIBDIR),g' \
+	-e 's,@includedir\@,$(INCLUDEDIR),g' \
+	< $(PKGCONFIG).in > $(PKGCONFIG) || rm $(PKGCONFIG)
+	$(INSTALL) -D $(PKGCONFIG) $(PKGCONFIG_DIR)/$(PKGCONFIG)
+	rm $(PKGCONFIG)
 endif
 	$(INSTALL) -D keyctl $(DESTDIR)$(BINDIR)/keyctl
 	$(INSTALL) -D request-key $(DESTDIR)$(SBINDIR)/request-key
diff --git a/keyutils.pc.in b/keyutils.pc.in
new file mode 100644
index 0000000..44fd6e1
--- /dev/null
+++ b/keyutils.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: keyutils
+Description: keyutils library
+Version: @VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lkeyutils
diff --git a/keyutils.spec b/keyutils.spec
index 1cffbe1..b78c678 100644
--- a/keyutils.spec
+++ b/keyutils.spec
@@ -106,6 +106,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man7/*
 %{_libdir}/libkeyutils.so.%{libapiversion}
 %{_libdir}/libkeyutils.so.%{libapivermajor}
+%{_libdir}/pkgconfig/keyutils.pc
 
 %files libs-devel
 %defattr(-,root,root,-)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] keyutils: Add pkg-config file for keyutils library
  2018-10-12 18:08 [PATCH 1/2] keyutils: Add pkg-config file for keyutils library Dave Jiang
@ 2018-10-12 18:11 ` Dan Williams
  2018-11-02 14:09 ` David Howells
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Dan Williams @ 2018-10-12 18:11 UTC (permalink / raw)
  To: keyrings

On Fri, Oct 12, 2018 at 11:08 AM Dave Jiang <dave.jiang@intel.com> wrote:
>
> This is needed so that other projects can add a dependency on libkeyutils
> via PKG_CHECK_MODULES([KEYUTILS], [keyutils]).  This enabling makes 'make
> install' do the right thing, and of course individual distros will need to
> add enabling to their associated packages (rpm, deb, etc.) so the package
> manager installs do the right thing.

This looks good to me and saves people from needing to duplicate the
same open coded autoconf goop that cifs-utils and nfs-utils have had
to implement.

> Signed-off-by: Dave Jiang <dave.jiang@intel.com>

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] keyutils: Add pkg-config file for keyutils library
  2018-10-12 18:08 [PATCH 1/2] keyutils: Add pkg-config file for keyutils library Dave Jiang
  2018-10-12 18:11 ` Dan Williams
@ 2018-11-02 14:09 ` David Howells
  2018-11-02 15:32 ` Dave Jiang
  2018-11-02 15:59 ` David Howells
  3 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2018-11-02 14:09 UTC (permalink / raw)
  To: keyrings

Dave Jiang <dave.jiang@intel.com> wrote:

> This is needed so that other projects can add a dependency on libkeyutils
> via PKG_CHECK_MODULES([KEYUTILS], [keyutils]).  This enabling makes 'make
> install' do the right thing, and of course individual distros will need to
> add enabling to their associated packages (rpm, deb, etc.) so the package
> manager installs do the right thing.
> 
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>

Just to note that this doesn't apply.  Also, I suspect it needs a build-time
and/or install-time dependency in the spec file.

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] keyutils: Add pkg-config file for keyutils library
  2018-10-12 18:08 [PATCH 1/2] keyutils: Add pkg-config file for keyutils library Dave Jiang
  2018-10-12 18:11 ` Dan Williams
  2018-11-02 14:09 ` David Howells
@ 2018-11-02 15:32 ` Dave Jiang
  2018-11-02 15:59 ` David Howells
  3 siblings, 0 replies; 5+ messages in thread
From: Dave Jiang @ 2018-11-02 15:32 UTC (permalink / raw)
  To: keyrings



On 11/2/18 7:09 AM, David Howells wrote:
> Dave Jiang <dave.jiang@intel.com> wrote:
> 
>> This is needed so that other projects can add a dependency on libkeyutils
>> via PKG_CHECK_MODULES([KEYUTILS], [keyutils]).  This enabling makes 'make
>> install' do the right thing, and of course individual distros will need to
>> add enabling to their associated packages (rpm, deb, etc.) so the package
>> manager installs do the right thing.
>>
>> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> 
> Just to note that this doesn't apply.  Also, I suspect it needs a build-time
> and/or install-time dependency in the spec file.

Hi David. I applied to the next branch for keyutils and didn't hit
issues. Is the top commit:
e65217ca62a76 Add password support from Aug 30?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] keyutils: Add pkg-config file for keyutils library
  2018-10-12 18:08 [PATCH 1/2] keyutils: Add pkg-config file for keyutils library Dave Jiang
                   ` (2 preceding siblings ...)
  2018-11-02 15:32 ` Dave Jiang
@ 2018-11-02 15:59 ` David Howells
  3 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2018-11-02 15:59 UTC (permalink / raw)
  To: keyrings

Dave Jiang <dave.jiang@intel.com> wrote:

> Hi David. I applied to the next branch for keyutils and didn't hit
> issues. Is the top commit:
> e65217ca62a76 Add password support from Aug 30?

I've just updated the master branch if you could use that.

I'm adding manpages to the public key keyctl op patch, so that's not on there
at the moment.

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-02 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-12 18:08 [PATCH 1/2] keyutils: Add pkg-config file for keyutils library Dave Jiang
2018-10-12 18:11 ` Dan Williams
2018-11-02 14:09 ` David Howells
2018-11-02 15:32 ` Dave Jiang
2018-11-02 15:59 ` David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.