0004-Makefile-provide-an-option-to-not-build-manpages.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 3c16d0b7bf809a56affd6e1a4c0998027968b91a Mon Sep 17 00:00:00 2001
  2. From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
  3. Date: Mon, 8 Feb 2016 23:03:48 +0100
  4. Subject: [PATCH] Makefile: provide an option to not build manpages
  5. The process of generating the vpnc.8 man page consists in running the
  6. vpnc tool itself, and parse its --long-help output. While this is
  7. perfectly fine when building natively, it fails completely when
  8. cross-compiling: the vpnc binary that was built cannot be executed on
  9. the build machine.
  10. In order to support such situations with minimal changes, this patch
  11. adjusts the Makefile to make it understand a MANS variable. By
  12. default, it's defined to "vpnc.8", which means the manpage continues
  13. to be built as usual. However, if it's overriden to be empty, then no
  14. manpage is built.
  15. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  16. ---
  17. Makefile | 5 ++++-
  18. 1 file changed, 4 insertions(+), 1 deletion(-)
  19. diff --git a/Makefile b/Makefile
  20. index 7ac225a..ea2cd41 100644
  21. --- a/Makefile
  22. +++ b/Makefile
  23. @@ -54,6 +54,7 @@ endif
  24. SRCS = sysdep.c vpnc-debug.c isakmp-pkt.c tunip.c config.c dh.c math_group.c supp.c decrypt-utils.c crypto.c $(CRYPTO_SRCS)
  25. BINS = vpnc cisco-decrypt test-crypto
  26. OBJS = $(addsuffix .o,$(basename $(SRCS)))
  27. +MANS ?= vpnc.8
  28. CRYPTO_OBJS = $(addsuffix .o,$(basename $(CRYPTO_SRCS)))
  29. BINOBJS = $(addsuffix .o,$(BINS))
  30. BINSRCS = $(addsuffix .c,$(BINS))
  31. @@ -76,7 +77,7 @@ ifneq (,$(findstring Apple,$(shell $(CC) --version)))
  32. override CFLAGS += -fstrict-aliasing -freorder-blocks -fsched-interblock
  33. endif
  34. -all : $(BINS) vpnc.8
  35. +all : $(BINS) $(MANS)
  36. vpnc : $(OBJS) vpnc.o
  37. $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
  38. @@ -136,7 +137,9 @@ install-common: all
  39. install -m600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
  40. install -m755 vpnc-disconnect $(DESTDIR)$(SBINDIR)
  41. install -m755 pcf2vpnc $(DESTDIR)$(BINDIR)
  42. +ifneq ($(MANS),)
  43. install -m644 vpnc.8 $(DESTDIR)$(MANDIR)/man8
  44. +endif
  45. install -m644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1
  46. install -m644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1
  47. install -m644 COPYING $(DESTDIR)$(DOCDIR)
  48. --
  49. 2.6.4