Remove 1.5 compat library hack

f38
David Woodhouse 11 years ago
parent 53dde6b7de
commit f2707c622b

@ -1,8 +1,4 @@
# For Fedora 17 and below, for now, build a compat libopenconnect.so.1 with OpenSSL so # RHEL6 still has ancient GnuTLS
# that the upgrade path is easier.
%define build_compat_lib 0%{?fedora} && 0%{?fedora} < 18
# RHEL6 still has GnuTLS which is even more ancient than Fedora's!
%define use_gnutls 0%{?fedora} || 0%{?rhel} >= 7 %define use_gnutls 0%{?fedora} || 0%{?rhel} >= 7
# RHEL5 has no libproxy, and no %make_install macro # RHEL5 has no libproxy, and no %make_install macro
@ -24,16 +20,12 @@ Group: Applications/Internet
License: LGPLv2+ License: LGPLv2+
URL: http://www.infradead.org/openconnect.html URL: http://www.infradead.org/openconnect.html
Source0: ftp://ftp.infradead.org/pub/openconnect/openconnect-%{version}.tar.gz Source0: ftp://ftp.infradead.org/pub/openconnect/openconnect-%{version}.tar.gz
Source1: library15.c
Source2: libopenconnect15.map
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: pkgconfig(openssl) pkgconfig(libxml-2.0) BuildRequires: pkgconfig(openssl) pkgconfig(libxml-2.0)
BuildRequires: autoconf automake libtool python gettext BuildRequires: autoconf automake libtool python gettext
%if 0%{?fedora} %if 0%{?fedora}
%if !(%{build_compat_lib})
Obsoletes: openconnect-lib-compat%{?_isa} < %{version}-%{release} Obsoletes: openconnect-lib-compat%{?_isa} < %{version}-%{release}
%endif
Requires: vpnc-script Requires: vpnc-script
%else %else
Requires: vpnc Requires: vpnc
@ -67,48 +59,10 @@ This package provides the core HTTP and authentication support from
the OpenConnect VPN client, to be used by GUI authentication dialogs the OpenConnect VPN client, to be used by GUI authentication dialogs
for NetworkManager etc. for NetworkManager etc.
%package lib-compat
Summary: Compatibility library for OpenConnect authentication clients
Group: Applications/Internet
Requires: %{name}%{?_isa} = %{version}-%{release}
%description lib-compat
This package provides a backward-compatible library for use by GNOME and KDE
NetworkManager clients which have not yet been rebuilt to use the new version
of the library.
%prep %prep
%setup -q %setup -q
%if %{build_compat_lib}
cp %{SOURCE1} .
cp %{SOURCE2} libopenconnect15.map.in
# In Fedora 16 we fixed the gnutls_record_get_direction() bug without upgrading
sed 's/2\.12\.16/2.12.14/' -i configure
touch version.c
%endif
%build %build
%if %{build_compat_lib}
mkdir compat
cd compat
%global _configure ../configure
%configure --with-vpnc-script=/etc/vpnc/vpnc-script --htmldir=%{_docdir}/%{name}-%{version} --without-gnutls --without-openssl-version-check
# Hack: Build with library15.c instead of library.c and use the old version
# script and soname.
sed -e 's/library\./library15./g' \
-e 's/libopenconnect.map/libopenconnect15.map/g' \
-e 's/\$(LT_VER_ARG) 2:./-version-number 1:5/g' \
Makefile > Makefile.lib15
# We configure with --disable-dependency-tracking so we do not need this:
# cp .deps/libopenconnect_la-library.Plo .deps/libopenconnect_la-library2.Plo
# Do not let it rebuild the symbol map that we provided
cp %{SOURCE2} .
make -f Makefile.lib15 libopenconnect.la V=1
cd ..
%global _configure ./configure
%endif # {build_compat_lib}
%configure --with-vpnc-script=/etc/vpnc/vpnc-script \ %configure --with-vpnc-script=/etc/vpnc/vpnc-script \
%if !%{use_gnutls} %if !%{use_gnutls}
--with-openssl --without-openssl-version-check \ --with-openssl --without-openssl-version-check \
@ -119,11 +73,6 @@ make %{?_smp_mflags} V=1
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%if %{build_compat_lib}
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
install -m0755 compat/.libs/libopenconnect.so.1.5.0 ${RPM_BUILD_ROOT}/%{_libdir}
ln -sf libopenconnect.so.1.5.0 ${RPM_BUILD_ROOT}/%{_libdir}/libopenconnect.so.1
%endif
%make_install %make_install
rm -f $RPM_BUILD_ROOT/%{_libdir}/libopenconnect.la rm -f $RPM_BUILD_ROOT/%{_libdir}/libopenconnect.la
%find_lang %{name} %find_lang %{name}
@ -142,11 +91,6 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/* %{_mandir}/man8/*
%doc TODO COPYING.LGPL %doc TODO COPYING.LGPL
%if %{build_compat_lib}
%files lib-compat
%{_libdir}/libopenconnect.so.1*
%endif
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_libdir}/libopenconnect.so %{_libdir}/libopenconnect.so

Loading…
Cancel
Save