Remove examples from build

epel9
Philip Kovacs 4 years ago
parent 88e916c499
commit ce46983cc5

@ -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 <pkfed@fedoraproject.org> - 1.12.1-7
- Remove examples from build
* Tue Apr 13 2021 Philip Kovacs <pkfed@fedoraproject.org> - 1.12.1-6
- Fix canonical changelog dates

@ -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])
Loading…
Cancel
Save