commit f6e7599e35f9771089a59483960606f07329f937 Author: MSVSphere Packaging Team Date: Tue Nov 26 17:01:47 2024 +0300 import libevent-2.1.12-15.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1814416 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libevent-2.1.12-stable.tar.gz diff --git a/.libevent.metadata b/.libevent.metadata new file mode 100644 index 0000000..4016b3b --- /dev/null +++ b/.libevent.metadata @@ -0,0 +1 @@ +cd55656a9b5bed630b08f05495230affb7996b21 SOURCES/libevent-2.1.12-stable.tar.gz diff --git a/SOURCES/0001-Revert-Fix-checking-return-value-of-the-evdns_base_r.patch b/SOURCES/0001-Revert-Fix-checking-return-value-of-the-evdns_base_r.patch new file mode 100644 index 0000000..a9517fc --- /dev/null +++ b/SOURCES/0001-Revert-Fix-checking-return-value-of-the-evdns_base_r.patch @@ -0,0 +1,43 @@ +From 7905dba8cf136574b87c972cf1f91a8f95b9df8c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= +Date: Tue, 29 Sep 2020 17:37:18 +0200 +Subject: [PATCH] Revert "Fix checking return value of the + evdns_base_resolv_conf_parse()" + +This reverts commit fc51bf2c5b686f623c9a2906ddad4042d5c3b39a. +--- + evdns.c | 2 +- + sample/dns-example.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/evdns.c b/evdns.c +index a5b31a3c..4aef28ec 100644 +--- a/evdns.c ++++ b/evdns.c +@@ -4035,7 +4035,7 @@ evdns_base_new(struct event_base *event_base, int flags) + #else + r = evdns_base_resolv_conf_parse(base, opts, "/etc/resolv.conf"); + #endif +- if (r) { ++ if (r == -1) { + evdns_base_free_and_unlock(base, 0); + return NULL; + } +diff --git a/sample/dns-example.c b/sample/dns-example.c +index 2d07c387..21a75de8 100644 +--- a/sample/dns-example.c ++++ b/sample/dns-example.c +@@ -225,8 +225,8 @@ main(int c, char **v) { + res = evdns_base_resolv_conf_parse(evdns_base, + DNS_OPTION_NAMESERVERS, o.resolv_conf); + +- if (res) { +- fprintf(stderr, "Couldn't configure nameservers\n"); ++ if (res < 0) { ++ fprintf(stderr, "Couldn't configure nameservers"); + return 1; + } + } +-- +2.25.4 + diff --git a/SOURCES/0001-build-add-doxygen-to-all.patch b/SOURCES/0001-build-add-doxygen-to-all.patch new file mode 100644 index 0000000..46b7285 --- /dev/null +++ b/SOURCES/0001-build-add-doxygen-to-all.patch @@ -0,0 +1,26 @@ +From e3e7bb212ea17aa8a9d5a30163487342e6ebb350 Mon Sep 17 00:00:00 2001 +From: Azat Khuzhin +Date: Tue, 11 Aug 2020 02:12:23 +0300 +Subject: [PATCH] build: add doxygen to all + +Fixes: 7e6c5fb4 ("build: do not try install doxygen man pages if they were not requested") +Fixes: #1075 +Fixes: #886 +--- + doxygen.am | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/doxygen.am b/doxygen.am +index 53da8d24..1377aacd 100644 +--- a/doxygen.am ++++ b/doxygen.am +@@ -53,5 +53,6 @@ uninstall-local: + rmdir "$(DESTDIR)$(htmldir)/" || true + + doxygen: doxygen-doc ++all: doxygen + + endif ENABLE_DOXYGEN +-- +2.25.4 + diff --git a/SOURCES/0001-build-do-not-try-install-doxygen-man-pages-if-they-w.patch b/SOURCES/0001-build-do-not-try-install-doxygen-man-pages-if-they-w.patch new file mode 100644 index 0000000..602899d --- /dev/null +++ b/SOURCES/0001-build-do-not-try-install-doxygen-man-pages-if-they-w.patch @@ -0,0 +1,43 @@ +From 7e6c5fb46ae9d0f135cdcdb4f8d0376cf25320fd Mon Sep 17 00:00:00 2001 +From: Azat Khuzhin +Date: Thu, 6 Aug 2020 10:24:55 +0300 +Subject: [PATCH] build: do not try install doxygen man pages if they were not + requested + +Fixes: #1075 +--- + doxygen.am | 2 ++ + m4/ax_prog_doxygen.m4 | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/doxygen.am b/doxygen.am +index 916d7c40..53da8d24 100644 +--- a/doxygen.am ++++ b/doxygen.am +@@ -17,9 +17,11 @@ if ENABLE_DOXYGEN + clean-local: + -rm -rf $(DX_CLEANFILES) + ++if ENABLE_DOXYGEN_MAN + # integrate doxygen with automake targets + man3_MANS = @DX_DOCDIR@/man/man3/* + $(man3_MANS): doxygen-doc ++endif ENABLE_DOXYGEN_MAN + + # Docs will be installed. It may be one or more docs supported + # by doxygen, but does not include 'man'. +diff --git a/m4/ax_prog_doxygen.m4 b/m4/ax_prog_doxygen.m4 +index e5bdeb59..338e4646 100644 +--- a/m4/ax_prog_doxygen.m4 ++++ b/m4/ax_prog_doxygen.m4 +@@ -574,6 +574,7 @@ DX_INSTALL_DOCS = \\ + \$(DX_CLEAN_HTML) \\ + \$(DX_CLEAN_CHM) \\ + \$(DX_CLEAN_CHI) \\ ++ \$(DX_CLEAN_MAN) \\ + \$(DX_CLEAN_RTF) \\ + \$(DX_CLEAN_XML) \\ + \$(DX_CLEAN_PS) \\ +-- +2.25.4 + diff --git a/SOURCES/0001-http-eliminate-redundant-bev-fd-manipulating-and-cac.patch b/SOURCES/0001-http-eliminate-redundant-bev-fd-manipulating-and-cac.patch new file mode 100644 index 0000000..a239904 --- /dev/null +++ b/SOURCES/0001-http-eliminate-redundant-bev-fd-manipulating-and-cac.patch @@ -0,0 +1,429 @@ +diff --git a/bufferevent.c b/bufferevent.c +index 08c0486c..68b35b1b 100644 +--- a/bufferevent.c ++++ b/bufferevent.c +@@ -876,6 +876,34 @@ bufferevent_setfd(struct bufferevent *bev, evutil_socket_t fd) + return res; + } + ++int ++bufferevent_replacefd(struct bufferevent *bev, evutil_socket_t fd) ++{ ++ union bufferevent_ctrl_data d; ++ int err = -1; ++ evutil_socket_t old_fd = EVUTIL_INVALID_SOCKET; ++ ++ BEV_LOCK(bev); ++ if (bev->be_ops->ctrl) { ++ err = bev->be_ops->ctrl(bev, BEV_CTRL_GET_FD, &d); ++ if (!err) { ++ old_fd = d.fd; ++ if (old_fd != EVUTIL_INVALID_SOCKET) { ++ err = evutil_closesocket(old_fd); ++ } ++ } ++ if (!err) { ++ d.fd = fd; ++ err = bev->be_ops->ctrl(bev, BEV_CTRL_SET_FD, &d); ++ } ++ } ++ if (err) ++ event_debug(("%s: cannot replace fd for %p from "EV_SOCK_FMT" to "EV_SOCK_FMT, __func__, bev, old_fd, fd)); ++ BEV_UNLOCK(bev); ++ ++ return err; ++} ++ + evutil_socket_t + bufferevent_getfd(struct bufferevent *bev) + { +diff --git a/http-internal.h b/http-internal.h +index feaf436d..22836032 100644 +--- a/http-internal.h ++++ b/http-internal.h +@@ -53,7 +53,6 @@ struct evhttp_connection { + * server */ + TAILQ_ENTRY(evhttp_connection) next; + +- evutil_socket_t fd; + struct bufferevent *bufev; + + struct event retry_ev; /* for retrying connects */ +@@ -174,7 +173,7 @@ struct evhttp { + /* XXX most of these functions could be static. */ + + /* resets the connection; can be reused for more requests */ +-void evhttp_connection_reset_(struct evhttp_connection *); ++void evhttp_connection_reset_(struct evhttp_connection *, int); + + /* connects if necessary */ + int evhttp_connection_connect_(struct evhttp_connection *); +diff --git a/http.c b/http.c +index 04f089bc..9d1d5d15 100644 +--- a/http.c ++++ b/http.c +@@ -777,7 +777,7 @@ evhttp_connection_fail_(struct evhttp_connection *evcon, + evhttp_request_free_(evcon, req); + + /* reset the connection */ +- evhttp_connection_reset_(evcon); ++ evhttp_connection_reset_(evcon, 1); + + /* We are trying the next request that was queued on us */ + if (TAILQ_FIRST(&evcon->requests) != NULL) +@@ -837,7 +837,7 @@ evhttp_connection_done(struct evhttp_connection *evcon) + + /* check if we got asked to close the connection */ + if (need_close) +- evhttp_connection_reset_(evcon); ++ evhttp_connection_reset_(evcon, 1); + + if (TAILQ_FIRST(&evcon->requests) != NULL) { + /* +@@ -1171,7 +1171,7 @@ evhttp_read_cb(struct bufferevent *bufev, void *arg) + __func__, EV_SIZE_ARG(total_len))); + #endif + +- evhttp_connection_reset_(evcon); ++ evhttp_connection_reset_(evcon, 1); + } + break; + case EVCON_DISCONNECTED: +@@ -1221,13 +1221,10 @@ void + evhttp_connection_free(struct evhttp_connection *evcon) + { + struct evhttp_request *req; +- int need_close = 0; + + /* notify interested parties that this connection is going down */ +- if (evcon->fd != -1) { +- if (evhttp_connected(evcon) && evcon->closecb != NULL) +- (*evcon->closecb)(evcon, evcon->closecb_arg); +- } ++ if (evhttp_connected(evcon) && evcon->closecb != NULL) ++ (*evcon->closecb)(evcon, evcon->closecb_arg); + + /* remove all requests that might be queued on this + * connection. for server connections, this should be empty. +@@ -1252,20 +1249,9 @@ evhttp_connection_free(struct evhttp_connection *evcon) + &evcon->read_more_deferred_cb); + + if (evcon->bufev != NULL) { +- need_close = +- !(bufferevent_get_options_(evcon->bufev) & BEV_OPT_CLOSE_ON_FREE); +- if (evcon->fd == -1) +- evcon->fd = bufferevent_getfd(evcon->bufev); +- + bufferevent_free(evcon->bufev); + } + +- if (evcon->fd != -1) { +- shutdown(evcon->fd, EVUTIL_SHUT_WR); +- if (need_close) +- evutil_closesocket(evcon->fd); +- } +- + if (evcon->bind_address != NULL) + mm_free(evcon->bind_address); + +@@ -1324,18 +1310,21 @@ evhttp_request_dispatch(struct evhttp_connection* evcon) + evhttp_write_buffer(evcon, evhttp_write_connectioncb, NULL); + } + +-/* Reset our connection state: disables reading/writing, closes our fd (if +-* any), clears out buffers, and puts us in state DISCONNECTED. */ +-void +-evhttp_connection_reset_(struct evhttp_connection *evcon) ++/** Hard-reset our connection state ++ * ++ * This will: ++ * - reset fd ++ * - clears out buffers ++ * - call closecb ++ */ ++static void ++evhttp_connection_reset_hard_(struct evhttp_connection *evcon) + { + struct evbuffer *tmp; + int err; + +- bufferevent_setcb(evcon->bufev, NULL, NULL, NULL, NULL); +- + /* XXXX This is not actually an optimal fix. Instead we ought to have +- an API for "stop connecting", or use bufferevent_setfd to turn off ++ an API for "stop connecting", or use bufferevent_replacefd to turn off + connecting. But for Libevent 2.0, this seems like a minimal change + least likely to disrupt the rest of the bufferevent and http code. + +@@ -1347,19 +1336,12 @@ evhttp_connection_reset_(struct evhttp_connection *evcon) + */ + bufferevent_disable_hard_(evcon->bufev, EV_READ|EV_WRITE); + +- if (evcon->fd == -1) +- evcon->fd = bufferevent_getfd(evcon->bufev); +- +- if (evcon->fd != -1) { +- /* inform interested parties about connection close */ +- if (evhttp_connected(evcon) && evcon->closecb != NULL) +- (*evcon->closecb)(evcon, evcon->closecb_arg); ++ /* inform interested parties about connection close */ ++ if (evhttp_connected(evcon) && evcon->closecb != NULL) ++ (*evcon->closecb)(evcon, evcon->closecb_arg); + +- shutdown(evcon->fd, EVUTIL_SHUT_WR); +- evutil_closesocket(evcon->fd); +- evcon->fd = -1; +- } +- err = bufferevent_setfd(evcon->bufev, -1); ++ /** FIXME: manipulating with fd is unwanted */ ++ err = bufferevent_replacefd(evcon->bufev, -1); + EVUTIL_ASSERT(!err && "setfd"); + + /* we need to clean up any buffered data */ +@@ -1369,9 +1351,26 @@ evhttp_connection_reset_(struct evhttp_connection *evcon) + tmp = bufferevent_get_input(evcon->bufev); + err = evbuffer_drain(tmp, -1); + EVUTIL_ASSERT(!err && "drain input"); ++} + +- evcon->flags &= ~EVHTTP_CON_READING_ERROR; ++/** Reset our connection state ++ * ++ * This will: ++ * - disables reading/writing ++ * - puts us in DISCONNECTED state ++ * ++ * @param hard - hard reset will (@see evhttp_connection_reset_hard_()) ++ */ ++void ++evhttp_connection_reset_(struct evhttp_connection *evcon, int hard) ++{ ++ bufferevent_setcb(evcon->bufev, NULL, NULL, NULL, NULL); + ++ if (hard) { ++ evhttp_connection_reset_hard_(evcon); ++ } ++ ++ evcon->flags &= ~EVHTTP_CON_READING_ERROR; + evcon->state = EVCON_DISCONNECTED; + } + +@@ -1403,7 +1402,8 @@ evhttp_connection_cb_cleanup(struct evhttp_connection *evcon) + { + struct evcon_requestq requests; + +- evhttp_connection_reset_(evcon); ++ evhttp_connection_reset_(evcon, 1); ++ + if (evcon->retry_max < 0 || evcon->retry_cnt < evcon->retry_max) { + struct timeval tv_retry = evcon->initial_retry_timeout; + int i; +@@ -1481,16 +1481,13 @@ evhttp_error_cb(struct bufferevent *bufev, short what, void *arg) + struct evhttp_connection *evcon = arg; + struct evhttp_request *req = TAILQ_FIRST(&evcon->requests); + +- if (evcon->fd == -1) +- evcon->fd = bufferevent_getfd(bufev); +- + switch (evcon->state) { + case EVCON_CONNECTING: + if (what & BEV_EVENT_TIMEOUT) { + event_debug(("%s: connection timeout for \"%s:%d\" on " + EV_SOCK_FMT, + __func__, evcon->address, evcon->port, +- EV_SOCK_ARG(evcon->fd))); ++ EV_SOCK_ARG(bufferevent_getfd(bufev)))); + evhttp_connection_cb_cleanup(evcon); + return; + } +@@ -1526,7 +1523,7 @@ evhttp_error_cb(struct bufferevent *bufev, short what, void *arg) + * disconnected. + */ + EVUTIL_ASSERT(evcon->state == EVCON_IDLE); +- evhttp_connection_reset_(evcon); ++ evhttp_connection_reset_(evcon, 1); + + /* + * If we have no more requests that need completion +@@ -1572,11 +1569,6 @@ static void + evhttp_connection_cb(struct bufferevent *bufev, short what, void *arg) + { + struct evhttp_connection *evcon = arg; +- int error; +- ev_socklen_t errsz = sizeof(error); +- +- if (evcon->fd == -1) +- evcon->fd = bufferevent_getfd(bufev); + + if (!(what & BEV_EVENT_CONNECTED)) { + /* some operating systems return ECONNREFUSED immediately +@@ -1591,34 +1583,10 @@ evhttp_connection_cb(struct bufferevent *bufev, short what, void *arg) + return; + } + +- if (evcon->fd == -1) { +- event_debug(("%s: bufferevent_getfd returned -1", +- __func__)); +- goto cleanup; +- } +- +- /* Check if the connection completed */ +- if (getsockopt(evcon->fd, SOL_SOCKET, SO_ERROR, (void*)&error, +- &errsz) == -1) { +- event_debug(("%s: getsockopt for \"%s:%d\" on "EV_SOCK_FMT, +- __func__, evcon->address, evcon->port, +- EV_SOCK_ARG(evcon->fd))); +- goto cleanup; +- } +- +- if (error) { +- event_debug(("%s: connect failed for \"%s:%d\" on " +- EV_SOCK_FMT": %s", +- __func__, evcon->address, evcon->port, +- EV_SOCK_ARG(evcon->fd), +- evutil_socket_error_to_string(error))); +- goto cleanup; +- } +- + /* We are connected to the server now */ + event_debug(("%s: connected to \"%s:%d\" on "EV_SOCK_FMT"\n", + __func__, evcon->address, evcon->port, +- EV_SOCK_ARG(evcon->fd))); ++ EV_SOCK_ARG(bufferevent_getfd(bufev)))); + + /* Reset the retry count as we were successful in connecting */ + evcon->retry_cnt = 0; +@@ -2280,7 +2248,7 @@ evhttp_read_firstline(struct evhttp_connection *evcon, + if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) { + /* Error while reading, terminate */ + event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n", +- __func__, EV_SOCK_ARG(evcon->fd))); ++ __func__, EV_SOCK_ARG(bufferevent_getfd(evcon->bufev)))); + evhttp_connection_fail_(evcon, EVREQ_HTTP_INVALID_HEADER); + return; + } else if (res == MORE_DATA_EXPECTED) { +@@ -2297,7 +2265,7 @@ evhttp_read_header(struct evhttp_connection *evcon, + struct evhttp_request *req) + { + enum message_read_status res; +- evutil_socket_t fd = evcon->fd; ++ evutil_socket_t fd = bufferevent_getfd(evcon->bufev); + + res = evhttp_parse_headers_(req, bufferevent_get_input(evcon->bufev)); + if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) { +@@ -2388,7 +2356,6 @@ evhttp_connection_base_bufferevent_new(struct event_base *base, struct evdns_bas + goto error; + } + +- evcon->fd = -1; + evcon->port = port; + + evcon->max_headers_size = EV_SIZE_MAX; +@@ -2403,7 +2370,7 @@ evhttp_connection_base_bufferevent_new(struct event_base *base, struct evdns_bas + } + + if (bev == NULL) { +- if (!(bev = bufferevent_socket_new(base, -1, 0))) { ++ if (!(bev = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE))) { + event_warn("%s: bufferevent_socket_new failed", __func__); + goto error; + } +@@ -2571,24 +2538,30 @@ evhttp_connection_connect_(struct evhttp_connection *evcon) + if (evcon->state == EVCON_CONNECTING) + return (0); + +- evhttp_connection_reset_(evcon); ++ /* Do not do hard reset, since this will reset the fd, but someone may ++ * change some options for it (i.e. setsockopt(), #875) ++ * ++ * However don't think that this options will be preserved for all ++ * connection lifetime, they will be reseted in the following cases: ++ * - evhttp_connection_set_local_address() ++ * - evhttp_connection_set_local_port() ++ * - evhttp_connection_set_retries() ++ * */ ++ evhttp_connection_reset_(evcon, 0); + + EVUTIL_ASSERT(!(evcon->flags & EVHTTP_CON_INCOMING)); + evcon->flags |= EVHTTP_CON_OUTGOING; + + if (evcon->bind_address || evcon->bind_port) { +- evcon->fd = bind_socket( +- evcon->bind_address, evcon->bind_port, 0 /*reuse*/); +- if (evcon->fd == -1) { ++ int fd = bind_socket(evcon->bind_address, evcon->bind_port, ++ 0 /*reuse*/); ++ if (fd == -1) { + event_debug(("%s: failed to bind to \"%s\"", + __func__, evcon->bind_address)); + return (-1); + } + +- if (bufferevent_setfd(evcon->bufev, evcon->fd)) +- return (-1); +- } else { +- if (bufferevent_setfd(evcon->bufev, -1)) ++ if (bufferevent_replacefd(evcon->bufev, fd)) + return (-1); + } + +@@ -2625,7 +2598,7 @@ evhttp_connection_connect_(struct evhttp_connection *evcon) + + if (ret < 0) { + evcon->state = old_state; +- event_sock_warn(evcon->fd, "%s: connection to \"%s\" failed", ++ event_sock_warn(bufferevent_getfd(evcon->bufev), "%s: connection to \"%s\" failed", + __func__, evcon->address); + /* some operating systems return ECONNREFUSED immediately + * when connecting to a local address. the cleanup is going +@@ -4265,9 +4238,7 @@ evhttp_get_request_connection( + evcon->flags |= EVHTTP_CON_INCOMING; + evcon->state = EVCON_READING_FIRSTLINE; + +- evcon->fd = fd; +- +- if (bufferevent_setfd(evcon->bufev, fd)) ++ if (bufferevent_replacefd(evcon->bufev, fd)) + goto err; + if (bufferevent_enable(evcon->bufev, EV_READ)) + goto err; +diff --git a/include/event2/bufferevent.h b/include/event2/bufferevent.h +index 48cd1535..e4e5c21b 100644 +--- a/include/event2/bufferevent.h ++++ b/include/event2/bufferevent.h +@@ -355,6 +355,18 @@ void bufferevent_getcb(struct bufferevent *bufev, + EVENT2_EXPORT_SYMBOL + int bufferevent_setfd(struct bufferevent *bufev, evutil_socket_t fd); + ++/** ++ Replaces the file descriptor on which the bufferevent operates. ++ Not supported for all bufferevent types. ++ ++ Unlike bufferevent_setfd() it will close previous file descriptor (if any). ++ ++ @param bufev the bufferevent object for which to change the file descriptor ++ @param fd the file descriptor to operate on ++*/ ++EVENT2_EXPORT_SYMBOL ++int bufferevent_replacefd(struct bufferevent *bufev, evutil_socket_t fd); ++ + /** + Returns the file descriptor associated with a bufferevent, or -1 if + no file descriptor is associated with the bufferevent. +diff --git a/include/event2/http.h b/include/event2/http.h +index 2a41303e..90f4cf9a 100644 +--- a/include/event2/http.h ++++ b/include/event2/http.h +@@ -721,7 +721,11 @@ void evhttp_connection_free(struct evhttp_connection *evcon); + EVENT2_EXPORT_SYMBOL + void evhttp_connection_free_on_completion(struct evhttp_connection *evcon); + +-/** sets the ip address from which http connections are made */ ++/** Sets the IP address from which http connections are made ++ * ++ * Note this resets internal bufferevent fd, so any options that had been ++ * installed will be flushed. ++ */ + EVENT2_EXPORT_SYMBOL + void evhttp_connection_set_local_address(struct evhttp_connection *evcon, + const char *address); diff --git a/SOURCES/libevent-nonettests.patch b/SOURCES/libevent-nonettests.patch new file mode 100644 index 0000000..f62df5b --- /dev/null +++ b/SOURCES/libevent-nonettests.patch @@ -0,0 +1,11 @@ +diff -up libevent-2.0.21-stable/test/regress_main.c.orig libevent-2.0.21-stable/test/regress_main.c +--- libevent-2.0.21-stable/test/regress_main.c.orig 2012-11-02 11:57:00.000000000 -0400 ++++ libevent-2.0.21-stable/test/regress_main.c 2013-08-21 10:16:26.714288000 -0400 +@@ -370,7 +370,6 @@ struct testgroup_t testgroups[] = { + { "util/", util_testcases }, + { "bufferevent/", bufferevent_testcases }, + { "http/", http_testcases }, +- { "dns/", dns_testcases }, + { "evtag/", evtag_testcases }, + { "rpc/", rpc_testcases }, + { "thread/", thread_testcases }, diff --git a/SPECS/libevent.spec b/SPECS/libevent.spec new file mode 100644 index 0000000..0cab907 --- /dev/null +++ b/SPECS/libevent.spec @@ -0,0 +1,405 @@ +%global develdocdir %{_docdir}/%{name}-devel + +Name: libevent +Version: 2.1.12 +Release: 15%{?dist} +Summary: Abstract asynchronous event notification library + +# arc4random.c, which is used in build, is ISC. The rest is BSD-3-Clause. +# evndns.* and include/event2/dns.h has part of LicenseRef-Fedora-Public-Domain +License: BSD-3-Clause AND ISC AND LicenseRef-Fedora-Public-Domain +URL: http://libevent.org/ +Source0: https://github.com/libevent/libevent/releases/download/release-%{version}-stable/libevent-%{version}-stable.tar.gz + +BuildRequires: make +BuildRequires: gcc +# Needed for ./autogen.sh: +BuildRequires: automake libtool +%if ! 0%{?_module_build} +BuildRequires: doxygen +%endif +BuildRequires: openssl-devel +BuildRequires: python3-devel + +# Disable network tests +Patch01: libevent-nonettests.patch +# Upstream patch: +Patch02: 0001-build-do-not-try-install-doxygen-man-pages-if-they-w.patch +# Upstream patch: +Patch03: 0001-build-add-doxygen-to-all.patch +# Temporary downstream change: revert a problematic upstream change +# until Transmission is fixed. Please drop the patch when the Transmission +# issue is fixed. +# https://github.com/transmission/transmission/issues/1437 +Patch04: 0001-Revert-Fix-checking-return-value-of-the-evdns_base_r.patch +# https://github.com/libevent/libevent/commit/afa66ea +# https://github.com/libevent/libevent/commit/aea752b +# https://github.com/libevent/libevent/commit/2385638 +Patch05: 0001-http-eliminate-redundant-bev-fd-manipulating-and-cac.patch + +%description +The libevent API provides a mechanism to execute a callback function +when a specific event occurs on a file descriptor or after a timeout +has been reached. libevent is meant to replace the asynchronous event +loop found in event driven network servers. An application just needs +to call event_dispatch() and can then add or remove events dynamically +without having to change the event loop. + +%package devel +Summary: Development files for %{name} +License: BSD-3-Clause AND LicenseRef-Fedora-Public-Domain +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains the header files and libraries for developing +with %{name}. + +%package doc +Summary: Development documentation for %{name} +# The files sample/openssl_hostname_validation.{c,h} and sample/hostcheck.{c,h} +# are MIT, sample/ssl-client-mbedtls.c is Apache-2.0, and the rest is BSD. +License: BSD-3-Clause AND MIT AND Apache-2.0 +BuildArch: noarch + +%description doc +This package contains the development documentation for %{name}. + +%prep +%autosetup -p1 -n libevent-%{version}-stable + +%{__python3} %{_rpmconfigdir}/redhat/pathfix.py -i %{__python3} -pn test/check-dumpevents.py \ + event_rpcgen.py + +%build +# We're patching doxygen.am, so regenerate the autotools stuff to be +# safe +./autogen.sh +%configure \ +%if ! 0%{?_module_build} + --enable-doxygen-doc \ +%endif + --disable-dependency-tracking --disable-static +%make_build all + +%install +%make_install +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + +# Maintain the Fedora-specific location of libevent documentation, at +# least for now +mv $RPM_BUILD_ROOT/%{_docdir}/%{name} $RPM_BUILD_ROOT/%{develdocdir} + +# Fix multilib install of devel (bug #477685) +mv $RPM_BUILD_ROOT%{_includedir}/event2/event-config.h \ + $RPM_BUILD_ROOT%{_includedir}/event2/event-config-%{__isa_bits}.h +cat > $RPM_BUILD_ROOT%{_includedir}/event2/event-config.h << EOF +#include + +#if __WORDSIZE == 32 +#include +#elif __WORDSIZE == 64 +#include +#else +#error "Unknown word size" +#endif +EOF + +mkdir -p $RPM_BUILD_ROOT/%{develdocdir}/sample +(cd sample; \ + install -p -m 644 *.c *.am $RPM_BUILD_ROOT/%{develdocdir}/sample) + +%check +# Tests fail due to nameserver not running locally +# [msg] Nameserver 127.0.0.1:38762 has failed: request timed out. +# On some architects this error is ignored on others it is not. +#make check + +%ldconfig_scriptlets + +%files +%license LICENSE +%doc ChangeLog +%{_libdir}/libevent-2.1.so.* +%{_libdir}/libevent_core-2.1.so.* +%{_libdir}/libevent_extra-2.1.so.* +%{_libdir}/libevent_openssl-2.1.so.* +%{_libdir}/libevent_pthreads-2.1.so.* + +%files devel +%{_includedir}/event.h +%{_includedir}/evdns.h +%{_includedir}/evhttp.h +%{_includedir}/evrpc.h +%{_includedir}/evutil.h +%dir %{_includedir}/event2 +%{_includedir}/event2/*.h +%{_libdir}/libevent.so +%{_libdir}/libevent_core.so +%{_libdir}/libevent_extra.so +%{_libdir}/libevent_openssl.so +%{_libdir}/libevent_pthreads.so +%{_libdir}/pkgconfig/libevent.pc +%{_libdir}/pkgconfig/libevent_core.pc +%{_libdir}/pkgconfig/libevent_extra.pc +%{_libdir}/pkgconfig/libevent_openssl.pc +%{_libdir}/pkgconfig/libevent_pthreads.pc +%{_bindir}/event_rpcgen.* + +%files doc +%doc %{develdocdir}/ + +%changelog +* Tue Nov 26 2024 MSVSphere Packaging Team - 2.1.12-15 +- Rebuilt for MSVSphere 10 + +* Tue Aug 13 2024 Pavol Žáčik - 2.1.12-15 +- Patch duplicate file descriptor manipulation +- Resolves: RHEL-35256 + +* Mon Jun 24 2024 Troy Dawson - 2.1.12-14 +- Bump release for June 2024 mass rebuild + +* Thu May 09 2024 Pavol Žáčik - 2.1.12-13 +- Update license identifiers to SPDX in subpackages +- Add Apache-2.0 license which appears in sample/ssl-client-mbedtls.c + +* Tue Feb 13 2024 Joe Orton - 2.1.12-12 +- use autosetup +- SPDX migration (Miroslav Suchý) + +* Thu Jan 25 2024 Fedora Release Engineering - 2.1.12-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 2.1.12-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jul 20 2023 Fedora Release Engineering - 2.1.12-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 2.1.12-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 2.1.12-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 2.1.12-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Sep 14 2021 Sahana Prasad - 2.1.12-5 +- Rebuilt with OpenSSL 3.0.0 + +* Thu Jul 22 2021 Fedora Release Engineering - 2.1.12-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 2.1.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Sep 29 2020 Ondřej Lysoněk - 2.1.12-2 +- Temporarily revert a problematic upstream change + +* Mon Sep 14 2020 Ondřej Lysoněk - 2.1.12-1 +- new version +- Resolves: rhbz#1713942 + +* Tue Jul 28 2020 Fedora Release Engineering - 2.1.8-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 13 2020 Tom Stellard - 2.1.8-9 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + +* Wed Jan 29 2020 Fedora Release Engineering - 2.1.8-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Aug 15 2019 Ondřej Lysoněk - 2.1.8-7 +- Port python scripts to Python 3 +- Resolves: rhbz#1738022 +- Resolves: rhbz#1655232 + +* Thu Jul 25 2019 Fedora Release Engineering - 2.1.8-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 2.1.8-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Sep 03 2018 Ondřej Lysoněk - 2.1.8-4 +- Corrected the License tag +- Resolves: rhbz#1624851 + +* Fri Jul 13 2018 Fedora Release Engineering - 2.1.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Feb 15 2018 Steve Dickson - 2.1.8-2 +- Explicitly express SONAME in the %%file section + +* Thu Feb 15 2018 Igor Gnatenko - 2.1.8-1 +- Fix ownership of pkg-config files +- Remove unneeded Group tag + +* Wed Feb 14 2018 Steve Dickson - 2.1.8-0 +- Updated to the latest upstream release 2.1.8 (bz 1418488) + +* Wed Feb 07 2018 Fedora Release Engineering - 2.0.22-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 2.0.22-7 +- Switch to %%ldconfig_scriptlets + +* Thu Aug 03 2017 Fedora Release Engineering - 2.0.22-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.0.22-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Apr 12 2017 Nils Philippsen - 2.0.22-4 +- don't build doxygen documentation during modular build + +* Mon Mar 27 2017 Tomáš Mráz - 2.0.22-3 +- Make it build with OpenSSL-1.1.0, cherry-picked from upstream git + +* Fri Feb 10 2017 Fedora Release Engineering - 2.0.22-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Jun 24 2016 Orion Poplawski - 2.0.22-1 +- Update to 2.0.22 +- Spec cleanup, new URL +- Support multilib devel (bug #477685) + +* Thu Feb 04 2016 Fedora Release Engineering - 2.0.21-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 2.0.21-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Aug 17 2014 Fedora Release Engineering - 2.0.21-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 2.0.21-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Dec 21 2013 Michael Schwendt - 2.0.21-4 +- Fix -doc package for F20 UnversionedDocDirs (#993956) +- Add missing directory /usr/include/event2 +- Fix directory ownership in -doc package +- Correct summary and description of -devel and -doc packages +- Set -doc package Group tag to "Documentation" +- Add %%?_isa to -devel package base dependency +- Remove %%defattr + +* Wed Aug 21 2013 Steve Dickson 2.0.21-3 +- Removed rpmlint warnings + +* Sat Aug 03 2013 Fedora Release Engineering - 2.0.21-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu May 2 2013 Orion Poplawski - 2.0.21-1 +- Update to 2.0.21 +- Add %%check + +* Thu Feb 14 2013 Fedora Release Engineering - 2.0.18-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 2.0.18-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Apr 4 2012 Steve Dickson 2.0.18-1 +- Updated to latest stable upstream version: 2.0.18-stable +- Moved documentation into its own rpm (bz 810138) + +* Mon Mar 12 2012 Steve Dickson 2.0.17-1 +- Updated to latest stable upstream version: 2.0.17-stable + +* Fri Jan 13 2012 Fedora Release Engineering - 2.0.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Aug 10 2011 Steve Dickson 2.0.14-1 +- Updated to latest stable upstream version: 2.0.14-stable (bz 727129) +- Removed the installion of the outdate man pages and the latex raw docs. +- Corrected where the other doc are installed. + +* Wed Aug 10 2011 Steve Dickson 2.0.13-1 +- Updated to latest stable upstream version: 2.0.13-stable (bz 727129) + +* Tue Aug 2 2011 Steve Dickson 2.0.12-1 +- Updated to latest stable upstream version: 2.0.12-stable + +* Wed Feb 09 2011 Rahul Sundaram - 2.0.10-2 +- Fix build +- Update spec to match current guidelines +- drop no longer needed patch + +* Tue Feb 8 2011 Steve Dickson 2.0.10-1 +- Updated to latest stable upstream version: 2.0.10-stable + +* Mon Feb 07 2011 Fedora Release Engineering - 1.4.14b-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jun 22 2010 Steve Dickson 1.4.14b-1 +- Updated to latest stable upstream version: 1.4.14b + +* Fri May 21 2010 Tom "spot" Callaway 1.4.13-2 +- disable static libs (bz 556067) + +* Tue Dec 15 2009 Steve Dickson 1.4.13-1 +- Updated to latest stable upstream version: 1.4.13 + +* Tue Aug 18 2009 Steve Dickson 1.4.12-1 +- Updated to latest stable upstream version: 1.4.12 +- API documentation is now installed (bz 487977) +- libevent-devel multilib conflict (bz 477685) +- epoll backend allocates too much memory (bz 517918) + +* Fri Jul 24 2009 Fedora Release Engineering - 1.4.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Apr 20 2009 Steve Dickson 1.4.10-1 +- Updated to latest stable upstream version: 1.4.10 + +* Wed Feb 25 2009 Fedora Release Engineering - 1.4.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Jul 1 2008 Steve Dickson 1.4.5-1 +- Updated to latest stable upstream version 1.4.5-stable + +* Mon Jun 2 2008 Steve Dickson 1.4.4-1 +- Updated to latest stable upstream version 1.4.4-stable + +* Tue Feb 19 2008 Fedora Release Engineering - 1.3e-2 +- Autorebuild for GCC 4.3 + +* Tue Jan 22 2008 Steve Dickson 1.3e-1 +- Updated to latest stable upstream version 1.3e + +* Fri Mar 9 2007 Steve Dickson 1.3b-1 +- Updated to latest upstream version 1.3b +- Incorporated Merge Review comments (bz 226002) +- Increased the polling timeout (bz 204990) + +* Tue Feb 20 2007 Steve Dickson 1.2a-1 +- Updated to latest upstream version 1.2a + +* Wed Jul 12 2006 Jesse Keating +- rebuild + +* Fri Feb 10 2006 Jesse Keating - 1.1a-3.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1.1a-3.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Tue Jan 24 2006 Warren Togami - 1.1a-3 +- rebuild (#177697) + +* Mon Jul 04 2005 Ralf Ertzinger - 1.1a-2 +- Removed unnecessary -r from rm + +* Fri Jun 17 2005 Ralf Ertzinger - 1.1a-1 +- Upstream update + +* Wed Jun 08 2005 Ralf Ertzinger - 1.1-2 +- Added some docs +- Moved "make verify" into %%check + +* Mon Jun 06 2005 Ralf Ertzinger - 1.1-1 +- Initial build for Fedora Extras, based on the package + by Dag Wieers