From 40a29bf0555c522f76e984f6cccb395d84fbe0d2 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Mon, 30 Dec 2019 18:52:50 +0100 Subject: [PATCH 1/5] apr: clean up the package - removes '$(FPIC)' and '--without-pic', there is no good reason for them being used (also @minfrin mentioned memory footprint implications when '--without-pic' is used) - stops removing aclocal.m4 and build/ltmain.sh (reason of removal of these files is not apparent anymore) - adds PKG_BUILD_PARALLEL:=1 Resolves #10884 Signed-off-by: Sebastian Kemper --- libs/apr/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/apr/Makefile b/libs/apr/Makefile index 89fe9d292..acddf3018 100644 --- a/libs/apr/Makefile +++ b/libs/apr/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=apr PKG_VERSION:=1.6.5 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@APACHE/apr/ @@ -18,8 +18,9 @@ PKG_HASH:=a67ca9fcf9c4ff59bce7f428a323c8b5e18667fdea7b0ebad47d194371b0a105 PKG_MAINTAINER:=Thomas Heil PKG_LICENSE:=Apache-2.0 +PKG_BUILD_PARALLEL:=1 + PKG_FIXUP:=autoreconf -PKG_REMOVE_FILES:=aclocal.m4 build/ltmain.sh PKG_INSTALL:=1 @@ -33,10 +34,7 @@ define Package/libapr URL:=https://apr.apache.org/ endef -TARGET_CFLAGS += $(FPIC) - CONFIGURE_ARGS += \ - --without-pic \ --with-devrandom=/dev/urandom \ $(call autoconf_bool,CONFIG_IPV6,ipv6) From 27c47239367f11ad8bc6b5ee19ec4fb78b99d5cf Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Mon, 30 Dec 2019 19:02:16 +0100 Subject: [PATCH 2/5] apr-util: clean up the package - removes extra flags '$(FPIC)' etc., there is no good reason for them being used - stops removing aclocal.m4 and build/ltmain.sh (reason of removal of these files is not apparent anymore) - adds PKG_BUILD_PARALLEL:=1 Signed-off-by: Sebastian Kemper --- libs/apr-util/Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libs/apr-util/Makefile b/libs/apr-util/Makefile index b067359f8..6fe72ed98 100644 --- a/libs/apr-util/Makefile +++ b/libs/apr-util/Makefile @@ -18,8 +18,9 @@ PKG_MAINTAINER:=Thomas Heil PKG_LICENSE:=Apache License PKG_CPE_ID:=cpe:/a:apache:apr-util +PKG_BUILD_PARALLEL:=1 + PKG_FIXUP:=autoreconf -PKG_REMOVE_FILES:=aclocal.m4 build/ltmain.sh PKG_INSTALL:=1 @@ -34,9 +35,6 @@ define Package/libaprutil URL:=http://apr.apache.org/ endef -TARGET_CFLAGS += $(FPIC) -TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE - CONFIGURE_ARGS += \ --with-pgsql=no \ --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \ @@ -55,9 +53,6 @@ CONFIGURE_VARS += \ ac_cv_path_ODBC_CONFIG= \ APR_BUILD_DIR="$(STAGING_DIR)/usr/share/build-1" -MAKE_FLAGS += \ - APRUTIL_LIBS="-lsqlite3 $(TARGET_LDFLAGS) -lexpat $(if $(ICONV_FULL),-liconv) -lapr-1 -luuid -lm -lcrypt" - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1/ $(1)/usr/lib $(1)/usr/lib/pkgconfig/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/apu-1-config \ From 03124bf4b42eab292e92038bd7c4efdee78b23d1 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Mon, 30 Dec 2019 19:06:34 +0100 Subject: [PATCH 3/5] apr-util: allow iconv-stub use Allow iconv-stub use when NLS support is disabled. Signed-off-by: Sebastian Kemper --- libs/apr-util/Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libs/apr-util/Makefile b/libs/apr-util/Makefile index 6fe72ed98..ce80a3643 100644 --- a/libs/apr-util/Makefile +++ b/libs/apr-util/Makefile @@ -39,15 +39,10 @@ CONFIGURE_ARGS += \ --with-pgsql=no \ --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \ --with-expat="$(STAGING_DIR)/usr" \ + --with-iconv="$(ICONV_PREFIX)" \ --without-sqlite2 \ --with-sqlite3="$(STAGING_DIR)/usr" -ifdef $(CONFIG_BUILD_NLS) - CONFIGURE_ARGS += --with-iconv="$(ICONV_PREFIX)" -else - CONFIGURE_ARGS += --without-iconv -endif - CONFIGURE_VARS += \ ac_cv_file_dbd_apr_dbd_mysql_c=no \ ac_cv_path_ODBC_CONFIG= \ From 141bd55316719f11741a578e650aa1895ec68b25 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Mon, 30 Dec 2019 19:12:52 +0100 Subject: [PATCH 4/5] apr-util: add drivers This adds the following drivers as extra packages: - openssl - mysql - odbc - pgsql - sqlite3 - gdbm (dbm) - ldap This also removes the gratuitous dependency on libsqlite3 from libaprutil (dbd_sqlite3 was nevery packaged before, after all). With this ldap and session-crypto support can be enabled in apache. The mysql driver is currently marked BROKEN, because apr-util still uses mysql server headers, which aren't part of mariadb-connector-c. But there's work underway at apr-util upstream to fix that so that BROKEN can be removed during a feature version bump. The gdbm dbm driver got added together with a patch that fixes the error handling. Patch is from Debian. Resolves #10886 Signed-off-by: Sebastian Kemper --- libs/apr-util/Makefile | 102 ++++++++++++++++-- .../patches/002-fix-gdbm-error-handling.patch | 79 ++++++++++++++ 2 files changed, 173 insertions(+), 8 deletions(-) create mode 100644 libs/apr-util/patches/002-fix-gdbm-error-handling.patch diff --git a/libs/apr-util/Makefile b/libs/apr-util/Makefile index ce80a3643..8c95d9252 100644 --- a/libs/apr-util/Makefile +++ b/libs/apr-util/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=apr-util PKG_VERSION:=1.6.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@APACHE/apr/ @@ -20,6 +20,15 @@ PKG_CPE_ID:=cpe:/a:apache:apr-util PKG_BUILD_PARALLEL:=1 +PKG_CONFIG_DEPENDS := \ + CONFIG_PACKAGE_libaprutil-crypto-openssl \ + CONFIG_PACKAGE_libaprutil-dbd-mysql \ + CONFIG_PACKAGE_libaprutil-dbd-odbc \ + CONFIG_PACKAGE_libaprutil-dbd-pgsql \ + CONFIG_PACKAGE_libaprutil-dbd-sqlite3 \ + CONFIG_PACKAGE_libaprutil-dbm-gdbm \ + CONFIG_PACKAGE_libaprutil-ldap + PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -27,33 +36,103 @@ PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk -define Package/libaprutil +define Package/libaprutil/Default SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libapr +libexpat +libsqlite3 +libuuid $(ICONV_DEPENDS) - TITLE:=Apache Portable Runtime Utility Library URL:=http://apr.apache.org/ endef +define Package/libaprutil +$(call Package/libaprutil/Default) + DEPENDS:=+libapr +libexpat +libuuid $(ICONV_DEPENDS) + TITLE:=Apache Portable Runtime Utility Library +endef + CONFIGURE_ARGS += \ - --with-pgsql=no \ --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \ --with-expat="$(STAGING_DIR)/usr" \ --with-iconv="$(ICONV_PREFIX)" \ - --without-sqlite2 \ - --with-sqlite3="$(STAGING_DIR)/usr" + --without-sqlite2 + +ifneq ($(CONFIG_PACKAGE_libaprutil-crypto-openssl),) +CONFIGURE_ARGS += --with-crypto --with-openssl="$(STAGING_DIR)/usr" +else +CONFIGURE_ARGS += --without-crypto +endif + +ifneq ($(CONFIG_PACKAGE_libaprutil-dbd-mysql),) +CONFIGURE_ARGS += --with-mysql="$(STAGING_DIR)/usr" +else +CONFIGURE_ARGS += --without-mysql +endif + +ifneq ($(CONFIG_PACKAGE_libaprutil-dbd-odbc),) +CONFIGURE_ARGS += --with-odbc="$(STAGING_DIR)/usr" +else +CONFIGURE_ARGS += --without-odbc +endif + +ifneq ($(CONFIG_PACKAGE_libaprutil-dbd-pgsql),) +CONFIGURE_ARGS += --with-pgsql="$(STAGING_DIR)/usr" +else +CONFIGURE_ARGS += --without-pgsql +endif + +ifneq ($(CONFIG_PACKAGE_libaprutil-dbd-sqlite3),) +CONFIGURE_ARGS += --with-sqlite3="$(STAGING_DIR)/usr" +else +CONFIGURE_ARGS += --without-sqlite3 +endif + +ifneq ($(CONFIG_PACKAGE_libaprutil-dbm-gdbm),) +CONFIGURE_ARGS += --with-gdbm="$(STAGING_DIR)/usr" +else +CONFIGURE_ARGS += --without-gdbm +endif + +ifneq ($(CONFIG_PACKAGE_libaprutil-ldap),) +CONFIGURE_ARGS += \ + --with-ldap \ + --with-ldap-include="$(STAGING_DIR)/usr/include" \ + --with-ldap-lib="$(STAGING_DIR)/usr/lib" +else +CONFIGURE_ARGS += \ + --without-ldap +endif CONFIGURE_VARS += \ - ac_cv_file_dbd_apr_dbd_mysql_c=no \ ac_cv_path_ODBC_CONFIG= \ APR_BUILD_DIR="$(STAGING_DIR)/usr/share/build-1" +define Package/libaprutil/install/driver + $(INSTALL_DIR) $(1)/usr/lib/apr-util-1 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/apr-util-1/apr_$(2)*.so \ + $(1)/usr/lib/apr-util-1 +endef + +define Package/libaprutil/Driver +define Package/libaprutil-$(subst _,-,$(1)) +$(call Package/libaprutil/Default) + TITLE:=libaprutil - $(2) driver + DEPENDS:=libaprutil $(patsubst +%,+PACKAGE_libaprutil-$(subst _,-,$(1)):%,$(3)) +endef +define Package/libaprutil-$(subst _,-,$(1))/install +$(foreach d,$(1),$(call Package/libaprutil/install/driver,$$(1),$(d));) +endef +$$(eval $$(call BuildPackage,libaprutil-$(subst _,-,$(1)))) +endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1/ $(1)/usr/lib $(1)/usr/lib/pkgconfig/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/apu-1-config \ $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \ $(1)/usr/include/apr-1/ +ifneq ($(CONFIG_PACKAGE_libaprutil-crypto-openssl)$(CONFIG_PACKAGE_libaprutil-dbd-pgsql)$(CONFIG_PACKAGE_libaprutil-dbd-sqlite3)$(CONFIG_PACKAGE_libaprutil-ldap),) + $(INSTALL_DIR) $(1)/usr/lib/apr-util-1 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/apr-util-1/apr_*{la,a,so*} \ + $(1)/usr/lib/apr-util-1 +endif $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.{la,a,so*} \ $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc \ @@ -71,3 +150,10 @@ define Package/libaprutil/install endef $(eval $(call BuildPackage,libaprutil)) +$(eval $(call Package/libaprutil/Driver,crypto_openssl,OpenSSL,+libopenssl)) +$(eval $(call Package/libaprutil/Driver,dbd_mysql,MySQL,+libmariadb @BROKEN)) +$(eval $(call Package/libaprutil/Driver,dbd_odbc,ODBC,+unixodbc)) +$(eval $(call Package/libaprutil/Driver,dbd_pgsql,PostgreSQL,+libpq)) +$(eval $(call Package/libaprutil/Driver,dbd_sqlite3,SQLite3,+libsqlite3)) +$(eval $(call Package/libaprutil/Driver,dbm_gdbm,GDBM dbm,+libgdbm)) +$(eval $(call Package/libaprutil/Driver,ldap,LDAP,+libopenldap)) diff --git a/libs/apr-util/patches/002-fix-gdbm-error-handling.patch b/libs/apr-util/patches/002-fix-gdbm-error-handling.patch new file mode 100644 index 000000000..92a4738e6 --- /dev/null +++ b/libs/apr-util/patches/002-fix-gdbm-error-handling.patch @@ -0,0 +1,79 @@ +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=889170 +# needs to be submitted upstream +--- apr-util.orig/dbm/apr_dbm_gdbm.c ++++ apr-util/dbm/apr_dbm_gdbm.c +@@ -36,13 +36,22 @@ + static apr_status_t g2s(int gerr) + { + if (gerr == -1) { +- /* ### need to fix this */ +- return APR_EGENERAL; ++ return APR_OS_START_USEERR + gdbm_errno; + } + + return APR_SUCCESS; + } + ++static apr_status_t gdat2s(datum d) ++{ ++ if (d.dptr == NULL) { ++ return APR_OS_START_USEERR + gdbm_errno; ++ } ++ ++ return APR_SUCCESS; ++} ++ ++ + static apr_status_t datum_cleanup(void *dptr) + { + if (dptr) +@@ -55,19 +64,15 @@ static apr_status_t set_error(apr_dbm_t + { + apr_status_t rv = APR_SUCCESS; + +- /* ### ignore whatever the DBM said (dbm_said); ask it explicitly */ +- +- if ((dbm->errcode = gdbm_errno) == GDBM_NO_ERROR) { ++ if (dbm_said == APR_SUCCESS) { ++ dbm->errcode = GDBM_NO_ERROR; + dbm->errmsg = NULL; + } + else { ++ dbm->errcode = dbm_said; + dbm->errmsg = gdbm_strerror(gdbm_errno); +- rv = APR_EGENERAL; /* ### need something better */ + } + +- /* captured it. clear it now. */ +- gdbm_errno = GDBM_NO_ERROR; +- + return rv; + } + +@@ -144,7 +149,7 @@ static apr_status_t vt_gdbm_fetch(apr_db + + /* store the error info into DBM, and return a status code. Also, note + that *pvalue should have been cleared on error. */ +- return set_error(dbm, APR_SUCCESS); ++ return set_error(dbm, gdat2s(rd)); + } + + static apr_status_t vt_gdbm_store(apr_dbm_t *dbm, apr_datum_t key, +@@ -203,7 +208,7 @@ static apr_status_t vt_gdbm_firstkey(apr + apr_pool_cleanup_null); + + /* store any error info into DBM, and return a status code. */ +- return set_error(dbm, APR_SUCCESS); ++ return set_error(dbm, gdat2s(rd)); + } + + static apr_status_t vt_gdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) +@@ -223,7 +228,7 @@ static apr_status_t vt_gdbm_nextkey(apr_ + apr_pool_cleanup_null); + + /* store any error info into DBM, and return a status code. */ +- return set_error(dbm, APR_SUCCESS); ++ return set_error(dbm, gdat2s(rd)); + } + + static void vt_gdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data) From 40c7e95210a44bc314f612bc66ef7864de2c09ba Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 12 Jan 2020 21:34:49 +0100 Subject: [PATCH 5/5] apr/apr-util: add myself as maintainer Signed-off-by: Sebastian Kemper --- libs/apr-util/Makefile | 3 ++- libs/apr/Makefile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/apr-util/Makefile b/libs/apr-util/Makefile index 8c95d9252..eb5c79661 100644 --- a/libs/apr-util/Makefile +++ b/libs/apr-util/Makefile @@ -14,7 +14,8 @@ PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@APACHE/apr/ PKG_HASH:=d3e12f7b6ad12687572a3a39475545a072608f4ba03a6ce8a3778f607dd0035b -PKG_MAINTAINER:=Thomas Heil +PKG_MAINTAINER:=Thomas Heil , \ + Sebastian Kemper PKG_LICENSE:=Apache License PKG_CPE_ID:=cpe:/a:apache:apr-util diff --git a/libs/apr/Makefile b/libs/apr/Makefile index acddf3018..b07ae5800 100644 --- a/libs/apr/Makefile +++ b/libs/apr/Makefile @@ -15,7 +15,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@APACHE/apr/ PKG_HASH:=a67ca9fcf9c4ff59bce7f428a323c8b5e18667fdea7b0ebad47d194371b0a105 -PKG_MAINTAINER:=Thomas Heil +PKG_MAINTAINER:=Thomas Heil , \ + Sebastian Kemper PKG_LICENSE:=Apache-2.0 PKG_BUILD_PARALLEL:=1