mingw-openconnect.spec.in 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. %?mingw_package_header
  2. %global gitsnapshot @ISSNAP@
  3. %if 0%{?gitsnapshot}
  4. %global snapcommit @SNAPCOMMIT@
  5. %global snapcount @SNAPCOUNT@
  6. %global shortcommit %(c=%{snapcommit}; echo ${c:0:7})
  7. %global snapver .git.%{snapcount}.%{shortcommit}
  8. %endif
  9. %global tagver @VERSION@
  10. Name: mingw-openconnect
  11. Version: %{tagver}%{?snapver}
  12. Release: 0%{?dist}
  13. Summary: Open client for SSL VPNs including Cisco AnyConnect VPN, Juniper Network Connect/Pulse, PAN GlobalProtect, Fortinet, etc.
  14. License: LGPLv2
  15. URL: https://www.infradead.org/openconnect.html
  16. %if 0%{?gitsnapshot}
  17. Source0: https://github.com/openconnect/%{name}/archive/%{snapcommit}/openconnect-%{shortcommit}.tar.gz
  18. %else
  19. Source0: https://www.infradead.org/openconnect/download/openconnect-%{version}.tar.gz
  20. %endif
  21. Source2: gpgkey-BE07D9FD54809AB2C4B0FF5F63762CDA67E2F359.asc
  22. Source3: macros.gpg
  23. BuildRequires: mingw32-filesystem >= 95
  24. BuildRequires: mingw32-gcc
  25. BuildRequires: mingw32-gcc-c++
  26. BuildRequires: mingw32-gettext
  27. BuildRequires: mingw32-gnutls
  28. BuildRequires: mingw32-p11-kit
  29. BuildRequires: mingw32-libxml2
  30. BuildRequires: mingw32-zlib
  31. BuildRequires: mingw32-lz4
  32. BuildRequires: mingw32-stoken
  33. BuildRequires: wine-core(x86-32)
  34. BuildRequires: mingw64-filesystem >= 95
  35. BuildRequires: mingw64-gcc
  36. BuildRequires: mingw64-gcc-c++
  37. BuildRequires: mingw64-gettext
  38. BuildRequires: mingw64-gnutls
  39. BuildRequires: mingw64-p11-kit
  40. BuildRequires: mingw64-libxml2
  41. BuildRequires: mingw64-zlib
  42. BuildRequires: mingw64-lz4
  43. BuildRequires: mingw64-stoken
  44. BuildRequires: wine-core(x86-64)
  45. BuildRequires: mingw32-nsis
  46. BuildRequires: pkgconfig automake autoconf libtool
  47. BuildRequires: gettext-devel
  48. BuildRequires: jq
  49. %description
  50. The OpenConnect multiprotocol VPN client library, cross-compiled for MinGW.
  51. %?mingw_debug_package
  52. # Win32
  53. %package -n mingw32-openconnect
  54. Summary: OpenConnect VPN client library
  55. Requires: pkgconfig
  56. %description -n mingw32-openconnect
  57. The OpenConnect multiprotocol VPN client library, cross-compiled for MinGW.
  58. %package -n mingw32-openconnect-installer
  59. Summary: OpenConnect VPN client application installer
  60. %description -n mingw32-openconnect-installer
  61. The OpenConnect multiprotocol VPN client installer for 32-bit Windows.
  62. # Win64
  63. %package -n mingw64-openconnect
  64. Summary: OpenConnect VPN client library
  65. Requires: pkgconfig
  66. %description -n mingw64-openconnect
  67. The OpenConnect multiprotocol VPN client library, cross-compiled for MinGW.
  68. %package -n mingw64-openconnect-installer
  69. Summary: OpenConnect VPN client application installer
  70. %description -n mingw64-openconnect-installer
  71. The OpenConnect multiprotocol VPN client installer for 64-bit Windows.
  72. %include %SOURCE3
  73. %prep
  74. %if 0%{?gitsnapshot}
  75. %setup -q -n openconnect-%{shortcommit}
  76. NOCONFIGURE=x ./autogen.sh
  77. %else
  78. %gpg_verify
  79. %setup -q -n openconnect-%{version}
  80. if [ ! -x configure ]; then
  81. NOCONFIGURE=x ./autogen.sh
  82. fi
  83. %endif
  84. %mingw_configure --with-vpnc-script=vpnc-script-win.js \
  85. --without-gnutls-version-check --disable-dsa-tests \
  86. --sbindir='${exec_prefix}/bin'
  87. %mingw_make %{?_smp_mflags} V=1
  88. %install
  89. %mingw_make install DESTDIR=$RPM_BUILD_ROOT
  90. install -m 0644 build_win32/openconnect-installer.exe $RPM_BUILD_ROOT/%{mingw32_bindir}/openconnect-installer-%{version}-%{release}.exe
  91. install -m 0644 build_win64/openconnect-installer.exe $RPM_BUILD_ROOT/%{mingw64_bindir}/openconnect-installer-%{version}-%{release}.exe
  92. rm -f $RPM_BUILD_ROOT/%{mingw32_libdir}/libopenconnect.la
  93. rm -rf $RPM_BUILD_ROOT/%{mingw32_libexecdir}/openconnect
  94. rm -rf $RPM_BUILD_ROOT/%{mingw32_mandir}/man8/openconnect.8*
  95. rm -rf $RPM_BUILD_ROOT/%{mingw32_docdir}/openconnect
  96. rm -rf $RPM_BUILD_ROOT/%{mingw32_datadir}/bash-completion
  97. rm -f $RPM_BUILD_ROOT/%{mingw64_libdir}/libopenconnect.la
  98. rm -rf $RPM_BUILD_ROOT/%{mingw64_libexecdir}/openconnect
  99. rm -rf $RPM_BUILD_ROOT/%{mingw64_mandir}/man8/openconnect.8*
  100. rm -rf $RPM_BUILD_ROOT/%{mingw64_docdir}/openconnect
  101. rm -rf $RPM_BUILD_ROOT/%{mingw64_datadir}/bash-completion
  102. %mingw_find_lang openconnect
  103. # Surely this is supposed to happen automatically... but it doesn't seem to.
  104. %mingw_debug_install_post
  105. #Win32
  106. %files -n mingw32-openconnect -f mingw32-openconnect.lang
  107. %license COPYING.LGPL
  108. %{mingw32_bindir}/libopenconnect*.dll
  109. %{mingw32_bindir}/*.exe
  110. %{mingw32_includedir}/openconnect.h
  111. %{mingw32_libdir}/libopenconnect*.dll.a
  112. %{mingw32_libdir}/pkgconfig/openconnect.pc
  113. %files -n mingw32-openconnect-installer
  114. %{mingw32_bindir}/openconnect-installer-*.exe
  115. #Win64
  116. %files -n mingw64-openconnect -f mingw64-openconnect.lang
  117. %license COPYING.LGPL
  118. %{mingw64_bindir}/libopenconnect*.dll
  119. %{mingw64_bindir}/*.exe
  120. %{mingw64_includedir}/openconnect.h
  121. %{mingw64_libdir}/libopenconnect*.dll.a
  122. %{mingw64_libdir}/pkgconfig/openconnect.pc
  123. %files -n mingw64-openconnect-installer
  124. %{mingw64_bindir}/openconnect-installer-*.exe
  125. %changelog
  126. * Mon Apr 27 2020 David Woodhouse <dwmw2@infradead.org> - %{version}-%{release}
  127. - Autopackaging for COPR