diff --git a/.gitignore b/.gitignore index 1ccfca6..283ea79 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ apache-log4cxx-0.10.0.tar.gz +/apache-log4cxx-0.11.0.tar.gz diff --git a/log4cxx-cstring.patch b/log4cxx-cstring.patch deleted file mode 100644 index 4e1b107..0000000 --- a/log4cxx-cstring.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -ur apache-log4cxx-0.10.0.orig/src/examples/cpp/console.cpp apache-log4cxx-0.10.0.new/src/examples/cpp/console.cpp ---- apache-log4cxx-0.10.0.orig/src/examples/cpp/console.cpp 2008-03-31 18:34:52.000000000 -0400 -+++ apache-log4cxx-0.10.0.new/src/examples/cpp/console.cpp 2008-11-16 17:01:37.000000000 -0500 -@@ -22,6 +22,9 @@ - #include - #include - #include -+#include -+#include -+#include - - using namespace log4cxx; - using namespace log4cxx::helpers; -diff -ur apache-log4cxx-0.10.0.orig/src/main/cpp/inputstreamreader.cpp apache-log4cxx-0.10.0.new/src/main/cpp/inputstreamreader.cpp ---- apache-log4cxx-0.10.0.orig/src/main/cpp/inputstreamreader.cpp 2008-03-31 18:34:09.000000000 -0400 -+++ apache-log4cxx-0.10.0.new/src/main/cpp/inputstreamreader.cpp 2008-11-16 16:56:42.000000000 -0500 -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - using namespace log4cxx; - using namespace log4cxx::helpers; -diff -ur apache-log4cxx-0.10.0.orig/src/main/cpp/socketoutputstream.cpp apache-log4cxx-0.10.0.new/src/main/cpp/socketoutputstream.cpp ---- apache-log4cxx-0.10.0.orig/src/main/cpp/socketoutputstream.cpp 2008-03-31 18:34:09.000000000 -0400 -+++ apache-log4cxx-0.10.0.new/src/main/cpp/socketoutputstream.cpp 2008-11-16 16:59:54.000000000 -0500 -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - - using namespace log4cxx; - using namespace log4cxx::helpers; diff --git a/log4cxx-gcc6-tests.patch b/log4cxx-gcc6-tests.patch deleted file mode 100644 index e81b872..0000000 --- a/log4cxx-gcc6-tests.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -ur apache-log4cxx-0.10.0.orig/src/test/cpp/xml/domtestcase.cpp apache-log4cxx-0.10.0.gcc6-tests/src/test/cpp/xml/domtestcase.cpp ---- apache-log4cxx-0.10.0.orig/src/test/cpp/xml/domtestcase.cpp 2008-04-01 00:33:13.000000000 +0200 -+++ apache-log4cxx-0.10.0.gcc6-tests/src/test/cpp/xml/domtestcase.cpp 2016-12-22 13:24:18.277648230 +0100 -@@ -190,12 +190,12 @@ - DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase3.xml")); - LOG4CXX_INFO(logger, "File name is expected to end with a superscript 3"); - #if LOG4CXX_LOGCHAR_IS_UTF8 -- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 }; -+ const unsigned char fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 }; - #else -- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 }; -+ const unsigned char fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 }; - #endif - File file; -- file.setPath(fname); -+ file.setPath((const logchar *)fname); - Pool p; - bool exists = file.exists(p); - LOGUNIT_ASSERT(exists); -@@ -209,12 +209,12 @@ - DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase4.xml")); - LOG4CXX_INFO(logger, "File name is expected to end with an ideographic 4"); - #if LOG4CXX_LOGCHAR_IS_UTF8 -- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 }; -+ const unsigned char fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 }; - #else -- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 }; -+ const unsigned char fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 }; - #endif - File file; -- file.setPath(fname); -+ file.setPath((const logchar *)fname); - Pool p; - bool exists = file.exists(p); - LOGUNIT_ASSERT(exists); diff --git a/log4cxx-gcc6.patch b/log4cxx-gcc6.patch deleted file mode 100644 index cfa0c2f..0000000 --- a/log4cxx-gcc6.patch +++ /dev/null @@ -1,80 +0,0 @@ -Description: Fix FTBFS with GCC6 - GCC6 is more pickier on truncating, so this patch fixes the narrowing conversion errors. -Author: Tobias Frost -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811768 -Forwarded: https://issues.apache.org/jira/browse/LOGCXX-482 -Applied-Upstream: yes, targeted version 0.11.0 -Last-Update: 2016-07-01 (DebCamp16) ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/src/main/cpp/locationinfo.cpp -+++ b/src/main/cpp/locationinfo.cpp -@@ -148,7 +148,7 @@ - if (lineNumber == -1 && fileName == NA && methodName == NA_METHOD) { - os.writeNull(p); - } else { -- char prolog[] = { -+ unsigned char prolog[] = { - 0x72, 0x00, 0x21, 0x6F, 0x72, 0x67, 0x2E, - 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C, - 0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69, -@@ -161,7 +161,7 @@ - 0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67, - 0x2F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B, - 0x78, 0x70 }; -- os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p); -+ os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, (char *)prolog, sizeof(prolog), p); - char* line = p.itoa(lineNumber); - // - // construct Java-like fullInfo (replace "::" with ".") ---- a/src/main/cpp/loggingevent.cpp -+++ b/src/main/cpp/loggingevent.cpp -@@ -236,7 +236,7 @@ - - - void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) { -- char classDesc[] = { -+ unsigned char classDesc[] = { - 0x72, 0x00, 0x21, - 0x6F, 0x72, 0x67, 0x2E, 0x61, 0x70, 0x61, 0x63, - 0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A, -@@ -292,7 +292,7 @@ - 0x3B, 0x78, 0x70 }; - - os.writeProlog("org.apache.log4j.spi.LoggingEvent", -- 8, classDesc, sizeof(classDesc), p); -+ 8, (char *) classDesc, sizeof(classDesc), p); - } - - void LoggingEvent::write(helpers::ObjectOutputStream& os, Pool& p) const { ---- a/src/main/cpp/objectoutputstream.cpp -+++ b/src/main/cpp/objectoutputstream.cpp -@@ -36,8 +36,8 @@ - objectHandle(0x7E0000), - classDescriptions(new ClassDescriptionMap()) - { -- char start[] = { 0xAC, 0xED, 0x00, 0x05 }; -- ByteBuffer buf(start, sizeof(start)); -+ unsigned char start[] = { 0xAC, 0xED, 0x00, 0x05 }; -+ ByteBuffer buf((char*)start, sizeof(start)); - os->write(buf, p); - } - -@@ -81,7 +81,7 @@ - // - // TC_OBJECT and the classDesc for java.util.Hashtable - // -- char prolog[] = { -+ unsigned char prolog[] = { - 0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61, - 0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61, - 0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13, -@@ -90,7 +90,7 @@ - 0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49, - 0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6F, 0x6C, 0x64, 0x78, 0x70 }; -- writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p); -+ writeProlog("java.util.Hashtable", 1, (char *) prolog, sizeof(prolog), p); - // - // loadFactor = 0.75, threshold = 5, blockdata start, buckets.size = 7 - char data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, diff --git a/log4cxx.cmake-configure.patch b/log4cxx.cmake-configure.patch new file mode 100644 index 0000000..9e0864c --- /dev/null +++ b/log4cxx.cmake-configure.patch @@ -0,0 +1,34 @@ +--- apache-log4cxx-0.11.0.orig/CMakeLists.txt 2020-08-09 17:29:25.000000000 +0200 ++++ apache-log4cxx-0.11.0/CMakeLists.txt 2020-10-20 23:35:13.668478104 +0200 +@@ -62,8 +62,12 @@ + "${CMAKE_CURRENT_BINARY_DIR}/liblog4cxx.pc" + ) + ++ set(version ${VERSION}) ++ set(base_dir "${CMAKE_CURRENT_SOURCE_DIR}") ++ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/site/doxy/Doxyfile.in" Doxyfile) ++ + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblog4cxx.pc" +- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + endif(UNIX) + + # Support for find_package(log4cxx) in consuming CMake projects using +@@ -71,7 +75,7 @@ + # target_link_libraries( myApplication PRIVATE log4cxx) + install(EXPORT log4cxxTargets + FILE log4cxxConfig.cmake +- DESTINATION share/cmake/log4cxx ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/log4cxx + ) + # Support for find_package(log4cxx 0.11) in consuming CMake projects + include(CMakePackageConfigHelpers) +@@ -80,7 +84,7 @@ + COMPATIBILITY SameMinorVersion + ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/log4cxxConfigVersion.cmake" +- DESTINATION share/cmake/log4cxx ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/log4cxx + ) + + # diff --git a/log4cxx.spec b/log4cxx.spec index d9bbcbc..931d0ee 100644 --- a/log4cxx.spec +++ b/log4cxx.spec @@ -1,21 +1,18 @@ +%global sover 11 + Name: log4cxx -Version: 0.10.0 -Release: 31%{?dist} +Version: 0.11.0 +Release: 1%{?dist} Summary: A port to C++ of the Log4j project License: ASL 2.0 URL: http://logging.apache.org/log4cxx/index.html Source0: http://www.apache.org/dist/logging/log4cxx/%{version}/apache-%{name}-%{version}.tar.gz -# Filed into upstream bugtracker at: -# https://issues.apache.org/jira/browse/LOGCXX-332 -Patch0: log4cxx-cstring.patch -# From Debian: -# https://anonscm.debian.org/cgit/collab-maint/log4cxx.git/plain/debian/patches/170-gcc6-fix.patch -Patch1: log4cxx-gcc6.patch -Patch2: log4cxx-gcc6-tests.patch +Patch0: log4cxx.cmake-configure.patch BuildRequires: apr-devel BuildRequires: apr-util-devel +BuildRequires: cmake BuildRequires: doxygen BuildRequires: gcc-c++ @@ -42,27 +39,22 @@ Documentation for %{name}. %prep -%setup -q -n apache-%{name}-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%autosetup -n apache-%{name}-%{version} %build -sed -i.libdir_syssearch -e \ - '/sys_lib_dlsearch_path_spec/s|/usr/lib |/usr/lib /usr/lib64 /lib /lib64 |' \ - configure -%configure --disable-static -sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool -%make_build +%cmake +%cmake_build +doxygen %{_vpath_builddir}/Doxyfile %install -make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" -mv $RPM_BUILD_ROOT%{_datadir}/%{name}/html . -rm $RPM_BUILD_ROOT/%{_libdir}/liblog4cxx.la +%cmake_install + +%check +# Tests are flaky, run for informational purposes. +%ctest || true %files -%{_libdir}/liblog4cxx.so.10.0.0 -%{_libdir}/liblog4cxx.so.10 +%{_libdir}/liblog4cxx.so.%{sover}* %doc NOTICE KEYS %license LICENSE @@ -72,12 +64,18 @@ rm $RPM_BUILD_ROOT/%{_libdir}/liblog4cxx.la %{_includedir}/log4cxx %{_libdir}/liblog4cxx.so %{_libdir}/pkgconfig/liblog4cxx.pc +%{_libdir}/cmake/log4cxx %files doc %license LICENSE %doc html/ %changelog +* Sat Oct 17 2020 Till Hofmann - 0.11.0-1 +- Update to 0.11.0 +- Switch to cmake +- Run tests + * Tue Jul 28 2020 Fedora Release Engineering - 0.10.0-31 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 94a5fa0..3b75c7f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b30ffb8da3665178e68940ff7a61084c apache-log4cxx-0.10.0.tar.gz +SHA512 (apache-log4cxx-0.11.0.tar.gz) = f8aa37c9c094e7a4d6ca92dff13c032f69f1e078c51ea55e284fcb931c13256b08950af3ea6eaf7a12282240f6073e9acab19bfe217f88dbd62a5d2360f3fbdd