nuke $Id$ in /packages as well
[packages.git] / libs / apr / Makefile
1 #
2 # Copyright (C) 2007-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=apr
11 PKG_VERSION:=1.2.9
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://apache.d-s-s-p.de/apr/
16 PKG_MD5SUM:=6f4b063ac01a54ba0818c31280f06959
17
18 PKG_FIXUP = libtool
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/libapr
23   SECTION:=libs
24   CATEGORY:=Libraries
25   DEPENDS:=+libpthread
26   TITLE:=Apache Portable Runtime Library
27   URL:=http://apr.apache.org/
28 endef
29
30 TARGET_CFLAGS += $(FPIC)
31 CONFIGURE_ARGS += \
32         --with-devrandom=/dev/urandom \
33         --disable-dso \
34         --enable-ipv6
35
36 CONFIGURE_VARS += \
37         apr_cv_process_shared_works=no \
38         apr_cv_mutex_robust_shared=no \
39         apr_cv_tcp_nodelay_with_cork=yes \
40         LDFLAGS="$$$$LDFLAGS -lpthread" \
41
42 define Build/Compile
43         $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
44 endef
45
46 define Build/InstallDev
47         $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 $(1)/usr/lib $(1)/usr/lib/pkgconfig $(1)/usr/share/build-1
48         $(CP)   $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \
49                 $(1)/usr/bin/
50         $(CP)   $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
51                 $(1)/usr/include/apr-1/
52         $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{la,a,so*} \
53                 $(1)/usr/lib/
54         $(CP)   $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \
55                 $(1)/usr/lib/pkgconfig/
56         $(CP)   $(PKG_INSTALL_DIR)/usr/share/build-1/* \
57                 $(1)/usr/share/build-1/
58         $(SED) 's,^datadir=\"/usr/share\",datadir=\"$(STAGING_DIR)/usr/share\",g' $(1)/usr/bin/apr-1-config
59         $(SED) 's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\",g' $(1)/usr/bin/apr-1-config
60         $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/apr-1-config
61         $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/apr-1-config
62         $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apr-1-config
63         $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apr-1-config
64         $(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' $(1)/usr/share/build-1/apr_rules.mk
65 endef
66
67 define Package/libapr/install
68         $(INSTALL_DIR) $(1)/usr/lib
69         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib/
70 endef
71
72 $(eval $(call BuildPackage,libapr))