Compare commits

..

1 commit

Author SHA1 Message Date
Luboš Uhliarik
6aaff341cc Resolves: #1996685 - add various Coverity/Clang cleanups 2021-08-24 16:10:51 +02:00
8 changed files with 283 additions and 454 deletions

5
.gitignore vendored
View file

@ -15,8 +15,3 @@ apr-1.3.9.tar.bz2
/apr-1.6.3.tar.bz2
/apr-1.6.5.tar.bz2
/apr-1.7.0.tar.bz2
/apr-1.7.1.tar.bz2
/apr-1.7.2.tar.bz2
/apr-1.7.3.tar.bz2
/apr-1.7.5.tar.bz2
/apr-1.7.6.tar.bz2

View file

@ -1,8 +1,9 @@
diff --git a/apr-config.in b/apr-config.in
index bed47ca..d4bf4d8 100644
--- a/apr-config.in
+++ b/apr-config.in
@@ -198,8 +198,10 @@ while test $# -gt 0; do
- avoid adding %{_libdir} to --link-ld output
--- apr-1.2.2/apr-config.in.libdir
+++ apr-1.2.2/apr-config.in
@@ -181,8 +181,10 @@
;;
--link-ld)
if test "$location" = "installed"; then
@ -12,6 +13,6 @@ index bed47ca..d4bf4d8 100644
+ flags="$flags -L$libdir"
+ fi
+ flags="$flags -l${APR_LIBNAME}"
elif test "$location" = "crosscompile"; then
flags="$flags -L$APR_TARGET_DIR/$libdir -l${APR_LIBNAME}"
else
### this surely can't work since the library is in .libs?
flags="$flags -L$APR_BUILD_DIR -l${APR_LIBNAME}"

View file

@ -1,5 +1,6 @@
Add $APR_DEEPBIND to enable use of RTLD_DEEPBIND in apr_dso_open().
Conflicting e.g. libldap vs libldap_r problems still exist
inside httpd. Use RTLD_DEEPBIND by default.
--- apr-1.7.0/dso/unix/dso.c.deepbind
+++ apr-1.7.0/dso/unix/dso.c
@ -18,43 +19,10 @@ Add $APR_DEEPBIND to enable use of RTLD_DEEPBIND in apr_dso_open().
void *os_handle;
+
+ if (use_deepbind == 0)
+ use_deepbind = secure_getenv("APR_DEEPBIND") != NULL ? 1 : -1;
+ use_deepbind = getenv("APR_DEEPBIND") != NULL ? 1 : -1;
+ if (use_deepbind == 1)
+ flags |= RTLD_DEEPBIND;
+
#ifdef _AIX
if (strchr(path + 1, '(') && path[strlen(path) - 1] == ')')
{
--- apr-1.7.0/README.deepbind.deepbind
+++ apr-1.7.0/README.deepbind
@@ -0,0 +1,30 @@
+This distribution of APR contains a modification of the behaviour of
+the apr_dso_open() function which allows users enable the
+"RTLD_DEEPBIND" flag when dlopen() is called.
+
+If the "APR_DEEPBIND" environment variable is set at runtime, the
+RTLD_DEEPBIND flag is always added to the flags passed to dlopen().
+
+With normal use of dlopen(), dynamically loaded objects will use
+global symbols in preference to any symbols defined within the object.
+Using RTLD_DEEPBIND reverses this binding order. See the dlopen(3)
+man page for more information.
+
+This can be useful with Apache httpd, where two different modules are
+loaded like:
+
+1. mod_foo.so uses library "libfoo.so"
+ libfoo.so defines a function "SomeSym"
+2. mod_bar.so uses library "libbar.so"
+ libbar.so defines a different "SomeSym" function
+
+By default, mod_bar or mod_foo would use the "SomeSym" definition from
+the "wrong" library depending on the load order. If RTLD_DEEPBIND is
+used, the "SomeSym" definition will always be mapped to the definition
+from the corresponding dependent library. This can avoid symbol
+conflicts.
+
+There are some risks with using RTLD_DEEPBIND, in particular potential
+issues with modules written in C++. It is not recommended to enable
+$APR_DEEPBIND unless it solves a specific problem and after thorough
+testing of the configuration.

239
apr-1.7.0-r1891269+.patch Normal file
View file

@ -0,0 +1,239 @@
# ./pullrev.sh 1891269 1891198 1891196
http://svn.apache.org/viewvc?view=revision&revision=1891269
http://svn.apache.org/viewvc?view=revision&revision=1891198
http://svn.apache.org/viewvc?view=revision&revision=1891196
--- apr-1.7.0/include/arch/unix/apr_arch_thread_mutex.h
+++ apr-1.7.0/include/arch/unix/apr_arch_thread_mutex.h
@@ -33,8 +33,10 @@
struct apr_thread_mutex_t {
apr_pool_t *pool;
pthread_mutex_t mutex;
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
apr_thread_cond_t *cond;
int locked, num_waiters;
+#endif
};
#endif
--- apr-1.7.0/locks/unix/thread_mutex.c
+++ apr-1.7.0/locks/unix/thread_mutex.c
@@ -102,6 +102,7 @@
{
apr_status_t rv;
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
if (mutex->cond) {
apr_status_t rv2;
@@ -133,6 +134,7 @@
return rv;
}
+#endif
rv = pthread_mutex_lock(&mutex->mutex);
#ifdef HAVE_ZOS_PTHREADS
@@ -148,6 +150,7 @@
{
apr_status_t rv;
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
if (mutex->cond) {
apr_status_t rv2;
@@ -177,6 +180,7 @@
return rv;
}
+#endif
rv = pthread_mutex_trylock(&mutex->mutex);
if (rv) {
@@ -281,6 +285,7 @@
{
apr_status_t status;
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
if (mutex->cond) {
status = pthread_mutex_lock(&mutex->mutex);
if (status) {
@@ -303,6 +308,7 @@
mutex->locked = 0;
}
+#endif
status = pthread_mutex_unlock(&mutex->mutex);
#ifdef HAVE_ZOS_PTHREADS
@@ -318,9 +324,12 @@
{
apr_status_t rv, rv2 = APR_SUCCESS;
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
if (mutex->cond) {
rv2 = apr_thread_cond_destroy(mutex->cond);
}
+#endif
+
rv = apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup);
if (rv == APR_SUCCESS) {
rv = rv2;
--- apr-1.7.0/random/unix/sha2.c
+++ apr-1.7.0/random/unix/sha2.c
@@ -425,7 +425,7 @@
usedspace = freespace = 0;
}
-void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
+void apr__SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context) {
sha2_word32 *d = (sha2_word32*)digest;
unsigned int usedspace;
@@ -496,7 +496,7 @@
usedspace = 0;
}
-char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) {
+char *apr__SHA256_End(SHA256_CTX* context, char buffer[SHA256_DIGEST_STRING_LENGTH]) {
sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest;
int i;
--- apr-1.7.0/time/unix/time.c
+++ apr-1.7.0/time/unix/time.c
@@ -142,6 +142,9 @@
static const int dayoffset[12] =
{306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275};
+ if (xt->tm_mon < 0 || xt->tm_mon >= 12)
+ return APR_EBADDATE;
+
/* shift new year to 1st March in order to make leap year calc easy */
if (xt->tm_mon < 2)
--- apr-1.7.0/time/win32/time.c
+++ apr-1.7.0/time/win32/time.c
@@ -54,6 +54,9 @@
static const int dayoffset[12] =
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
+ if (tm->wMonth < 1 || tm->wMonth > 12)
+ return APR_EBADDATE;
+
/* Note; the caller is responsible for filling in detailed tm_usec,
* tm_gmtoff and tm_isdst data when applicable.
*/
@@ -228,6 +231,9 @@
static const int dayoffset[12] =
{306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275};
+ if (xt->tm_mon < 0 || xt->tm_mon >= 12)
+ return APR_EBADDATE;
+
/* shift new year to 1st March in order to make leap year calc easy */
if (xt->tm_mon < 2)
--- apr-1.7.0/file_io/unix/readwrite.c
+++ apr-1.7.0/file_io/unix/readwrite.c
@@ -146,7 +146,7 @@
APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
{
- apr_size_t rv;
+ apr_size_t rv = APR_SUCCESS;
if (thefile->buffered) {
char *pos = (char *)buf;
@@ -160,13 +160,14 @@
* logically reading from
*/
apr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos;
- if (offset != thefile->filePtr)
- lseek(thefile->filedes, offset, SEEK_SET);
+ if (offset != thefile->filePtr) {
+ thefile->filePtr = lseek(thefile->filedes, offset, SEEK_SET);
+ if (thefile->filePtr == -1) rv = errno;
+ }
thefile->bufpos = thefile->dataRead = 0;
thefile->direction = 1;
}
- rv = 0;
while (rv == 0 && size > 0) {
if (thefile->bufpos == thefile->bufsize) /* write buffer is full*/
rv = apr_file_flush_locked(thefile);
@@ -244,12 +245,15 @@
*/
apr_int64_t offset = thefile->filePtr - thefile->dataRead +
thefile->bufpos;
- if (offset != thefile->filePtr)
- lseek(thefile->filedes, offset, SEEK_SET);
+ if (offset != thefile->filePtr) {
+ thefile->filePtr = lseek(thefile->filedes, offset, SEEK_SET);
+ if (thefile->filePtr == -1) rv = errno;
+ }
thefile->bufpos = thefile->dataRead = 0;
}
file_unlock(thefile);
+ if (rv) return rv;
}
if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) {
--- apr-1.7.0/locks/unix/proc_mutex.c
+++ apr-1.7.0/locks/unix/proc_mutex.c
@@ -1518,11 +1518,10 @@
APR_DECLARE(const char *) apr_proc_mutex_defname(void)
{
- apr_status_t rv;
apr_proc_mutex_t mutex;
- if ((rv = proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT,
- NULL)) != APR_SUCCESS) {
+ if (proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT,
+ NULL) != APR_SUCCESS) {
return "unknown";
}
--- apr-1.7.0/memory/unix/apr_pools.c
+++ apr-1.7.0/memory/unix/apr_pools.c
@@ -1338,7 +1338,7 @@
apr_size_t free_index;
pool_concurrency_set_used(pool);
- ps.node = active = pool->active;
+ ps.node = pool->active;
ps.pool = pool;
ps.vbuff.curpos = ps.node->first_avail;
--- apr-1.7.0/test/teststr.c
+++ apr-1.7.0/test/teststr.c
@@ -394,6 +394,19 @@
ABTS_STR_EQUAL(tc, apr_cstr_skip_prefix("", "12"), NULL);
}
+static void pstrcat(abts_case *tc, void *data)
+{
+ ABTS_STR_EQUAL(tc, apr_pstrcat(p, "a", "bc", "def", NULL),
+ "abcdef");
+ ABTS_STR_EQUAL(tc, apr_pstrcat(p, NULL), "");
+ ABTS_STR_EQUAL(tc, apr_pstrcat(p,
+ "a", "b", "c", "d", "e",
+ "f", "g", "h", "i", "j",
+ "1", "2", "3", "4", "5",
+ NULL),
+ "abcdefghij12345");
+}
+
abts_suite *teststr(abts_suite *suite)
{
suite = ADD_SUITE(suite)
@@ -412,6 +425,7 @@
abts_run_test(suite, string_cpystrn, NULL);
abts_run_test(suite, snprintf_overflow, NULL);
abts_run_test(suite, skip_prefix, NULL);
+ abts_run_test(suite, pstrcat, NULL);
return suite;
}

View file

@ -1,200 +0,0 @@
https://github.com/apache/apr/pull/68
--- apr-1.7.6/build/apr_common.m4.5
+++ apr-1.7.6/build/apr_common.m4
@@ -467,19 +467,11 @@
CFLAGS="$CFLAGS -Werror"
fi
AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [
-#ifndef PACKAGE_NAME
-#include "confdefs.h"
-#endif
- ]
- [[$1]]
- [int main(int argc, const char *const *argv) {]
- [[$2]]
- [ return 0; }]
- )], [CFLAGS=$apr_save_CFLAGS
-$3], [CFLAGS=$apr_save_CFLAGS
-$4])
+ [AC_LANG_PROGRAM([[$1]], [[$2]])],
+ [CFLAGS=$apr_save_CFLAGS
+ $3],
+ [CFLAGS=$apr_save_CFLAGS
+ $4])
])
dnl
--- apr-1.7.6/build/apr_network.m4.5
+++ apr-1.7.6/build/apr_network.m4
@@ -259,11 +259,12 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#include <stdio.h>
],[
int tmp = gethostbyname_r((const char *) 0, (struct hostent *) 0,
(char *) 0, 0, (struct hostent **) 0, &tmp);
/* use tmp to suppress the warning */
-tmp=0;
+puts(tmp ? "non-zero" : "zero");
], ac_cv_gethostbyname_r_style=glibc2, ac_cv_gethostbyname_r_style=none))
if test "$ac_cv_gethostbyname_r_style" = "glibc2"; then
@@ -287,11 +288,12 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#include <stdio.h>
],[
int tmp = gethostbyname_r((const char *) 0, (struct hostent *) 0,
(struct hostent_data *) 0);
/* use tmp to suppress the warning */
-tmp=0;
+puts(tmp ? "non-zero" : "zero");
], ac_cv_gethostbyname_r_arg=hostent_data, ac_cv_gethostbyname_r_arg=char))
if test "$ac_cv_gethostbyname_r_arg" = "hostent_data"; then
@@ -327,12 +329,13 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#include <stdio.h>
],[
int tmp = getservbyname_r((const char *) 0, (const char *) 0,
(struct servent *) 0, (char *) 0, 0,
(struct servent **) 0);
/* use tmp to suppress the warning */
-tmp=0;
+puts(tmp ? "non-zero" : "zero");
], ac_cv_getservbyname_r_style=glibc2, ac_cv_getservbyname_r_style=none)
if test "$ac_cv_getservbyname_r_style" = "none"; then
@@ -354,11 +357,12 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+ #include <stdio.h>
],[
struct servent *tmp = getservbyname_r((const char *) 0, (const char *) 0,
(struct servent *) 0, (char *) 0, 0);
/* use tmp to suppress the warning */
- tmp=NULL;
+ puts(tmp ? "non-zero" : "zero");
], ac_cv_getservbyname_r_style=solaris, ac_cv_getservbyname_r_style=none)
fi
@@ -381,11 +385,12 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+ #include <stdio.h>
],[
int tmp = getservbyname_r((const char *) 0, (const char *) 0,
(struct servent *) 0, (struct servent_data *) 0);
/* use tmp to suppress the warning */
- tmp=0;
+ puts(tmp ? "non-zero" : "zero");
], ac_cv_getservbyname_r_style=osf1, ac_cv_getservbyname_r_style=none)
fi
])
--- apr-1.7.6/build/buildcheck.sh.5
+++ apr-1.7.6/build/buildcheck.sh
@@ -15,11 +15,11 @@
echo "buildconf: python version $py_version (ok)"
fi
-# autoconf 2.59 or newer
+# autoconf 2.61 or newer
ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'`
if test -z "$ac_version"; then
echo "buildconf: autoconf not found."
- echo " You need autoconf version 2.59 or newer installed"
+ echo " You need autoconf version 2.61 or newer installed"
echo " to build APR from SVN."
res=1
else
--- apr-1.7.6/configure.in.5
+++ apr-1.7.6/configure.in
@@ -145,12 +145,14 @@
APR_CROSS_COMPILING=maybe
elif test "x$build_alias" != "x$host_alias"; then
APR_CROSS_COMPILING=yes
+ else
+ APR_CROSS_COMPILING=no
fi
else
APR_CROSS_COMPILING=no
fi
-
AC_SUBST(APR_CROSS_COMPILING)
+AC_MSG_NOTICE([cross-compilation detection: $APR_CROSS_COMPILING])
# Libtool might need this symbol -- it must point to the location of
# the generated libtool script (not necessarily the "top" build dir).
@@ -1876,6 +1878,7 @@
AC_CHECK_TYPE(ssize_t, int)
AC_C_INLINE
AC_C_CONST
+AC_C_VARARRAYS
AC_FUNC_SETPGRP
APR_CHECK_SOCKLEN_T
@@ -1971,6 +1974,8 @@
AC_ERROR([could not detect a 64-bit integer type])
fi
+AC_MSG_NOTICE([for apr_(u)int64_t using $int64_strfn and ${int64_value}/${uint64_value}])
+
# If present, allow the C99 macro INT64_C to override our conversion.
#
# HP-UX's ANSI C compiler provides this without any includes, so we
@@ -2152,7 +2157,6 @@
aprlfs=0
fi
-AC_MSG_CHECKING([which type to use for apr_off_t])
if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
# LFS is go!
off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT'
@@ -2203,7 +2207,7 @@
off_t_fmt=d
off_t_strfn='strtoi'
fi
-AC_MSG_RESULT($off_t_value)
+AC_MSG_NOTICE([for apr_off_t using $off_t_strfn and $off_t_value])
# Regardless of whether _LARGEFILE64_SOURCE is used, on some
# platforms _FILE_OFFSET_BITS will affect the size of ino_t and hence
@@ -2234,7 +2238,7 @@
fi
;;
esac
-AC_MSG_NOTICE([using $ino_t_value for ino_t])
+AC_MSG_NOTICE([for apr_ino_t using $ino_t_value])
# Checks for endianness
AC_C_BIGENDIAN
--- apr-1.7.6/poll/unix/poll.c.5
+++ apr-1.7.6/poll/unix/poll.c
@@ -73,7 +73,7 @@
apr_interval_time_t timeout)
{
int i, num_to_poll;
-#ifdef HAVE_VLA
+#ifdef HAVE_C_VARARRAYS
/* XXX: I trust that this is a segv when insufficient stack exists? */
struct pollfd pollset[num + 1]; /* +1 since allocating 0 is undefined behaviour */
#elif defined(HAVE_ALLOCA)
@@ -130,7 +130,7 @@
}
}
-#if !defined(HAVE_VLA) && !defined(HAVE_ALLOCA)
+#if !defined(HAVE_C_VARARRAYS) && !defined(HAVE_ALLOCA)
if (num > SMALL_POLLSET_LIMIT) {
free(pollset);
}

185
apr.spec
View file

@ -1,38 +1,30 @@
%define aprver 1
%bcond tests 1
# Arches on which the multilib apr.h hack is needed:
%define multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64
# Similar issue to https://bugzilla.redhat.com/show_bug.cgi?id=2043092
%undefine _package_note_flags
# Disable .la file removal since the .la file is exported via apr-config.
%global __brp_remove_la_files %nil
Summary: Apache Portable Runtime library
Name: apr
Version: 1.7.6
Release: 4%{?dist}
# Apache-2.0: everything
Version: 1.7.0
Release: 9%{?dist}
# ASL 2.0: everything
# ISC: network_io/apr-1.4.6/network_io/unix/inet_?to?.c
# BSD-4-Clause-UC: strings/apr_snprintf.c, strings/apr_fnmatch.c,
# BSD with advertising: strings/apr_snprintf.c, strings/apr_fnmatch.c,
# include/apr_fnmatch.h, misc/unix/getopt.c,
# file_io/unix/mktemp.c, strings/apr_strings.c
# Zlib: strings/apr_strnatcmp.c, include/apr_strings.h
# Caldera-no-preamble: strings/apr_snprintf.c
License: Apache-2.0 AND (BSD-4-Clause-UC AND ISC AND Zlib AND Caldera-no-preamble)
# BSD (3-clause): strings/apr_strnatcmp.c, include/apr_strings.h
License: ASL 2.0 and BSD with advertising and ISC and BSD
URL: https://apr.apache.org/
Source0: https://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2
Source1: apr-wrapper.h
Patch1: apr-1.7.2-libdir.patch
Patch1: apr-1.2.2-libdir.patch
Patch2: apr-1.2.7-pkgconf.patch
Patch3: apr-1.7.0-deepbind.patch
Patch4: apr-1.7.6-autoconf.patch
Patch4: apr-1.7.0-r1891269+.patch
BuildRequires: gcc, autoconf, libtool, libuuid-devel, python3
# To enable SCTP support
BuildRequires: lksctp-tools-devel
BuildRequires: make
BuildRequires: libxcrypt-devel
%description
The mission of the Apache Portable Runtime (APR) is to provide a
@ -52,39 +44,25 @@ Apache Portable Runtime (APR) is to provide a free library of
C data structures and routines.
%prep
%autosetup -p1 -S gendiff
%setup -q
%patch1 -p1 -b .libdir
%patch2 -p1 -b .pkgconf
%patch3 -p1 -b .deepbind
%patch4 -p1 -b .r1891269+
%build
# regenerate configure script etc.
./buildconf
# Forcibly prevent detection of shm_open (which then picks up but
# does not use -lrt).
export ac_cv_search_shm_open=no
%configure \
--includedir=%{_includedir}/apr-%{aprver} \
--with-installbuilddir=%{_libdir}/apr-%{aprver}/build \
--with-devrandom=/dev/urandom \
--disable-static \
--disable-sctp
# Sanity tests to catch subtle configure script failures:
#
# 1. Fail if apr_strtoi64() is not using libc strtol/strtoll
strfn=`echo XXX APR_INT64_STRFN | cpp -I./include -I./include/arch/unix -include include/arch/unix/apr_private.h \
| sed -n '/^XXX/{s/XXX //;p;}'`
: APR_INT64_STRFN detected as $strfn
if test "x$strfn" = "x"; then
cat config.log
: configure failed to detect working strtol, bailing.
fi
# 2. Fail if LFS support isn't present in a 32-bit build, since this
# breaks ABI and the soname doesn't change: see #254241
if grep 'define SIZEOF_VOIDP 4' include/apr.h \
&& ! grep off64_t include/apr.h; then
cat config.log
: LFS support not present in 32-bit build
exit 1
fi
--disable-static
%{make_build}
%install
@ -92,9 +70,7 @@ rm -rf $RPM_BUILD_ROOT
%{make_install}
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/aclocal
for f in find_apr.m4 apr_common.m4; do
install -p -m 644 build/$f $RPM_BUILD_ROOT/%{_datadir}/aclocal
done
install -m 644 build/find_apr.m4 $RPM_BUILD_ROOT/%{_datadir}/aclocal
# Trim exported dependecies
sed -ri '/^dependency_libs/{s,-l(uuid|crypt) ,,g}' \
@ -116,33 +92,31 @@ install -c -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/apr-%{aprver}/apr.h
rm -f $RPM_BUILD_ROOT%{_libdir}/apr.exp \
$RPM_BUILD_ROOT%{_libdir}/libapr-*.a
# Additionally packaged (see https://bugzilla.redhat.com/1669589) --
sed -i '1s,/.*,/usr/bin/python3,' build/gen-build.py
for f in build/gen-build.py build/install.sh build/config.*; do
install -c -m755 $f $RPM_BUILD_ROOT%{_libdir}/apr-%{aprver}/build
done
%check
grep ^cross_compiling=no $RPM_BUILD_ROOT%{_bindir}/apr-%{aprver}-config
%if %{with tests}
# Fail if LFS support isn't present in a 32-bit build, since this
# breaks ABI and the soname doesn't change: see #254241
if grep 'define SIZEOF_VOIDP 4' include/apr.h \
&& ! grep off64_t include/apr.h; then
cat config.log
: LFS support not present in 32-bit build
exit 1
fi
pushd test
make %{?_smp_mflags}
./testall -v -q
popd
%endif
%ldconfig_scriptlets
%files
%doc CHANGES LICENSE NOTICE README*
%doc CHANGES LICENSE NOTICE
%{_libdir}/libapr-%{aprver}.so.*
%files devel
%doc docs/APRDesign.html docs/canonical_filenames.html
%doc docs/incomplete_types docs/non_apr_programs
%{_bindir}/apr-%{aprver}-config
%{_libdir}/libapr-%{aprver}.la
%{_libdir}/libapr-%{aprver}.*a
%{_libdir}/libapr-%{aprver}.so
%{_libdir}/pkgconfig/*.pc
%dir %{_libdir}/apr-%{aprver}
@ -153,104 +127,9 @@ popd
%{_datadir}/aclocal/*.m4
%changelog
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Thu Aug 07 2025 Joe Orton <jorton@redhat.com> - 1.7.6-3
- fix APR_TRY_COMPILE_NO_WARNING in apr_common.m4
- add tests bcond
- move configure sanity tests into build section
- fix cross-compilation detection (#2386875)
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Wed May 28 2025 Joe Orton <jorton@redhat.com> - 1.7.6-1
- update to 1.7.6 (#2366842)
* Sat Feb 01 2025 Björn Esser <besser82@fedoraproject.org> - 1.7.5-3
- Add explicit BR: libxcrypt-devel
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Wed Aug 28 2024 Joe Orton <jorton@redhat.com> - 1.7.5-1
- update to 1.7.5 (#2307902)
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Feb 8 2024 Joe Orton <jorton@redhat.com> - 1.7.3-8
- use autosetup
- always disable SCTP support at build time
* Mon Jan 29 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Oct 24 2023 Luboš Uhliarik <luhliari@redhat.com> - 1.7.3-4
- rebuilt
* Fri Sep 29 2023 Luboš Uhliarik <luhliari@redhat.com> - 1.7.3-3
- SPDX migration
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Apr 11 2023 Luboš Uhliarik <luhliari@redhat.com> - 1.7.3-1
- new version 1.7.3
* Fri Feb 10 2023 Luboš Uhliarik <luhliari@redhat.com> - 1.7.2-2
- enable apr_atomic test again
* Thu Feb 02 2023 Luboš Uhliarik <luhliari@redhat.com> - 1.7.2-1
- new version 1.7.2
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Jan 16 2023 Florian Weimer <fweimer@redhat.com> - 1.7.0-20
- Port configure script to C99
* Mon Dec 19 2022 Joe Orton <jorton@redhat.com> - 1.7.0-19
- rebuild
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri May 13 2022 Joe Orton <jorton@redhat.com> - 1.7.0-17
- ship apr_common.m4 in -devel as well
- disable .la file removal
* Fri Jan 28 2022 Joe Orton <jorton@redhat.com> - 1.7.0-16
- disable package notes
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Aug 24 2021 Luboš Uhliarik <luhliari@redhat.com> - 1.7.0-14
* Tue Aug 24 2021 Luboš Uhliarik <luhliari@redhat.com> - 1.7.0-9
- Resolves: #1996685 - add various Coverity/Clang cleanups
* Wed Aug 04 2021 Luboš Uhliarik <luhliari@redhat.com> - 1.7.0-13
- disable sctp protocol support by default
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 18 2021 Joe Orton <jorton@redhat.com> - 1.7.0-11
- package additional build/* files in apr-devel (#1945078)
* Fri Jun 18 2021 Joe Orton <jorton@redhat.com> - 1.7.0-10
- document APR_DEEPBIND and use secure_getenv() (thanks to mturk)
* Mon Apr 12 2021 Lubos Uhliarik <luhliari@redhat.com> - 1.7.0-9
- Resolves: #1942985 - apr: FTBFS with upcoming autoconf-2.71
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

View file

@ -1,53 +0,0 @@
#!/bin/sh -e
if [ $# -lt 1 ]; then
echo "What?"
exit 1
fi
repo="https://svn.apache.org/repos/asf/apr/apr/trunk"
#repo="https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x"
ver=1.7.3
prefix="apr-${ver}"
suffix="r$1${2:++}"
fn="${prefix}-${suffix}.patch"
vcurl="http://svn.apache.org/viewvc?view=revision&revision="
if test -f ${fn}; then
mv -v -f ${fn} ${fn}\~
echo "# $0 $*" > ${fn}
sed '1{/#.*pullrev/d;};/^--- /,$d' < ${fn}\~ >> ${fn}
else
echo "# $0 $*" > ${fn}
fi
new=0
for r in $*; do
if ! grep -q "${vcurl}${r}" ${fn}; then
echo "${vcurl}${r}"
new=1
fi
done >> ${fn}
[ $new -eq 0 ] || echo >> ${fn}
prev=/dev/null
for r in $*; do
echo "+ fetching ${r}"
this=`mktemp /tmp/pullrevXXXXXX`
svn diff -c ${r} ${repo} | filterdiff --remove-timestamps --clean -x 'CHANGES' -x 'next-number' -x 'STATUS' \
--addprefix="${prefix}/" > ${this}
next=`mktemp /tmp/pullrevXXXXXX`
combinediff --quiet ${prev} ${this} > ${next}
rm -f "${this}"
[ "${prev}" = "/dev/null" ] || rm -f "${prev}"
prev=${next}
done
cat ${prev} >> ${fn}
vi "${fn}"
echo "+ git add ${fn}"
git add "${fn}"
echo "+ spec template:"
echo "PatchN: ${fn}"

View file

@ -1 +1 @@
SHA512 (apr-1.7.6.tar.bz2) = 629b60680d1244641828019db903a1b199e8a19c8f27a5132b93faacb381ce561f88463345ab019258f1f1e8cfdf8aa986ac815153a8e7e04a22b3932f9fedd2
SHA512 (apr-1.7.0.tar.bz2) = 3dc42d5caf17aab16f5c154080f020d5aed761e22db4c5f6506917f6bfd2bf8becfb40af919042bd4ce1077d5de74aa666f5edfba7f275efba78e8893c115148