默认不应用nss与gnutls打包补丁,打包过程中再应用

This commit is contained in:
谢炜 2023-10-19 12:07:33 +08:00
parent b3e836a3d7
commit a68d38f682
3 changed files with 310 additions and 6 deletions

161
debian/extra-patches/90_gnutls.patch vendored Normal file
View File

@ -0,0 +1,161 @@
From: Ramakrishnan Muthukrishnan <vu3rdd@gmail.com>
Date: Fri, 13 May 2022 20:09:08 +0800
Subject: Build with GnuTLS.
Origin: vendor
Forwarded: not-needed
Reviewed-by: Alessandro Ghedini <ghedo@debian.org>
Last-Update: 2018-05-23
---
docs/examples/Makefile.am | 4 ++--
lib/Makefile.am | 32 ++++++++++++++++----------------
lib/libcurl.vers.in | 2 +-
src/Makefile.am | 4 ++--
tests/libtest/Makefile.am | 8 ++++----
5 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/docs/examples/Makefile.am b/docs/examples/Makefile.am
index 53867cb..eae9e3b 100644
--- a/docs/examples/Makefile.am
+++ b/docs/examples/Makefile.am
@@ -48,9 +48,9 @@ LIBS = $(BLANK_AT_MAKETIME)
# Dependencies
if USE_EXPLICIT_LIB_DEPS
-LDADD = $(LIBDIR)/libcurl.la @LIBCURL_LIBS@
+LDADD = $(LIBDIR)/libcurl-gnutls.la @LIBCURL_LIBS@
else
-LDADD = $(LIBDIR)/libcurl.la
+LDADD = $(LIBDIR)/libcurl-gnutls.la
endif
# This might hold -Werror
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 516a239..6c66aaa 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -31,7 +31,7 @@ EXTRA_DIST = Makefile.m32 config-win32.h config-win32ce.h \
config-tpf.h mk-ca-bundle.pl mk-ca-bundle.vbs $(CMAKE_DIST) \
firefox-db2pem.sh config-vxworks.h Makefile.vxworks checksrc.pl
-lib_LTLIBRARIES = libcurl.la
+lib_LTLIBRARIES = libcurl-gnutls.la
if BUILD_UNITTESTS
noinst_LTLIBRARIES = libcurlu.la
@@ -83,43 +83,43 @@ AM_CPPFLAGS += -DBUILDING_LIBCURL
AM_LDFLAGS =
AM_CFLAGS =
-libcurl_la_CPPFLAGS_EXTRA =
-libcurl_la_LDFLAGS_EXTRA =
-libcurl_la_CFLAGS_EXTRA =
+libcurl_gnutls_la_CPPFLAGS_EXTRA =
+libcurl_gnutls_la_LDFLAGS_EXTRA =
+libcurl_gnutls_la_CFLAGS_EXTRA =
if CURL_LT_SHLIB_USE_VERSION_INFO
-libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO)
+libcurl_gnutls_la_LDFLAGS_EXTRA += $(VERSIONINFO)
endif
if CURL_LT_SHLIB_USE_NO_UNDEFINED
-libcurl_la_LDFLAGS_EXTRA += -no-undefined
+libcurl_gnutls_la_LDFLAGS_EXTRA += -no-undefined
endif
if CURL_LT_SHLIB_USE_MIMPURE_TEXT
-libcurl_la_LDFLAGS_EXTRA += -mimpure-text
+libcurl_gnutls_la_LDFLAGS_EXTRA += -mimpure-text
endif
if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS
-libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
+libcurl_gnutls_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
else
# if symbol-hiding is enabled, hide them!
if DOING_CURL_SYMBOL_HIDING
-libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
+libcurl_gnutls_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
endif
endif
if USE_CPPFLAG_CURL_STATICLIB
-libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
+libcurl_gnutls_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
endif
if DOING_CURL_SYMBOL_HIDING
-libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS
-libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING)
+libcurl_gnutls_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS
+libcurl_gnutls_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING)
endif
-libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA)
-libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS)
-libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA)
+libcurl_gnutls_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_gnutls_la_CPPFLAGS_EXTRA)
+libcurl_gnutls_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_gnutls_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS)
+libcurl_gnutls_la_CFLAGS = $(AM_CFLAGS) $(libcurl_gnutls_la_CFLAGS_EXTRA)
libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS)
@@ -128,7 +128,7 @@ libcurlu_la_CFLAGS = $(AM_CFLAGS)
# Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc
-libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
+libcurl_gnutls_la_SOURCES = $(CSOURCES) $(HHEADERS)
libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS)
CHECKSRC = $(CS_$(V))
diff --git a/lib/libcurl.vers.in b/lib/libcurl.vers.in
index ae978a4..bce5633 100644
--- a/lib/libcurl.vers.in
+++ b/lib/libcurl.vers.in
@@ -6,7 +6,7 @@ HIDDEN
_save*;
};
-CURL_@CURL_LT_SHLIB_VERSIONED_FLAVOUR@4
+CURL_@CURL_LT_SHLIB_VERSIONED_FLAVOUR@3
{
global: curl_*;
local: *;
diff --git a/src/Makefile.am b/src/Makefile.am
index 90f1562..4d0ed3c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,9 +61,9 @@ CFLAGS += @CURL_CFLAG_EXTRAS@
LIBS = $(BLANK_AT_MAKETIME)
if USE_EXPLICIT_LIB_DEPS
-curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @LIBCURL_LIBS@
+curl_LDADD = $(top_builddir)/lib/libcurl-gnutls.la @LIBMETALINK_LIBS@ @LIBCURL_LIBS@
else
-curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
+curl_LDADD = $(top_builddir)/lib/libcurl-gnutls.la @LIBMETALINK_LIBS@ @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
endif
curl_LDFLAGS = @LIBMETALINK_LDFLAGS@
diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am
index ca7c01c..3a4027a 100644
--- a/tests/libtest/Makefile.am
+++ b/tests/libtest/Makefile.am
@@ -57,11 +57,11 @@ CLEANFILES = lib1521.c
LIBS = $(BLANK_AT_MAKETIME)
if USE_EXPLICIT_LIB_DEPS
-SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@
-TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@
+SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl-gnutls.la @LIBCURL_LIBS@
+TESTUTIL_LIBS = $(top_builddir)/lib/libcurl-gnutls.la @LIBCURL_LIBS@
else
-SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_LIBS@ @NSS_LIBS@
-TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @CURL_NETWORK_AND_TIME_LIBS@ @NSS_LIBS@
+SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl-gnutls.la @CURL_NETWORK_LIBS@ @NSS_LIBS@
+TESTUTIL_LIBS = $(top_builddir)/lib/libcurl-gnutls.la @CURL_NETWORK_AND_TIME_LIBS@ @NSS_LIBS@
endif
# Dependencies (may need to be overridden)

147
debian/extra-patches/99_nss.patch vendored Normal file
View File

@ -0,0 +1,147 @@
From: Ramakrishnan Muthukrishnan <vu3rdd@gmail.com>
Date: Fri, 13 May 2022 20:09:08 +0800
Subject: Build with NSS.
Origin: vendor
Forwarded: not-needed
Reviewed-by: Alessandro Ghedini <ghedo@debian.org>
Last-Update: 2015-08-12
---
docs/examples/Makefile.am | 4 ++--
lib/Makefile.am | 32 ++++++++++++++++----------------
src/Makefile.am | 4 ++--
tests/libtest/Makefile.am | 8 ++++----
4 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/docs/examples/Makefile.am b/docs/examples/Makefile.am
index eae9e3b..254e72d 100644
--- a/docs/examples/Makefile.am
+++ b/docs/examples/Makefile.am
@@ -48,9 +48,9 @@ LIBS = $(BLANK_AT_MAKETIME)
# Dependencies
if USE_EXPLICIT_LIB_DEPS
-LDADD = $(LIBDIR)/libcurl-gnutls.la @LIBCURL_LIBS@
+LDADD = $(LIBDIR)/libcurl-nss.la @LIBCURL_LIBS@
else
-LDADD = $(LIBDIR)/libcurl-gnutls.la
+LDADD = $(LIBDIR)/libcurl-nss.la
endif
# This might hold -Werror
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6c66aaa..34940bf 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -31,7 +31,7 @@ EXTRA_DIST = Makefile.m32 config-win32.h config-win32ce.h \
config-tpf.h mk-ca-bundle.pl mk-ca-bundle.vbs $(CMAKE_DIST) \
firefox-db2pem.sh config-vxworks.h Makefile.vxworks checksrc.pl
-lib_LTLIBRARIES = libcurl-gnutls.la
+lib_LTLIBRARIES = libcurl-nss.la
if BUILD_UNITTESTS
noinst_LTLIBRARIES = libcurlu.la
@@ -83,43 +83,43 @@ AM_CPPFLAGS += -DBUILDING_LIBCURL
AM_LDFLAGS =
AM_CFLAGS =
-libcurl_gnutls_la_CPPFLAGS_EXTRA =
-libcurl_gnutls_la_LDFLAGS_EXTRA =
-libcurl_gnutls_la_CFLAGS_EXTRA =
+libcurl_nss_la_CPPFLAGS_EXTRA =
+libcurl_nss_la_LDFLAGS_EXTRA =
+libcurl_nss_la_CFLAGS_EXTRA =
if CURL_LT_SHLIB_USE_VERSION_INFO
-libcurl_gnutls_la_LDFLAGS_EXTRA += $(VERSIONINFO)
+libcurl_nss_la_LDFLAGS_EXTRA += $(VERSIONINFO)
endif
if CURL_LT_SHLIB_USE_NO_UNDEFINED
-libcurl_gnutls_la_LDFLAGS_EXTRA += -no-undefined
+libcurl_nss_la_LDFLAGS_EXTRA += -no-undefined
endif
if CURL_LT_SHLIB_USE_MIMPURE_TEXT
-libcurl_gnutls_la_LDFLAGS_EXTRA += -mimpure-text
+libcurl_nss_la_LDFLAGS_EXTRA += -mimpure-text
endif
if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS
-libcurl_gnutls_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
+libcurl_nss_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
else
# if symbol-hiding is enabled, hide them!
if DOING_CURL_SYMBOL_HIDING
-libcurl_gnutls_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
+libcurl_nss_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
endif
endif
if USE_CPPFLAG_CURL_STATICLIB
-libcurl_gnutls_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
+libcurl_nss_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
endif
if DOING_CURL_SYMBOL_HIDING
-libcurl_gnutls_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS
-libcurl_gnutls_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING)
+libcurl_nss_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS
+libcurl_nss_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING)
endif
-libcurl_gnutls_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_gnutls_la_CPPFLAGS_EXTRA)
-libcurl_gnutls_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_gnutls_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS)
-libcurl_gnutls_la_CFLAGS = $(AM_CFLAGS) $(libcurl_gnutls_la_CFLAGS_EXTRA)
+libcurl_nss_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_nss_la_CPPFLAGS_EXTRA)
+libcurl_nss_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_nss_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS)
+libcurl_nss_la_CFLAGS = $(AM_CFLAGS) $(libcurl_nss_la_CFLAGS_EXTRA)
libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS)
@@ -128,7 +128,7 @@ libcurlu_la_CFLAGS = $(AM_CFLAGS)
# Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc
-libcurl_gnutls_la_SOURCES = $(CSOURCES) $(HHEADERS)
+libcurl_nss_la_SOURCES = $(CSOURCES) $(HHEADERS)
libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS)
CHECKSRC = $(CS_$(V))
diff --git a/src/Makefile.am b/src/Makefile.am
index 4d0ed3c..fe14b72 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,9 +61,9 @@ CFLAGS += @CURL_CFLAG_EXTRAS@
LIBS = $(BLANK_AT_MAKETIME)
if USE_EXPLICIT_LIB_DEPS
-curl_LDADD = $(top_builddir)/lib/libcurl-gnutls.la @LIBMETALINK_LIBS@ @LIBCURL_LIBS@
+curl_LDADD = $(top_builddir)/lib/libcurl-nss.la @LIBMETALINK_LIBS@ @LIBCURL_LIBS@
else
-curl_LDADD = $(top_builddir)/lib/libcurl-gnutls.la @LIBMETALINK_LIBS@ @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
+curl_LDADD = $(top_builddir)/lib/libcurl-nss.la @LIBMETALINK_LIBS@ @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
endif
curl_LDFLAGS = @LIBMETALINK_LDFLAGS@
diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am
index 3a4027a..f56c2c1 100644
--- a/tests/libtest/Makefile.am
+++ b/tests/libtest/Makefile.am
@@ -57,11 +57,11 @@ CLEANFILES = lib1521.c
LIBS = $(BLANK_AT_MAKETIME)
if USE_EXPLICIT_LIB_DEPS
-SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl-gnutls.la @LIBCURL_LIBS@
-TESTUTIL_LIBS = $(top_builddir)/lib/libcurl-gnutls.la @LIBCURL_LIBS@
+SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl-nss.la @LIBCURL_LIBS@
+TESTUTIL_LIBS = $(top_builddir)/lib/libcurl-nss.la @LIBCURL_LIBS@
else
-SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl-gnutls.la @CURL_NETWORK_LIBS@ @NSS_LIBS@
-TESTUTIL_LIBS = $(top_builddir)/lib/libcurl-gnutls.la @CURL_NETWORK_AND_TIME_LIBS@ @NSS_LIBS@
+SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl-nss.la @CURL_NETWORK_LIBS@ @NSS_LIBS@
+TESTUTIL_LIBS = $(top_builddir)/lib/libcurl-nss.la @CURL_NETWORK_AND_TIME_LIBS@ @NSS_LIBS@
endif
# Dependencies (may need to be overridden)

8
debian/rules vendored
View File

@ -29,20 +29,16 @@ endif
override_dh_auto_configure:
mkdir -p debian/build debian/build-gnutls debian/build-nss
# pop the last patch (nss)
quilt pop
# pop the second last patch (gnutls)
quilt pop
# get the source without nss and gnutls patches
tar -cf - --exclude=debian/build* --exclude=.pc . \
| tar -xf - -C debian/build
# push the second last patch which must be gnutls
quilt push
patch -p1 < debian/extra-patches/90_gnutls.patch
# get the source with gnutls patch applied
tar -cf - --exclude=debian/build* --exclude=.pc . \
| tar -xf - -C debian/build-gnutls
# push the last patch which must be nss
quilt push
patch -p1 < debian/extra-patches/99_nss.patch
# get the source with nss patch applied
tar -cf - --exclude=debian/build* --exclude=.pc . \
| tar -xf - -C debian/build-nss