#
# Conditional build:
%bcond_with pam # PAM authentication support
+%bcond_with system_libtom # use system libtommath/libtomcrypt
Summary: Dropbear - a smallish ssh2 server
Summary(pl.UTF-8): Dropbear - mały serwer ssh2
Group: Applications/Networking
Source0: https://matt.ucc.asn.au/dropbear/releases/%{name}-%{version}.tar.bz2
# Source0-md5: c21a01111aa5015db038c6efdb85717d
+Patch0: system-libtom.patch
URL: https://matt.ucc.asn.au/dropbear/dropbear.html
BuildRequires: autoconf >= 2.50
BuildRequires: automake
+%{?with_system_libtom:BuildRequires: libtomcrypt-devel}
+%{?with_system_libtom:BuildRequires: libtommath-devel}
%{?with_pam:BuildRequires: pam-devel}
BuildRequires: zlib-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%prep
%setup -q
+%patch0 -p1
+
+%{?with_system_libtom:rm -r libtomcrypt libtommath}
%build
%{__aclocal}
%{__autoconf}
%{__autoheader}
%configure \
+ %{?with_system_libtom:--disable-bundled-libtom} \
+ %{__enable_disable_not system_libtom bundled-libtom} \
%{?with_pam:--enable-pam}
%{__make}
--- /dev/null
+--- dropbear-2014.66/configure.ac~ 2014-10-23 16:43:38.000000000 +0300
++++ dropbear-2014.66/configure.ac 2015-01-25 19:00:39.840166231 +0200
+@@ -660,6 +660,7 @@
+ AC_EXEEXT
+
+ # XXX there must be a nicer way to do this
++if test $BUNDLED_LIBTOM = 1 ; then
+ AS_MKDIR_P(libtomcrypt/src/ciphers/aes)
+ AS_MKDIR_P(libtomcrypt/src/ciphers/safer)
+ AS_MKDIR_P(libtomcrypt/src/ciphers/twofish)
+@@ -710,8 +711,10 @@
+ AS_MKDIR_P(libtomcrypt/src/pk/pkcs1)
+ AS_MKDIR_P(libtomcrypt/src/pk/rsa)
+ AS_MKDIR_P(libtomcrypt/src/prngs)
++LIBTOM_FILES="libtomcrypt/Makefile libtommath/Makefile"
++fi
+ AC_CONFIG_HEADER(config.h)
+-AC_CONFIG_FILES(Makefile libtomcrypt/Makefile libtommath/Makefile)
++AC_CONFIG_FILES(Makefile $LIBTOM_FILES)
+ AC_OUTPUT
+
+ AC_MSG_NOTICE()