]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Add mingw build in copr
authorDavid Woodhouse <dwmw2@infradead.org>
Mon, 27 Apr 2020 12:20:16 +0000 (13:20 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Mon, 27 Apr 2020 13:30:29 +0000 (14:30 +0100)
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
.copr/Makefile
mingw-openconnect.spec.in [new file with mode: 0644]
mkspec.sh

index 6945da74007c9c9df9215e0baca87e34618531fa..5553d2c1783e8e2d64cc5e8a342f8333efa8aff4 100644 (file)
@@ -3,20 +3,26 @@
 # https://docs.pagure.org/copr.copr/user_documentation.html#make-srpm
 #
 
+ifeq ($(findstring mingw-openconnect,$(spec)),)
+TARGET=openconnect
+else
+TARGET=mingw-openconnect
+endif
+
 srpm: /usr/bin/git
-       ./mkspec.sh
-       set -x; if grep -q "global gitsnapshot 1" openconnect.spec; then \
-               tarprefix=$$(sed -n '/^%global snapcommit /s/.* //p' openconnect.spec); \
+       ./mkspec.sh $(TARGET)
+       set -x; if grep -q "global gitsnapshot 1" $(TARGET).spec; then \
+               tarprefix=$$(sed -n '/^%global snapcommit /s/.* //p' $(TARGET).spec); \
                tarname=$${tarprefix:0:7}; \
        else \
-               tarprefix=$$(sed -n '/^%global tagver /s/.* //p' openconnect.spec); \
+               tarprefix=$$(sed -n '/^%global tagver /s/.* //p' $(TARGET).spec); \
                tarname=$${tarprefix}; \
        fi; \
        git archive --prefix=openconnect-$${tarprefix}/ HEAD -o .copr/openconnect-$${tarname}.tar.gz
-       rpmbuild -bs openconnect.spec --define "_sourcedir .copr" --define "_srcrpmdir $(outdir)"
+       rpmbuild -bs $(TARGET).spec --define "_sourcedir .copr" --define "_srcrpmdir $(outdir)"
 
 /usr/bin/git:
        dnf install git
 
 build: srpm
-       rpmbuild -bb openconnect.spec --define "_sourcedir `pwd`/.copr"
+       rpmbuild -bb $(TARGET).spec --define "_sourcedir `pwd`/.copr"
diff --git a/mingw-openconnect.spec.in b/mingw-openconnect.spec.in
new file mode 100644 (file)
index 0000000..a14fb0d
--- /dev/null
@@ -0,0 +1,132 @@
+%?mingw_package_header
+
+%global gitsnapshot @ISSNAP@
+%if 0%{?gitsnapshot}
+%global snapcommit @SNAPCOMMIT@
+%global snapcount @SNAPCOUNT@
+%global shortcommit %(c=%{snapcommit}; echo ${c:0:7})
+%global snapver .git.%{snapcount}.%{shortcommit}
+%endif
+
+%global tagver @VERSION@
+
+Name:          mingw-openconnect
+Version:       %{tagver}%{?snapver}
+Release:       0%{?dist}
+Summary:       Open client for Cisco AnyConnect VPN, Juniper Network Connect/Pulse, PAN GlobalProtect
+
+License:       LGPLv2
+URL:           http://www.infradead.org/openconnect.html
+%if 0%{?gitsnapshot}
+Source0:        https://github.com/openconnect/%{name}/archive/%{snapcommit}/openconnect-%{shortcommit}.tar.gz
+%else
+Source0:        ftp://ftp.infradead.org/pub/%{name}/openconnect-%{version}.tar.gz
+%endif
+Source2:       gpgkey-BE07D9FD54809AB2C4B0FF5F63762CDA67E2F359.asc
+Source3:       macros.gpg
+
+
+BuildRequires:  mingw32-filesystem >= 95
+BuildRequires:  mingw32-gcc
+BuildRequires:  mingw32-gcc-c++
+BuildRequires:  mingw32-gettext
+BuildRequires:  mingw32-gnutls
+BuildRequires:  mingw32-p11-kit
+BuildRequires:  mingw32-libxml2
+BuildRequires:  mingw32-zlib
+BuildRequires:  wine-core(x86-32)
+
+BuildRequires:  mingw64-filesystem >= 95
+BuildRequires:  mingw64-gcc
+BuildRequires:  mingw64-gcc-c++
+BuildRequires:  mingw64-gettext
+BuildRequires:  mingw64-gnutls
+BuildRequires:  mingw64-p11-kit
+BuildRequires:  mingw64-libxml2
+BuildRequires:  mingw64-zlib
+BuildRequires:  wine-core(x86-64)
+
+
+BuildRequires:  pkgconfig automake autoconf libtool
+BuildRequires:  gettext-devel wine-common
+
+%description
+The OpenConnect multiprotocol VPN client library, cross-compiled for MinGW.
+
+%?mingw_debug_package
+
+# Win32
+%package -n mingw32-openconnect
+Summary:        OpenConnect VPN client library
+Requires:       pkgconfig
+
+%description -n mingw32-openconnect
+The OpenConnect multiprotocol VPN client library, cross-compiled for MinGW.
+
+# Win32
+%package -n mingw64-openconnect
+Summary:        OpenConnect VPN client library
+Requires:       pkgconfig
+
+%description -n mingw64-openconnect
+The OpenConnect multiprotocol VPN client library, cross-compiled for MinGW.
+
+%include %SOURCE3
+
+%prep
+%if 0%{?gitsnapshot}
+%setup -q -n openconnect-%{snapcommit}
+NOCONFIGURE=x ./autogen.sh
+%else
+%gpg_verify
+%setup -q
+if [ ! -x configure ]; then
+    NOCONFIGURE=x ./autogen.sh
+fi
+%endif
+
+%mingw_configure --with-vpnc-script=vpnc-script-win.js \
+       --without-gnutls-version-check --disable-dsa-tests
+%mingw_make %{?_smp_mflags} V=1
+
+
+%install
+%mingw_make install DESTDIR=$RPM_BUILD_ROOT
+
+rm -f $RPM_BUILD_ROOT/%{mingw32_libdir}/libopenconnect.la
+rm -rf $RPM_BUILD_ROOT/%{mingw32_libexecdir}/openconnect
+rm -rf $RPM_BUILD_ROOT/%{mingw32_mandir}/man8/openconnect.8*
+rm -rf $RPM_BUILD_ROOT/%{mingw32_docdir}/openconnect
+rm -rf $RPM_BUILD_ROOT/%{mingw32_sysconfdir}/bash_completion.d
+
+rm -f $RPM_BUILD_ROOT/%{mingw64_libdir}/libopenconnect.la
+rm -rf $RPM_BUILD_ROOT/%{mingw64_libexecdir}/openconnect
+rm -rf $RPM_BUILD_ROOT/%{mingw64_mandir}/man8/openconnect.8*
+rm -rf $RPM_BUILD_ROOT/%{mingw64_docdir}/openconnect
+rm -rf $RPM_BUILD_ROOT/%{mingw64_sysconfdir}/bash_completion.d
+
+%mingw_find_lang openconnect
+# Surely this is supposed to happen automatically... but it doesn't seem to.
+%mingw_debug_install_post
+
+#Win32
+%files -n mingw32-openconnect -f mingw32-openconnect.lang
+%license COPYING.LGPL
+%{mingw32_bindir}/libopenconnect*.dll
+%{mingw32_sbindir}/openconnect.exe
+%{mingw32_includedir}/openconnect.h
+%{mingw32_libdir}/libopenconnect*.dll.a
+%{mingw32_libdir}/pkgconfig/openconnect.pc
+
+#Win64
+%files -n mingw64-openconnect -f mingw64-openconnect.lang
+%license COPYING.LGPL
+%{mingw64_bindir}/libopenconnect*.dll
+%{mingw64_sbindir}/openconnect.exe
+%{mingw64_includedir}/openconnect.h
+%{mingw64_libdir}/libopenconnect*.dll.a
+%{mingw64_libdir}/pkgconfig/openconnect.pc
+
+%changelog
+* Mon Apr 27 2020 David Woodhouse <dwmw2@infradead.org> - %{version}-%{release}
+- Autopackaging for COPR
index 2d0d623bfd51d72aee67a3dc446cac905e287138..9a5ed98751f229671554ff61fe30dc9c9e24481c 100755 (executable)
--- a/mkspec.sh
+++ b/mkspec.sh
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+TARGET="$1"
+
 GITCOMMIT="$(git rev-parse HEAD)"
 GITDESC="$(git describe --tags HEAD)"
 
@@ -18,4 +20,4 @@ sed -e "s/@ISSNAP@/${ISSNAP}/" \
     -e "s/@VERSION@/${GITTAG}/" \
     -e "s/@SNAPCOMMIT@/${GITCOMMIT}/" \
     -e "s/@SNAPCOUNT@/${GITCOUNT}/" \
-    openconnect.spec.in > openconnect.spec
+    ${TARGET}.spec.in > ${TARGET}.spec