aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew G Morgan <morgan@kernel.org>2013-12-24 09:17:11 -0800
committerAndrew G Morgan <morgan@kernel.org>2013-12-24 09:17:11 -0800
commitdfea7eba31e6d15e8a63f818bb4438340b70a8c9 (patch)
tree8c72b9bc82618355023854b753e4e3e3570431aa
parent158b7732f139d12de955026074d594a8d9c84554 (diff)
downloadlibcap-dfea7eba31e6d15e8a63f818bb4438340b70a8c9.tar.gz
Add a .pc file to the library.
This patch was generated by Bryan Kadzban, and most recently supported by Thomas H.P. Anderson. For more info on what this file is used for, read: http://en.wikipedia.org/wiki/Pkg-config Signed-off-by: Andrew G Morgan <morgan@kernel.org>
-rw-r--r--Make.Rules1
-rw-r--r--README1
-rw-r--r--libcap/Makefile16
-rw-r--r--libcap/libcap.pc.in11
4 files changed, 27 insertions, 2 deletions
diff --git a/Make.Rules b/Make.Rules
index 8393738..eea456d 100644
--- a/Make.Rules
+++ b/Make.Rules
@@ -35,6 +35,7 @@ MANDIR=$(FAKEROOT)$(man_prefix)/man
SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin
INCDIR=$(FAKEROOT)$(inc_prefix)/include
LIBDIR=$(FAKEROOT)$(lib_prefix)/$(lib)
+PKGCONFIGDIR=$(FAKEROOT)$(prefix)/$(lib)/pkgconfig
# common defines for libcap
LIBTITLE=libcap
diff --git a/README b/README
index b4740f0..7356eac 100644
--- a/README
+++ b/README
@@ -20,6 +20,7 @@ More information on capabilities in the Linux kernel can be found at
installs the library libcap.XX.Y in /lib[64]/
the binaries in /sbin/
the <sys/capability.h> file in /usr/include
+ the libcap.pc file in /usr/lib[64]/pkgconfig
* for some example programs look in progs.
diff --git a/libcap/Makefile b/libcap/Makefile
index 5e92596..6aa1055 100644
--- a/libcap/Makefile
+++ b/libcap/Makefile
@@ -17,6 +17,7 @@ FILES=cap_alloc cap_proc cap_extint cap_flag cap_text
ifeq ($(LIBATTR),yes)
FILES += cap_file
LDFLAGS += -lattr
+DEPS = -lattr
endif
INCLS=libcap.h cap_names.h $(INCS)
@@ -25,13 +26,22 @@ MAJLIBNAME=$(LIBNAME).$(VERSION)
MINLIBNAME=$(MAJLIBNAME).$(MINOR)
GPERF_OUTPUT = _caps_output.gperf
-all: $(MINLIBNAME) $(STALIBNAME)
+all: $(MINLIBNAME) $(STALIBNAME) libcap.pc
ifeq ($(shell gperf --version > /dev/null 2>&1 && echo yes),yes)
USE_GPERF_OUTPUT = $(GPERF_OUTPUT)
INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT)
endif
+libcap.pc: libcap.pc.in
+ sed -e 's,@prefix@,$(prefix),' \
+ -e 's,@exec_prefix@,$(exec_prefix),' \
+ -e 's,@libdir@,$(lib_prefix)/$(lib),' \
+ -e 's,@includedir@,$(inc_prefix)/include,' \
+ -e 's,@VERSION@,$(VERSION).$(MINOR),' \
+ -e 's,@deps@,$(DEPS),' \
+ $< >$@
+
_makenames: _makenames.c cap_names.list.h
$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
@@ -71,9 +81,11 @@ install: all
ifeq ($(FAKEROOT),)
-/sbin/ldconfig
endif
+ mkdir -p -m 0755 $(PKGCONFIGDIR)
+ install -m 0644 libcap.pc $(PKGCONFIGDIR)/libcap.pc
clean:
$(LOCALCLEAN)
- rm -f $(OBJS) $(LIBNAME)* $(STALIBNAME)
+ rm -f $(OBJS) $(LIBNAME)* $(STALIBNAME) libcap.pc
rm -f cap_names.h cap_names.list.h _makenames $(GPERF_OUTPUT)
cd include/sys && $(LOCALCLEAN)
diff --git a/libcap/libcap.pc.in b/libcap/libcap.pc.in
new file mode 100644
index 0000000..a28e3e4
--- /dev/null
+++ b/libcap/libcap.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libcap
+Description: libcap
+Version: @VERSION@
+Libs: -L${libdir} -lcap
+Libs.private: @deps@
+Cflags: -I${includedir}