@@ -9,5 +9,6 @@
/run-tests.log
/test_*
cscope.*
+libfsverity.pc
ncscope.*
tags
@@ -51,6 +51,7 @@ QUIET_CC = @echo ' CC ' $@;
QUIET_CCLD = @echo ' CCLD ' $@;
QUIET_AR = @echo ' AR ' $@;
QUIET_LN = @echo ' LN ' $@;
+QUIET_GEN = @echo ' GEN ' $@;
endif
USE_SHARED_LIB ?=
PREFIX ?= /usr/local
@@ -62,7 +63,7 @@ PKGCONF ?= pkg-config
# Rebuild if a user-specified setting that affects the build changed.
.build-config: FORCE
- @flags='$(CC):$(CFLAGS):$(CPPFLAGS):$(LDFLAGS):$(USE_SHARED_LIB)'; \
+ @flags='$(CC):$(CFLAGS):$(CPPFLAGS):$(LDFLAGS):$(USE_SHARED_LIB):$(PREFIX):$(LIBDIR):$(INCDIR):$(BINDIR)'; \
if [ "$$flags" != "`cat $@ 2>/dev/null`" ]; then \
[ -e $@ ] && echo "Rebuilding due to new settings"; \
echo "$$flags" > $@; \
@@ -119,6 +120,15 @@ libfsverity.so:libfsverity.so.$(SOVERSION)
DEFAULT_TARGETS += libfsverity.so
+# Create the pkg-config file
+libfsverity.pc: lib/libfsverity.pc.in
+ $(QUIET_GEN) sed -e "s|@PREFIX@|$(PREFIX)|" \
+ -e "s|@LIBDIR@|$(LIBDIR)|" \
+ -e "s|@INCDIR@|$(INCDIR)|" \
+ $< > $@
+
+DEFAULT_TARGETS += libfsverity.pc
+
##############################################################################
#### Programs
@@ -190,11 +200,12 @@ check:fsverity test_programs
@echo "All tests passed!"
install:all
- install -d $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INCDIR) $(DESTDIR)$(BINDIR)
+ install -d $(DESTDIR)$(LIBDIR)/pkgconfig $(DESTDIR)$(INCDIR) $(DESTDIR)$(BINDIR)
install -m755 fsverity $(DESTDIR)$(BINDIR)
install -m644 libfsverity.a $(DESTDIR)$(LIBDIR)
install -m755 libfsverity.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)
ln -sf libfsverity.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)/libfsverity.so
+ install -m644 libfsverity.pc $(DESTDIR)$(LIBDIR)/pkgconfig
install -m644 include/libfsverity.h $(DESTDIR)$(INCDIR)
uninstall:
@@ -202,6 +213,7 @@ uninstall:
rm -f $(DESTDIR)$(LIBDIR)/libfsverity.a
rm -f $(DESTDIR)$(LIBDIR)/libfsverity.so.$(SOVERSION)
rm -f $(DESTDIR)$(LIBDIR)/libfsverity.so
+ rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/libfsverity.pc
rm -f $(DESTDIR)$(INCDIR)/libfsverity.h
help:
new file mode 100644
@@ -0,0 +1,10 @@
+prefix=@PREFIX@
+libdir=@LIBDIR@
+includedir=@INCDIR@
+
+Name: libfsverity
+Description: fs-verity library
+Version: 1.2
+Libs: -L${libdir} -lfsverity
+Requires.private: libcrypto
+Cflags: -I${includedir}
@@ -28,6 +28,8 @@ minor=$(echo "$VERS" | cut -d. -f2)
sed -E -i -e "/FSVERITY_UTILS_MAJOR_VERSION/s/[0-9]+/$major/" \
-e "/FSVERITY_UTILS_MINOR_VERSION/s/[0-9]+/$minor/" \
include/libfsverity.h
+sed -E -i "/Version:/s/[0-9]+\.[0-9]+/$VERS/" \
+ lib/libfsverity.pc.in
git commit -a --signoff --message="v$VERS"
git tag --sign "v$VERS" --message="$PKG"