5cea27b367d0306e7097333a4666ae7c2712bcad
[packages.git] / libs / db / Makefile
1
2 # Copyright (C) 2006 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:=db
12 PKG_VERSION:=4.2.52
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(PKG_VERSION)
16 PKG_SOURCE:=db-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=ftp://ftp.sleepycat.com/releases/ \
18         http://downloads.sleepycat.com/
19 PKG_MD5SUM:=8b5cff6eb83972afdd8e0b821703c33c
20 PKG_CAT:=zcat
21
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/libdb
27   SECTION:=libs
28   CATEGORY:=Libraries
29   DEPENDS:=+libxml2
30   TITLE:=Berkeley DB library
31   DESCRIPTION:=Berkeley DB library.
32   URL:=http://www.sleepycat.com/products/db.shtml
33 endef
34
35 define Build/Configure
36         (cd $(PKG_BUILD_DIR)/build_unix; rm -f config.cache; \
37                 $(TARGET_CONFIGURE_OPTS) \
38                 CFLAGS="$(TARGET_CFLAGS)" \
39                 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
40                 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
41                 ../dist/configure \
42                         --target=$(GNU_TARGET_NAME) \
43                         --host=$(GNU_TARGET_NAME) \
44                         --build=$(GNU_HOST_NAME) \
45                         --program-prefix="" \
46                         --program-suffix="" \
47                         --prefix=/usr \
48                         --exec-prefix=/usr \
49                         --bindir=/usr/bin \
50                         --datadir=/usr/share \
51                         --includedir=/usr/include \
52                         --infodir=/usr/share/info \
53                         --libdir=/usr/lib \
54                         --libexecdir=/usr/lib \
55                         --localstatedir=/var \
56                         --mandir=/usr/share/man \
57                         --sbindir=/usr/sbin \
58                         --sysconfdir=/etc \
59                         $(DISABLE_NLS) \
60                         $(DISABLE_LARGEFILE) \
61                         --enable-shared \
62                         --enable-static \
63                         --disable-java \
64                         --enable-cxx \
65                         --disable-posixmutexes \
66                         --disable-uimutexes \
67                         --disable-tcl \
68                         --disable-rpc \
69                         --enable-compat185 \
70                         --enable-debug \
71                         --enable-statistics \
72                         --enable-replication \
73                         --enable-cryptography \
74         );
75 endef
76
77 define Build/Compile
78         rm -rf $(PKG_INSTALL_DIR)
79         mkdir -p $(PKG_INSTALL_DIR)
80         $(MAKE) -C $(PKG_BUILD_DIR)/build_unix \
81                 DESTDIR="$(PKG_INSTALL_DIR)" install
82 endef
83
84 define Package/libdb/install
85         $(INSTALL_DIR) $(1)/usr/lib
86         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb-*.so $(1)/usr/lib/
87 endef
88
89 define Build/InstallDev
90         mkdir -p $(1)/usr/include
91         $(CP) $(PKG_INSTALL_DIR)/usr/include/db.h $(1)/usr/include/
92         mkdir -p $(1)/usr/lib
93         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb*.{a,so} $(1)/usr/lib/
94 endef
95
96 define Build/UninstallDev
97         rm -rf \
98                 $(STAGING_DIR)/usr/include/db.h \
99                 $(STAGING_DIR)/usr/lib/libdb*.{a,so}
100 endef
101
102 $(eval $(call BuildPackage,libdb))