From dce2040786c63aa0bb53c0736b852f6bc8dc42b6 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 12 May 2020 15:39:43 -0300 Subject: [PATCH] Merging changes from UbuntuVM and WindowsVM --- src/ssl/negotiate.c | 20 ++++++++++++++++---- win/x86_32/mingw32-lib3270.spec | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------- win/x86_64/mingw64-lib3270.spec | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------- 3 files changed, 125 insertions(+), 112 deletions(-) diff --git a/src/ssl/negotiate.c b/src/ssl/negotiate.c index ba5ae44..d50ef8d 100644 --- a/src/ssl/negotiate.c +++ b/src/ssl/negotiate.c @@ -201,8 +201,14 @@ static int background_ssl_negotiation(H3270 *hSession, void *message) if( (protocol = get_protocol_from_id(hSession->ssl.protocol.min_version)) != NULL ) { #if (OPENSSL_VERSION_NUMBER >= 0x1010009fL) - trace_ssl(hSession,"Minimum protocol version set to %s\n",protocol->description); - SSL_set_min_proto_version(hSession->ssl.con,protocol->id); + if(SSL_set_min_proto_version(hSession->ssl.con,protocol->id) == 1) + { + trace_ssl(hSession,"Minimum protocol version set to %s\n",protocol->description); + } + else + { + lib3270_write_log(hSession,"ssl","Can't set minimum protocol version to %s",protocol->description); + } #else trace_ssl(hSession,"Can't set minimum protocol version to %s\n",protocol->description); #endif // OPENSSL_VERSION_NUMBER @@ -211,8 +217,14 @@ static int background_ssl_negotiation(H3270 *hSession, void *message) if( (protocol = get_protocol_from_id(hSession->ssl.protocol.max_version)) != NULL ) { #if (OPENSSL_VERSION_NUMBER >= 0x1010009fL) - trace_ssl(hSession,"Maximum protocol version set to %s\n",protocol->description); - SSL_set_max_proto_version(hSession->ssl.con,protocol->id); + if(SSL_set_max_proto_version(hSession->ssl.con,protocol->id) == 1) + { + trace_ssl(hSession,"Maximum protocol version set to %s\n",protocol->description); + } + else + { + lib3270_write_log(hSession,"ssl","Can't set maximum protocol version to %s",protocol->description); + } #else trace_ssl(hSession,"Can't set maximum protocol version to %s\n",protocol->description); #endif // OPENSSL_VERSION_NUMBER diff --git a/win/x86_32/mingw32-lib3270.spec b/win/x86_32/mingw32-lib3270.spec index 37b6e1a..444c63d 100644 --- a/win/x86_32/mingw32-lib3270.spec +++ b/win/x86_32/mingw32-lib3270.spec @@ -1,7 +1,7 @@ # -# spec file for package mingw32-lib3270 +# spec file for package mingw32-%{_libname} # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (C) <2008> # # All modifications and additions to the file contributed by third parties @@ -16,6 +16,9 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +%define _libname lib3270 +%define _product pw3270 + %define __strip %{_mingw32_strip} %define __objdump %{_mingw32_objdump} %define _use_internal_dependency_generator 0 @@ -23,32 +26,27 @@ %define __find_provides %{_mingw32_findprovides} %define __os_install_post %{_mingw32_debug_install_post} \ %{_mingw32_install_post} + +#---[ Package header ]------------------------------------------------------------------------------------------------ -#---[ Main package ]-------------------------------------------------------------------------------------------------- - -Summary: TN3270 Access library -Name: mingw32-lib3270 +Summary: TN3270 access library for 32 bits Windows +Name: mingw32-%{_libname} Version: 5.2 - -%define MAJOR_VERSION %(echo %{version} | cut -d. -f1) -%define MINOR_VERSION %(echo %{version} | cut -d. -f2) -%define _libvrs %{MAJOR_VERSION}_%{MINOR_VERSION} - Release: 0 -License: GPL-2.0 +License: LGPL-3.0 Source: lib3270-%{version}.tar.xz -Url: https://portal.softwarepublico.gov.br/social/pw3270/ +URL: https://github.com/PerryWerneck/lib3270 -Group: Development/Libraries/C and C++ +Group: System/Libraries BuildRoot: /var/tmp/%{name}-%{version} -Provides: mingw32(lib:3270) = %{version} - -BuildRequires: autoconf +BuildRequires: autoconf >= 2.61 BuildRequires: automake -BuildRequires: gettext-tools +BuildRequires: gettext-devel +BuildRequires: xz +BuildRequires: fdupes BuildRequires: mingw32-cross-binutils BuildRequires: mingw32-cross-gcc @@ -61,77 +59,82 @@ BuildRequires: mingw32(lib:iconv) BuildRequires: mingw32(lib:intl) %description +TN3270 access library, originally designed as part of the %{_product} application. -TN3270 access library originally designed as part of the pw3270 application. +For more details, see https://softwarepublico.gov.br/social/pw3270/ . -See more details at https://softwarepublico.gov.br/social/pw3270/ +#---[ Library ]------------------------------------------------------------------------------------------------------- -#---[ Development ]--------------------------------------------------------------------------------------------------- +%define MAJOR_VERSION %(echo %{version} | cut -d. -f1) +%define MINOR_VERSION %(echo %{version} | cut -d. -f2) +%define _libvrs %{MAJOR_VERSION}_%{MINOR_VERSION} -%package devel +%package -n %{name}-%{_libvrs} +Summary: TN3270 Access library +Group: Development/Libraries/C and C++ -Summary: TN3270 Access library development files -Group: Development/Libraries/C and C++ -Requires: %{name} = %{version} +%description -n %{name}-%{_libvrs} +TN3270 access library, originally designed as part of the %{_product} application. -%description devel +For more details, see https://softwarepublico.gov.br/social/pw3270/ . -TN3270 access library for C development files. +%package devel -Originally designed as part of the pw3270 application. +Summary: TN3270 Access library development files +Group: Development/Libraries/C and C++ +Requires: %{name}-%{_libvrs} = %{version} -See more details at https://softwarepublico.gov.br/social/pw3270/ +%description devel +Header files for the TN3270 access library. #---[ Build & Install ]----------------------------------------------------------------------------------------------- %prep %setup -n lib3270-%{version} -NOCONFIGURE=1 ./autogen.sh +NOCONFIGURE=1 \ + ./autogen.sh %{_mingw32_configure} %build -make clean -make all +make all %{?_smp_mflags} %{_mingw32_strip} \ --strip-all \ .bin/Release/*.dll + %install %{_mingw32_makeinstall} +%_mingw32_find_lang %{_libname} langfiles +%fdupes %{buildroot} -%clean -rm -rf %{buildroot} - -#---[ Files ]--------------------------------------------------------------------------------------------------------- - -%files +%files -n %{name}-%{_libvrs} -f langfiles %defattr(-,root,root) -%doc AUTHORS LICENSE README.md -%{_mingw32_libdir}/lib3270.dll -%{_mingw32_libdir}/lib3270.dll.%{MAJOR_VERSION} -%{_mingw32_libdir}/lib3270.dll.%{MAJOR_VERSION}.%{MINOR_VERSION} +%doc AUTHORS README.md +%license LICENSE -%dir %{_mingw32_datadir}/pw3270 +%dir %{_mingw32_datadir}/%{_product} + +%{_mingw32_bindir}/*.dll %files devel %defattr(-,root,root) -%{_mingw32_includedir}/lib3270 +%{_mingw32_libdir}/*.a %{_mingw32_includedir}/*.h +%{_mingw32_includedir}/lib3270 + %{_mingw32_libdir}/pkgconfig/*.pc -%{_mingw32_libdir}/*.a -%{_mingw32_libdir}/*.lib -%dir %{_mingw32_datadir}/pw3270/def -%{_mingw32_datadir}/pw3270/def/*.def +%dir %{_mingw32_datadir}/%{_product}/def +%{_mingw32_datadir}/%{_product}/def/*.def +%{_mingw32_datadir}/%{_product}/def/*.mak -%dir %{_mingw32_datadir}/pw3270/pot -%{_mingw32_datadir}/pw3270/pot/*.pot +%dir %{_mingw32_datadir}/%{_product}/pot +%{_mingw32_datadir}/%{_product}/pot/*.pot %changelog - diff --git a/win/x86_64/mingw64-lib3270.spec b/win/x86_64/mingw64-lib3270.spec index 8a0fe4a..d71766a 100644 --- a/win/x86_64/mingw64-lib3270.spec +++ b/win/x86_64/mingw64-lib3270.spec @@ -1,7 +1,7 @@ # -# spec file for package mingw64-lib3279 +# spec file for package mingw64-%{_libname} # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (C) <2008> # # All modifications and additions to the file contributed by third parties @@ -16,6 +16,9 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +%define _libname lib3270 +%define _product pw3270 + %define __strip %{_mingw64_strip} %define __objdump %{_mingw64_objdump} %define _use_internal_dependency_generator 0 @@ -23,34 +26,27 @@ %define __find_provides %{_mingw64_findprovides} %define __os_install_post %{_mingw64_debug_install_post} \ %{_mingw64_install_post} + +#---[ Package header ]------------------------------------------------------------------------------------------------ -#---[ Main package ]-------------------------------------------------------------------------------------------------- - -Summary: TN3270 Access library -Name: mingw64-lib3270 +Summary: TN3270 access library for 64 bits Windows +Name: mingw64-%{_libname} Version: 5.2 - -%define MAJOR_VERSION %(echo %{version} | cut -d. -f1) -%define MINOR_VERSION %(echo %{version} | cut -d. -f2) -%define _libvrs %{MAJOR_VERSION}_%{MINOR_VERSION} - - Release: 0 -License: GPL-2.0 +License: LGPL-3.0 Source: lib3270-%{version}.tar.xz -Url: https://portal.softwarepublico.gov.br/social/pw3270/ +URL: https://github.com/PerryWerneck/lib3270 -Group: Development/Libraries/C and C++ +Group: System/Libraries BuildRoot: /var/tmp/%{name}-%{version} -Provides: mingw64(lib:3270) = %{version} -Provides: mingw64(lib:3270-%{_libvrs}) = %{version} - -BuildRequires: autoconf +BuildRequires: autoconf >= 2.61 BuildRequires: automake -BuildRequires: gettext-tools +BuildRequires: gettext-devel +BuildRequires: xz +BuildRequires: fdupes BuildRequires: mingw64-cross-binutils BuildRequires: mingw64-cross-gcc @@ -63,80 +59,82 @@ BuildRequires: mingw64(lib:iconv) BuildRequires: mingw64(lib:intl) %description +TN3270 access library, originally designed as part of the %{_product} application. -TN3270 access library originally designed as part of the pw3270 application. - -See more details at https://softwarepublico.gov.br/social/pw3270/ +For more details, see https://softwarepublico.gov.br/social/pw3270/ . -#---[ Development ]--------------------------------------------------------------------------------------------------- +#---[ Library ]------------------------------------------------------------------------------------------------------- -%package devel +%define MAJOR_VERSION %(echo %{version} | cut -d. -f1) +%define MINOR_VERSION %(echo %{version} | cut -d. -f2) +%define _libvrs %{MAJOR_VERSION}_%{MINOR_VERSION} -Summary: TN3270 Access library development files -Group: Development/Libraries/C and C++ -Requires: %{name} = %{version} +%package -n %{name}-%{_libvrs} +Summary: TN3270 Access library +Group: Development/Libraries/C and C++ -Provides: mingw64-lib3270-devel = %{version} -Conflicts: otherproviders(mingw64-lib3270-devel) +%description -n %{name}-%{_libvrs} +TN3270 access library, originally designed as part of the %{_product} application. -%description devel +For more details, see https://softwarepublico.gov.br/social/pw3270/ . -TN3270 access library for C development files. +%package devel -Originally designed as part of the pw3270 application. +Summary: TN3270 Access library development files +Group: Development/Libraries/C and C++ +Requires: %{name}-%{_libvrs} = %{version} -See more details at https://softwarepublico.gov.br/social/pw3270/ +%description devel +Header files for the TN3270 access library. #---[ Build & Install ]----------------------------------------------------------------------------------------------- %prep %setup -n lib3270-%{version} -NOCONFIGURE=1 ./autogen.sh +NOCONFIGURE=1 \ + ./autogen.sh -%{_mingw64_configure} \ - --with-sdk-version=%{version} +%{_mingw64_configure} %build -make clean -make all +make all %{?_smp_mflags} %{_mingw64_strip} \ --strip-all \ .bin/Release/*.dll + %install %{_mingw64_makeinstall} +%_mingw64_find_lang %{_libname} langfiles +%fdupes %{buildroot} -%clean -rm -rf %{buildroot} - -#---[ Files ]--------------------------------------------------------------------------------------------------------- - -%files +%files -n %{name}-%{_libvrs} -f langfiles %defattr(-,root,root) -%doc AUTHORS LICENSE README.md -%{_mingw64_libdir}/lib3270.dll -%{_mingw64_libdir}/lib3270.dll.%{MAJOR_VERSION} -%{_mingw64_libdir}/lib3270.dll.%{MAJOR_VERSION}.%{MINOR_VERSION} +%doc AUTHORS README.md +%license LICENSE + +%dir %{_mingw64_datadir}/%{_product} -%dir %{_mingw64_datadir}/pw3270 +%{_mingw64_bindir}/*.dll %files devel %defattr(-,root,root) -%{_mingw64_includedir}/lib3270 +%{_mingw64_libdir}/*.a %{_mingw64_includedir}/*.h +%{_mingw64_includedir}/lib3270 + %{_mingw64_libdir}/pkgconfig/*.pc -%{_mingw64_libdir}/*.a -%{_mingw64_libdir}/*.lib -%dir %{_mingw64_datadir}/pw3270/def -%{_mingw64_datadir}/pw3270/def/*.def +%dir %{_mingw64_datadir}/%{_product}/def +%{_mingw64_datadir}/%{_product}/def/*.def +%{_mingw64_datadir}/%{_product}/def/*.mak -%dir %{_mingw64_datadir}/pw3270/pot -%{_mingw64_datadir}/pw3270/pot/*.pot +%dir %{_mingw64_datadir}/%{_product}/pot +%{_mingw64_datadir}/%{_product}/pot/*.pot %changelog -- libgit2 0.21.2