[packages] apr-util: rename from apr-util to libaprutil, add libtool fixes, cleanup
[openwrt/svn-archive/archive.git] / utils / apr-util / Makefile
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=apr-util
12 PKG_VERSION:=1.2.8
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://apache.autinity.de/apr/
17 PKG_MD5SUM:=a2e2e54d65e9eae961f7171335cf2550
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libaprutil
22 SECTION:=libs
23 CATEGORY:=Libraries
24 DEPENDS:=+libapr +libexpat +libiconv +libpthread +libsqlite3
25 TITLE:=Apache Portable Runtime Utility Library
26 URL:=http://apr.apache.org/
27 endef
28
29
30 CONFIGURE_ARGS += \
31 --with-pgsql=no \
32 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
33 --with-expat="$(STAGING_DIR)/usr" \
34 --without-sqlite2 \
35 --with-sqlite3="$(STAGING_DIR)/usr" \
36 --with-iconv="$(STAGING_DIR)/usr/lib/libiconv" \
37
38 CONFIGURE_VARS += \
39 ac_cv_file_dbd_apr_dbd_mysql_c=no \
40 APR_BUILD_DIR="$(STAGING_DIR)/usr/share/build-1" \
41
42 define Build/Configure
43 $(call Build/Configure/Default)
44 $(call libtool_disable_rpath)
45 endef
46
47 define Build/Compile
48 $(MAKE) -C $(PKG_BUILD_DIR) all
49 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
50 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
51 endef
52
53 define Build/InstallDev
54 mkdir -p $(1)/usr/bin
55 $(CP) $(PKG_INSTALL_DIR)/usr/bin/apu-1-config \
56 $(1)/usr/bin
57 mkdir -p $(1)/usr/include/apr-1/
58 $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
59 $(1)/usr/include/apr-1/
60 mkdir -p $(1)/usr/lib
61 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.{a,so*} \
62 $(1)/usr/lib/
63 mkdir -p $(1)/usr/lib/pkgconfig/
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc \
65 $(1)/usr/lib/pkgconfig/
66 $(SED) 's, -e \"s -I$$$$prefix/lib g\",,g' $(1)/usr/bin/apu-1-config
67 $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(1)/usr/include/,g' $(1)/usr/bin/apu-1-config
68 $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apu-1-config
69 $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apu-1-config
70 endef
71
72 define Build/UninstallDev
73 rm -rf $(STAGING_DIR)/usr/bin/apu-1-config \
74 $(STAGING_DIR)/usr/include/apr-1 \
75 $(STAGING_DIR)/usr/lib/libaprutil-1.{a,so*} \
76 $(STAGING_DIR)/usr/lib/pkgconfig/apr-util-1.pc
77 endef
78
79 define Package/libaprutil/install
80 $(INSTALL_DIR) $(1)/usr/lib
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.so.* $(1)/usr/lib/
82 endef
83
84 $(eval $(call BuildPackage,libaprutil))