From ce46983cc51154d16b05551e6af3f73623b3f0a2 Mon Sep 17 00:00:00 2001 From: Philip Kovacs Date: Sun, 18 Apr 2021 18:07:15 -0400 Subject: [PATCH] Remove examples from build --- libjwt.spec | 11 +++++++---- without_examples.patch | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 without_examples.patch diff --git a/libjwt.spec b/libjwt.spec index 640f304..308bfe1 100644 --- a/libjwt.spec +++ b/libjwt.spec @@ -1,12 +1,14 @@ Name: libjwt Version: 1.12.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A Javascript Web Token library in C License: MPLv2.0 URL: https://github.com/benmcollins/libjwt Source0: https://github.com/benmcollins/libjwt/archive/v%{version}.tar.gz +Patch0: without_examples.patch + BuildRequires: autoconf BuildRequires: automake BuildRequires: jansson-devel @@ -31,7 +33,7 @@ developing applications that use %{name}. autoreconf -i %build -%configure --disable-static +%configure --disable-static --without-examples %make_build %install @@ -42,8 +44,6 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' %license LICENSE %doc *.md %{_libdir}/*.so.1* -%{_bindir}/jwtauth -%{_bindir}/jwtgen %files devel %doc *.md @@ -52,6 +52,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' %{_libdir}/pkgconfig/libjwt.pc %changelog +* Sun Apr 18 2021 Philip Kovacs - 1.12.1-7 +- Remove examples from build + * Tue Apr 13 2021 Philip Kovacs - 1.12.1-6 - Fix canonical changelog dates diff --git a/without_examples.patch b/without_examples.patch new file mode 100644 index 0000000..40ac3f7 --- /dev/null +++ b/without_examples.patch @@ -0,0 +1,34 @@ +diff --git a/Makefile.am b/Makefile.am +index 8144c12..cee45ba 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,10 @@ + ACLOCAL_AMFLAGS = -I m4 + +-SUBDIRS = include libjwt examples tests dist ++SUBDIRS = include libjwt ++if BUILD_EXAMPLES ++SUBDIRS += examples ++endif ++SUBDIRS += tests dist + + include $(top_srcdir)/doxygen.mk + +diff --git a/configure.ac b/configure.ac +index 4aa1de8..e0e9008 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -20,6 +20,13 @@ AS_IF([test "x$with_openssl" != "xno"], [ + AM_CONDITIONAL([HAVE_OPENSSL], [false]) + ]) + ++AC_ARG_WITH([examples], ++ AS_HELP_STRING([--without-examples], [do not build example programs]), ++ [], ++ [with_examples=yes]) ++ ++AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$with_examples" != "xno"]) ++ + PKG_CHECK_MODULES([JANSSON], [jansson >= 2.0]) + PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [true], [true]) +