1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
#
# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=apr-util
PKG_VERSION:=1.6.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@APACHE/apr/
PKG_HASH:=a41076e3710746326c3945042994ad9a4fcac0ce0277dd8fea076fec3c9772b5
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:apache:apr-util
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
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/libaprutil/Default
SECTION:=libs
CATEGORY:=Libraries
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
## Prevent apu-iconv.m4 to append "/lib" to LDFLAGS if ICONV_PREFIX is empty
ifeq ($(ICONV_PREFIX),)
ICONV_PREFIX=no
endif
CONFIGURE_ARGS += \
--with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
--with-expat="$(STAGING_DIR)/usr" \
--with-iconv="$(ICONV_PREFIX)" \
--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_path_ODBC_CONFIG= \
apu_cv_weak_symbols=yes \
APR_BUILD_DIR="$(STAGING_DIR)/usr/share/build-1"
ifeq ($(CONFIG_USE_GLIBC)$(CONFIG_USE_MUSL),y)
CONFIGURE_VARS += \
apu_cv_explicit_bzero=yes
endif
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
# PKG_CONFIG_DEPENDS trigger configure, but the compile afterward may be
# incomplete if the build directory is not cleaned before. This is not a
# general observation, yet it is valid for apr-util :/
define Build/Compile
$(call Build/Compile/Default,clean all)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 \
$(1)/usr/lib/apr-util-1 $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/bin/apu-1-config $(1)/usr/bin
$(SED) '/^prefix=\|^exec_prefix=/s|/usr|$(STAGING_DIR)/usr|' $(1)/usr/bin/apu-1-config
$(SED) '/^bindir=/s|/usr|$$$${prefix}|' $(1)/usr/bin/apu-1-config
$(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* $(1)/usr/include/apr-1
$(CP) $(PKG_INSTALL_DIR)/usr/lib/apr-util-1/apr_*.{a,so} \
$(1)/usr/lib/apr-util-1 2>/dev/null || :
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.{a,so*} \
$(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc \
$(1)/usr/lib/pkgconfig
$(INSTALL_DIR) $(2)/bin
$(LN) ../../usr/bin/apu-1-config $(2)/bin/apu-1-config
endef
define Package/libaprutil/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.so.* $(1)/usr/lib
endef
$(eval $(call BuildPackage,libaprutil))
$(eval $(call Package/libaprutil/Driver,crypto_openssl,OpenSSL,+libopenssl))
$(eval $(call Package/libaprutil/Driver,dbd_mysql,MySQL,+libmariadb))
$(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))
|