openconnect.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. # RHEL6/7 still has ancient GnuTLS
  2. %if 0%{?rhel_version} > 0 && 0%{?rhel_version} < 800
  3. %define use_gnutls 0
  4. %else
  5. %define use_gnutls 1
  6. %endif
  7. # RHEL has no libproxy, and no %%make_install macro
  8. %if 0%{?rhel}
  9. %define use_libproxy 0
  10. %define make_install %{__make} install DESTDIR=%{?buildroot}
  11. %define use_tokens 0
  12. %else
  13. %define use_libproxy 1
  14. %define use_tokens 1
  15. %endif
  16. # Fedora has tss2-sys from F29 onwards, and RHEL from 9 onwards.
  17. %if 0%{?rhel_version} < 900
  18. %define use_tss2_esys 0
  19. %else
  20. %define use_tss2_esys 1
  21. %endif
  22. %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
  23. %define libname libopenconnect5
  24. Name: openconnect
  25. Version: 8.20+git20220220
  26. Release: 0
  27. Summary: Open client for SSL VPNs
  28. License: LGPL-2.1
  29. URL: https://www.infradead.org/openconnect.html
  30. Source0: https://www.infradead.org/openconnect/download/%{name}-%{version}.tar.gz
  31. BuildRequires: pkgconfig(libxml-2.0) krb5-devel
  32. BuildRequires: autoconf automake libtool gettext
  33. %if !0%{?rhel_version} == 700
  34. BuildRequires: pkgconfig(liblz4) pkgconfig(libpcsclite)
  35. BuildRequires: pkgconfig(uid_wrapper) pkgconfig(socket_wrapper)
  36. %endif
  37. %if 0%{?fedora}
  38. BuildRequires: pkgconfig(json-parser)
  39. %endif
  40. %if 0%{?fedora} || 0%{?suse_version} > 1500
  41. # SoftHSM doesn't install on EPEL8: https://bugzilla.redhat.com/show_bug.cgi?id=1829480
  42. BuildRequires: softhsm
  43. %endif
  44. Obsoletes: openconnect-lib-compat < %{version}-%{release}
  45. Requires: vpnc-script
  46. %if 0%{?fedora} || 0%{?suse_version}
  47. BuildRequires: pkgconfig(libp11) pkgconfig(p11-kit-1)
  48. %endif
  49. %if 0%{?fedora}
  50. BuildRequires: glibc-langpack-cs
  51. %endif
  52. %if %{use_gnutls}
  53. %if !0%{?rhel_version} == 700
  54. BuildRequires: trousers-devel
  55. %endif
  56. BuildRequires: pkgconfig(gnutls)
  57. %if !0%{?suse_version} == 1500
  58. BuildRequires: ocserv
  59. %endif
  60. %else
  61. BuildRequires: pkgconfig(openssl)
  62. %endif
  63. %if %{use_libproxy}
  64. BuildRequires: pkgconfig(libproxy-1.0)
  65. %endif
  66. %if %{use_tokens}
  67. BuildRequires: pkgconfig(stoken) pkgconfig(libpskc)
  68. %endif
  69. %if %{use_tss2_esys}
  70. BuildRequires: pkgconfig(tss2-esys) pkgconfig(tss2-tctildr) pkgconfig(tss2-mu)
  71. # https://bugzilla.redhat.com/show_bug.cgi?id=1638961
  72. BuildRequires: libgcrypt-devel
  73. %if 0%{?fedora} > 32
  74. # Older versions of tss2-esys don't have the swtpm TCTI
  75. BuildRequires: swtpm swtpm-tools
  76. %endif
  77. %endif
  78. %description
  79. This package provides a multiprotocol VPN client for Cisco AnyConnect,
  80. Juniper SSL VPN / Pulse Connect Secure, and Palo Alto Networks GlobalProtect
  81. SSL VPN.
  82. %package -n %{libname}
  83. Summary: Libraries for openconnect
  84. Group: System/Libraries
  85. %description -n %{libname}
  86. This package provides libraries for Cisco's "AnyConnect" VPN, which uses
  87. HTTPS and DTLS protocols. AnyConnect is supported by the ASA5500 Series,
  88. by IOS 12.4(9)T or later on Cisco SR500, 870, 880, 1800, 2800, 3800,
  89. 7200 Series and Cisco 7301 Routers, and probably others.
  90. %package devel
  91. Summary: Development package for OpenConnect VPN authentication tools
  92. Requires: %{name}%{?_isa} = %{version}-%{release}
  93. %description devel
  94. This package provides the core HTTP and authentication support from
  95. the OpenConnect VPN client, to be used by GUI authentication dialogs
  96. for NetworkManager etc.
  97. %prep
  98. %setup -q
  99. if [ ! -x configure ]; then
  100. NOCONFIGURE=x ./autogen.sh
  101. fi
  102. %build
  103. %configure --disable-dsa-tests \
  104. %if %{use_gnutls}
  105. %if 0%{?fedora} || 0%{?rhel_version} > 700
  106. --with-default-gnutls-priority="@OPENCONNECT,SYSTEM" \
  107. %endif
  108. --without-gnutls-version-check \
  109. %else
  110. --with-openssl --without-openssl-version-check \
  111. %endif
  112. %if 0%{?rhel_version} == 0 || 0%{?rhel_version} >= 800
  113. --htmldir=%{_pkgdocdir} \
  114. %else
  115. --disable-docs \
  116. %endif
  117. --with-vpnc-script=/etc/vpnc/vpnc-script
  118. make %{?_smp_mflags} V=1
  119. %install
  120. %make_install
  121. mkdir -p $RPM_BUILD_ROOT/%{_pkgdocdir}
  122. rm -f $RPM_BUILD_ROOT/%{_libdir}/libopenconnect.la
  123. rm -f $RPM_BUILD_ROOT/%{_libexecdir}/openconnect/tncc-wrapper.py
  124. rm -f $RPM_BUILD_ROOT/%{_libexecdir}/openconnect/hipreport-android.sh
  125. %find_lang %{name}
  126. %check
  127. %if 0%{?fedora} || 0%{?rhel_version} > 700
  128. # Clear RDRAND capability bit to work around
  129. # https://bugzilla.redhat.com/show_bug.cgi?id=1831086
  130. make VERBOSE=1 OPENSSL_ia32cap=~0x4000000000000000 XFAIL_TESTS="obsolete-server-crypto" check
  131. %else
  132. # Test setup for OpenSSL builds in RHEL6.
  133. make VERBOSE=1 XFAIL_TESTS="auth-nonascii bad_dtls_test" check
  134. %endif
  135. %files -f %{name}.lang
  136. %{_sbindir}/openconnect
  137. %{_libexecdir}/openconnect/
  138. %{_mandir}/man8/*
  139. %{_datadir}/bash-completion/completions/openconnect
  140. %doc TODO COPYING.LGPL
  141. %doc %{_pkgdocdir}
  142. %post -n %{libname} -p /sbin/ldconfig
  143. %postun -n %{libname} -p /sbin/ldconfig
  144. %files -n %{libname}
  145. %{_libdir}/libopenconnect.so.*
  146. %files devel
  147. %{_libdir}/libopenconnect.so
  148. %{_includedir}/openconnect.h
  149. %{_libdir}/pkgconfig/openconnect.pc
  150. %changelog
  151. * Wed Feb 23 2022 OpenConnect Team <openconnect-devel@lists.infradead.org> - %{version}-%{release}
  152. - Adapt for SUSE builds for OBS
  153. * Tue Jul 16 2019 David Woodhouse <dwmw2@infradead.org> - %{version}-%{release}
  154. - Autopackaging for COPR