openconnect.spec.in 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. %global gitsnapshot @ISSNAP@
  2. %if 0%{?gitsnapshot}
  3. %global snapcommit @SNAPCOMMIT@
  4. %global snapcount @SNAPCOUNT@
  5. %global shortcommit %(c=%{snapcommit}; echo ${c:0:7})
  6. %global snapver .git.%{snapcount}.%{shortcommit}
  7. %endif
  8. %global tagver @VERSION@
  9. # RHEL6 still has ancient GnuTLS
  10. %define use_gnutls 0%{?fedora} || 0%{?rhel} >= 7
  11. # Fedora has tss2-sys from F29 onwards, and RHEL from 8 onwards.
  12. %if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
  13. %define use_tss2_esys 1
  14. %else
  15. %define use_tss2_esys 0
  16. %endif
  17. %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
  18. Name: openconnect
  19. Version: %{tagver}%{?snapver}
  20. Release: 0%{?dist}
  21. Summary: Open client for SSL VPNs including Cisco AnyConnect VPN, Juniper Network Connect/Pulse, PAN GlobalProtect, Fortinet, etc.
  22. License: LGPLv2
  23. URL: https://www.infradead.org/openconnect.html
  24. %if 0%{?gitsnapshot}
  25. Source0: https://github.com/openconnect/%{name}/archive/%{snapcommit}/%{name}-%{shortcommit}.tar.gz
  26. %else
  27. Source0: https://www.infradead.org/openconnect/download/%{name}-%{version}.tar.gz
  28. %endif
  29. Source2: gpgkey-BE07D9FD54809AB2C4B0FF5F63762CDA67E2F359.asc
  30. Source3: macros.gpg
  31. BuildRequires: pkgconfig(libxml-2.0) pkgconfig(libpcsclite) krb5-devel gnupg2
  32. BuildRequires: autoconf automake libtool gettext pkgconfig(liblz4)
  33. BuildRequires: pkgconfig(uid_wrapper) pkgconfig(socket_wrapper)
  34. BuildRequires: pkgconfig(libproxy-1.0)
  35. BuildRequires: pkgconfig(stoken) pkgconfig(libpskc)
  36. %if 0%{?fedora}
  37. BuildRequires: pkgconfig(json-parser)
  38. %endif
  39. %if 0%{?fedora} || 0%{?rhel} <= 7
  40. # SoftHSM doesn't install on EPEL8: https://bugzilla.redhat.com/show_bug.cgi?id=1829480
  41. BuildRequires: softhsm
  42. %endif
  43. %if 0%{?fedora} || 0%{?rhel} >= 7
  44. Obsoletes: openconnect-lib-compat < %{version}-%{release}
  45. Requires: vpnc-script
  46. %else
  47. Requires: vpnc
  48. %endif
  49. %if 0%{?fedora} >= 30 || 0%{?rhel} >= 9
  50. BuildRequires: glibc-langpack-cs
  51. %endif
  52. %if %{use_gnutls}
  53. BuildRequires: pkgconfig(gnutls) trousers-devel
  54. # Anywhere we use GnuTLS ,there should be an ocserv package too
  55. BuildRequires: ocserv
  56. %else
  57. BuildRequires: pkgconfig(openssl) pkgconfig(libp11) pkgconfig(p11-kit-1)
  58. %endif
  59. %if %{use_tss2_esys}
  60. BuildRequires: pkgconfig(tss2-esys) pkgconfig(tss2-tctildr) pkgconfig(tss2-mu)
  61. # https://bugzilla.redhat.com/show_bug.cgi?id=1638961
  62. BuildRequires: libgcrypt-devel
  63. %if 0%{?fedora} > 32
  64. # Older versions of tss2-esys don't have the swtpm TCTI
  65. BuildRequires: swtpm swtpm-tools
  66. %endif
  67. %endif
  68. %description
  69. This package provides a multiprotocol VPN client for Cisco AnyConnect,
  70. Juniper SSL VPN / Pulse Connect Secure, and Palo Alto Networks GlobalProtect
  71. SSL VPN.
  72. %package devel
  73. Summary: Development package for OpenConnect VPN authentication tools
  74. Requires: %{name}%{?_isa} = %{version}-%{release}
  75. %description devel
  76. This package provides the core HTTP and authentication support from
  77. the OpenConnect VPN client, to be used by GUI authentication dialogs
  78. for NetworkManager etc.
  79. %include %SOURCE3
  80. %prep
  81. %if 0%{?gitsnapshot}
  82. %setup -q -n %{name}-%{shortcommit}
  83. NOCONFIGURE=x ./autogen.sh
  84. %else
  85. %gpg_verify
  86. %setup -q
  87. if [ ! -x configure ]; then
  88. NOCONFIGURE=x ./autogen.sh
  89. fi
  90. %endif
  91. %build
  92. %configure --with-vpnc-script=/etc/vpnc/vpnc-script \
  93. --disable-dsa-tests \
  94. %if %{use_gnutls}
  95. %if 0%{?fedora} || 0%{?rhel} > 7
  96. --with-default-gnutls-priority="@OPENCONNECT,SYSTEM" \
  97. --without-gnutls-version-check \
  98. %endif
  99. %else
  100. --with-openssl --without-openssl-version-check \
  101. %endif
  102. --htmldir=%{_pkgdocdir}
  103. make %{?_smp_mflags} V=1
  104. %install
  105. %make_install
  106. mkdir -p $RPM_BUILD_ROOT/%{_pkgdocdir}
  107. rm -f $RPM_BUILD_ROOT/%{_libdir}/libopenconnect.la
  108. rm -f $RPM_BUILD_ROOT/%{_libexecdir}/openconnect/tncc-wrapper.py
  109. rm -f $RPM_BUILD_ROOT/%{_libexecdir}/openconnect/hipreport-android.sh
  110. %find_lang %{name}
  111. %check
  112. %if 0%{?fedora} || 0%{?rhel} > 7
  113. # Clear RDRAND capability bit to work around
  114. # https://bugzilla.redhat.com/show_bug.cgi?id=1831086
  115. make VERBOSE=1 OPENSSL_ia32cap=~0x4000000000000000 XFAIL_TESTS="obsolete-server-crypto" check
  116. %else
  117. # Test setup for OpenSSL builds in RHEL6.
  118. make VERBOSE=1 XFAIL_TESTS="auth-nonascii bad_dtls_test" check
  119. %endif
  120. %ldconfig_scriptlets
  121. %files -f %{name}.lang
  122. %{_libdir}/libopenconnect.so.5*
  123. %{_sbindir}/openconnect
  124. %{_libexecdir}/openconnect/
  125. %{_mandir}/man8/*
  126. %{_datadir}/bash-completion/completions/openconnect
  127. %doc TODO COPYING.LGPL
  128. %doc %{_pkgdocdir}
  129. %files devel
  130. %{_libdir}/libopenconnect.so
  131. %{_includedir}/openconnect.h
  132. %{_libdir}/pkgconfig/openconnect.pc
  133. %changelog
  134. * Tue Jul 16 2019 David Woodhouse <dwmw2@infradead.org> - %{version}-%{release}
  135. - Autopackaging for COPR