summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <copr-devel@lists.fedorahosted.org>2023-03-09 01:59:32 +0000
committerCoprDistGit <copr-devel@lists.fedorahosted.org>2023-03-09 01:59:32 +0000
commite27e4ad841089f38cd46ae27a38ff8eba15b921d (patch)
tree47666fc826858e73da6f4381caf4d094210054f0
parente839a2d03859e52f7fbc6d477000fe5245fc49cf (diff)
automatic import of wgetopeneuler20.03
-rw-r--r--.gitignore2
-rw-r--r--backport-wget-1.21.3-hsts-32bit.patch207
-rw-r--r--sources2
-rw-r--r--wget.spec107
4 files changed, 318 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..578a395 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/backport-wget-1.17-path.patch
+/wget-1.21.3.tar.gz
diff --git a/backport-wget-1.21.3-hsts-32bit.patch b/backport-wget-1.21.3-hsts-32bit.patch
new file mode 100644
index 0000000..0daaac8
--- /dev/null
+++ b/backport-wget-1.21.3-hsts-32bit.patch
@@ -0,0 +1,207 @@
+diff --git a/src/hsts.c b/src/hsts.c
+index 0a014401..72c5e936 100644
+--- a/src/hsts.c
++++ b/src/hsts.c
+@@ -61,8 +61,8 @@ struct hsts_kh {
+ };
+
+ struct hsts_kh_info {
+- time_t created;
+- time_t max_age;
++ int64_t created;
++ int64_t max_age;
+ bool include_subdomains;
+ };
+
+@@ -166,7 +166,7 @@ end:
+ static bool
+ hsts_new_entry_internal (hsts_store_t store,
+ const char *host, int port,
+- time_t created, time_t max_age,
++ int64_t created, int64_t max_age,
+ bool include_subdomains,
+ bool check_validity,
+ bool check_expired,
+@@ -216,21 +216,21 @@ bail:
+ static bool
+ hsts_add_entry (hsts_store_t store,
+ const char *host, int port,
+- time_t max_age, bool include_subdomains)
++ int64_t max_age, bool include_subdomains)
+ {
+- time_t t = time (NULL);
++ int64_t t = (int64_t) time (NULL);
+
+ /* It might happen time() returned -1 */
+- return (t == (time_t)(-1) ?
++ return (t == -1) ?
+ false :
+- hsts_new_entry_internal (store, host, port, t, max_age, include_subdomains, false, true, false));
++ hsts_new_entry_internal (store, host, port, t, max_age, include_subdomains, false, true, false);
+ }
+
+ /* Creates a new entry, unless an identical one already exists. */
+ static bool
+ hsts_new_entry (hsts_store_t store,
+ const char *host, int port,
+- time_t created, time_t max_age,
++ int64_t created, int64_t max_age,
+ bool include_subdomains)
+ {
+ return hsts_new_entry_internal (store, host, port, created, max_age, include_subdomains, true, true, true);
+@@ -245,7 +245,7 @@ hsts_remove_entry (hsts_store_t store, struct hsts_kh *kh)
+ static bool
+ hsts_store_merge (hsts_store_t store,
+ const char *host, int port,
+- time_t created, time_t max_age,
++ int64_t created, int64_t max_age,
+ bool include_subdomains)
+ {
+ enum hsts_kh_match match_type = NO_MATCH;
+@@ -276,11 +276,11 @@ hsts_read_database (hsts_store_t store, FILE *fp, bool merge_with_existing_entri
+ size_t len = 0;
+ int items_read;
+ bool result = false;
+- bool (*func)(hsts_store_t, const char *, int, time_t, time_t, bool);
++ bool (*func)(hsts_store_t, const char *, int, int64_t, int64_t, bool);
+
+ char host[256];
+ int port;
+- time_t created, max_age;
++ int64_t created, max_age;
+ int include_subdomains;
+
+ func = (merge_with_existing_entries ? hsts_store_merge : hsts_new_entry);
+@@ -326,10 +326,9 @@ hsts_store_dump (hsts_store_t store, FILE *fp)
+ struct hsts_kh *kh = (struct hsts_kh *) it.key;
+ struct hsts_kh_info *khi = (struct hsts_kh_info *) it.value;
+
+- if (fprintf (fp, "%s\t%d\t%d\t%lu\t%lu\n",
++ if (fprintf (fp, "%s\t%d\t%d\t%" PRId64 "\t%" PRId64 "\n",
+ kh->host, kh->explicit_port, khi->include_subdomains,
+- (unsigned long) khi->created,
+- (unsigned long) khi->max_age) < 0)
++ khi->created, khi->max_age) < 0)
+ {
+ logprintf (LOG_ALWAYS, "Could not write the HSTS database correctly.\n");
+ break;
+@@ -439,7 +438,7 @@ hsts_match (hsts_store_t store, struct url *u)
+ bool
+ hsts_store_entry (hsts_store_t store,
+ enum url_scheme scheme, const char *host, int port,
+- time_t max_age, bool include_subdomains)
++ int64_t max_age, bool include_subdomains)
+ {
+ bool result = false;
+ enum hsts_kh_match match = NO_MATCH;
+@@ -464,9 +463,9 @@ hsts_store_entry (hsts_store_t store,
+ * 'created' field too. The RFC also states that we have to
+ * update the entry each time we see HSTS header.
+ * See also Section 11.2. */
+- time_t t = time (NULL);
++ int64_t t = (int64_t) time (NULL);
+
+- if (t != (time_t)(-1) && t != entry->created)
++ if (t != -1 && t != entry->created)
+ {
+ entry->created = t;
+ entry->max_age = max_age;
+@@ -792,7 +791,7 @@ test_hsts_read_database (void)
+ hsts_store_t table;
+ char *file = NULL;
+ FILE *fp = NULL;
+- time_t created = time(NULL) - 10;
++ int64_t created = time(NULL) - 10;
+
+ if (opt.homedir)
+ {
+@@ -801,9 +800,9 @@ test_hsts_read_database (void)
+ if (fp)
+ {
+ fputs ("# dummy comment\n", fp);
+- fprintf (fp, "foo.example.com\t0\t1\t%lu\t123\n",(unsigned long) created);
+- fprintf (fp, "bar.example.com\t0\t0\t%lu\t456\n", (unsigned long) created);
+- fprintf (fp, "test.example.com\t8080\t0\t%lu\t789\n", (unsigned long) created);
++ fprintf (fp, "foo.example.com\t0\t1\t%" PRId64 "\t123\n", created);
++ fprintf (fp, "bar.example.com\t0\t0\t%" PRId64 "\t456\n", created);
++ fprintf (fp, "test.example.com\t8080\t0\t%" PRId64 "\t789\n", created);
+ fclose (fp);
+
+ table = hsts_store_open (file);
+diff --git a/src/hsts.h b/src/hsts.h
+index 6ecd5060..be048944 100644
+--- a/src/hsts.h
++++ b/src/hsts.h
+@@ -46,7 +46,7 @@ bool hsts_store_has_changed (hsts_store_t);
+
+ bool hsts_store_entry (hsts_store_t,
+ enum url_scheme, const char *, int,
+- time_t, bool);
++ int64_t, bool);
+ bool hsts_match (hsts_store_t, struct url *);
+
+ #endif /* HAVE_HSTS */
+diff --git a/src/http.c b/src/http.c
+index 2ecc11c9..6ccfc3a0 100644
+--- a/src/http.c
++++ b/src/http.c
+@@ -1300,7 +1300,7 @@ parse_content_disposition (const char *hdr, char **filename)
+
+ #ifdef HAVE_HSTS
+ static bool
+-parse_strict_transport_security (const char *header, time_t *max_age, bool *include_subdomains)
++parse_strict_transport_security (const char *header, int64_t *max_age, bool *include_subdomains)
+ {
+ param_token name, value;
+ const char *c_max_age = NULL;
+@@ -1330,7 +1330,7 @@ parse_strict_transport_security (const char *header, time_t *max_age, bool *incl
+ * Also, time_t is normally defined as a long, so this should not break.
+ */
+ if (max_age)
+- *max_age = (time_t) strtol (c_max_age, NULL, 10);
++ *max_age = (int64_t) strtoll (c_max_age, NULL, 10);
+ if (include_subdomains)
+ *include_subdomains = is;
+
+@@ -3184,9 +3184,6 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs,
+ #else
+ extern hsts_store_t hsts_store;
+ #endif
+- const char *hsts_params;
+- time_t max_age;
+- bool include_subdomains;
+ #endif
+
+ int sock = -1;
+@@ -3674,21 +3671,24 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs,
+ #ifdef HAVE_HSTS
+ if (opt.hsts && hsts_store)
+ {
+- hsts_params = resp_header_strdup (resp, "Strict-Transport-Security");
++ int64_t max_age;
++ const char *hsts_params = resp_header_strdup (resp, "Strict-Transport-Security");
++ bool include_subdomains;
++
+ if (parse_strict_transport_security (hsts_params, &max_age, &include_subdomains))
+ {
+ /* process strict transport security */
+ if (hsts_store_entry (hsts_store, u->scheme, u->host, u->port, max_age, include_subdomains))
+- DEBUGP(("Added new HSTS host: %s:%u (max-age: %lu, includeSubdomains: %s)\n",
++ DEBUGP(("Added new HSTS host: %s:%" PRIu32 " (max-age: %" PRId64 ", includeSubdomains: %s)\n",
+ u->host,
+- (unsigned) u->port,
+- (unsigned long) max_age,
++ (uint32_t) u->port,
++ max_age,
+ (include_subdomains ? "true" : "false")));
+ else
+- DEBUGP(("Updated HSTS host: %s:%u (max-age: %lu, includeSubdomains: %s)\n",
++ DEBUGP(("Updated HSTS host: %s:%" PRIu32 " (max-age: %" PRId64 ", includeSubdomains: %s)\n",
+ u->host,
+- (unsigned) u->port,
+- (unsigned long) max_age,
++ (uint32_t) u->port,
++ max_age,
+ (include_subdomains ? "true" : "false")));
+ }
+ xfree (hsts_params);
diff --git a/sources b/sources
new file mode 100644
index 0000000..fe53de4
--- /dev/null
+++ b/sources
@@ -0,0 +1,2 @@
+817627c75c626274297c4ad1d188499d backport-wget-1.17-path.patch
+e89496b15f8bf039d723926fae4d91f5 wget-1.21.3.tar.gz
diff --git a/wget.spec b/wget.spec
new file mode 100644
index 0000000..4f5e2b1
--- /dev/null
+++ b/wget.spec
@@ -0,0 +1,107 @@
+Name: wget
+Version: 1.21.3
+Release: 1
+Summary: A package for retrieving files using HTTP, HTTPS, FTP and FTPS the most widely-used Internet protocols.
+License: GPLv3+
+Url: http://www.gnu.org/software/wget/
+Source: https://ftp.gnu.org/gnu/wget/wget-%{version}.tar.gz
+
+Patch0: backport-wget-1.17-path.patch
+Patch1: backport-wget-1.21.3-hsts-32bit.patch
+
+Provides: webclient bundled(gnulib)
+BuildRequires: make perl-HTTP-Daemon python3 libuuid-devel perl-podlators libpsl-devel libmetalink-devel
+BuildRequires: gnutls-devel pkgconfig texinfo gettext autoconf libidn2-devel gpgme-devel zlib-devel
+BuildRequires: gcc
+
+%description
+GNU Wget is a free software package for retrieving files using HTTP, HTTPS,
+FTP and FTPS the most widely-used Internet protocols. It is a non-interactive
+commandline tool, so it may easily be called from scripts, cron jobs, terminals
+without X-Windows support, etc.
+
+%package help
+Summary: help package for %{name}
+
+%description help
+This is the help package for %{name}. It includes some doc
+files and man, info files.
+
+%prep
+%autosetup -p1
+
+%build
+%configure --with-ssl=gnutls --with-libpsl --enable-largefile --enable-opie --enable-digest --enable-ntlm --enable-nls --enable-ipv6 --disable-rpath --with-metalink --disable-year2038
+
+%make_build
+
+%install
+%make_install CFLAGS="$RPM_OPT_FLAGS"
+%find_lang %{name}
+%find_lang %{name}-gnulib
+rm -f %{buildroot}%{_infodir}/dir
+
+%check
+make check
+
+%files -f %{name}.lang -f %{name}-gnulib.lang
+%doc AUTHORS COPYING
+%config(noreplace) %{_sysconfdir}/wgetrc
+%{_bindir}/wget
+
+%files help
+%doc MAILING-LIST NEWS README doc/sample.wgetrc
+%{_mandir}/man1/wget.*
+%{_infodir}/*
+
+%changelog
+* Fri Feb 03 2023 xingwei <xingwei14@h-partners.com> - 1.21.3-1
+- Type:requirements
+- ID:NA
+- SUG:NA
+- DESC:update wget to 1.21.3
+
+* Sat Oct 22 2022 gaihuiying <eaglegai@163.com> - 1.21.2-2
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:fix find_cell(): wget killed by SIGSEGV
+
+* Tue Mar 22 2022 xihaochen <xihaochen@huawei.com> - 1.21.2-1
+- Type:requirements
+- ID:NA
+- SUG:NA
+- DESC:update wget to 1.21.2
+
+* Fri Jul 30 2021 gaihuiying <gaihuiying1@huawei.com> - 1.20.3-5
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:fix build error with gcc10
+
+* Thu May 27 2021 lijingyuan <lijingyuan3@huawei.com> - 1.20.3-4
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:Add the compilation dependency of gcc.
+
+* Tue Dec 15 2020 xihaochen <xihaochen@huawei.com> - 1.20.3-3
+- Type:requirement
+- ID:NA
+- SUG:NA
+- DESC:update source url
+
+* Thu Apr 23 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.20.3-2
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC:Sanitize input param dl_total_time
+
+* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.20.3-1
+- Type:NA
+- ID:NA
+- SUG:NA
+- DESC:Package upgrade
+
+* Sat Sep 14 2019 huzhiyu<huzhiyu1@huawei.com> - 1.19.5-6
+- Package init