berkeley db4, for openldap server
[openwrt/svn-archive/archive.git] / openwrt / package / libdb / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=libdb
6 PKG_VERSION:=4.3.28
7 PKG_RELEASE:=0
8 PKG_MD5SUM:=e27759537db6054b31d8cb3e99ba6fbb
9
10 PKG_SOURCE_URL:=ftp://ftp.sleepycat.com/releases/ \
11 http://downloads.sleepycat.com/
12 PKG_SOURCE:=db-$(PKG_VERSION).tar.gz
13 PKG_CAT:=zcat
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(PKG_VERSION)
16 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
17
18 include $(TOPDIR)/package/rules.mk
19
20 $(eval $(call PKG_template,LIBDB,libdb,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
21
22 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
23 (cd $(PKG_BUILD_DIR)/build_unix ; \
24 $(TARGET_CONFIGURE_OPTS) \
25 CFLAGS="$(TARGET_CFLAGS)" \
26 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
27 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
28 ../dist/configure \
29 --target=$(GNU_TARGET_NAME) \
30 --host=$(GNU_TARGET_NAME) \
31 --build=$(GNU_HOST_NAME) \
32 --program-prefix="" \
33 --program-suffix="" \
34 --prefix=/usr \
35 --exec-prefix=/usr \
36 --bindir=/usr/bin \
37 --datadir=/usr/share \
38 --includedir=/usr/include \
39 --infodir=/usr/share/info \
40 --libdir=/usr/lib \
41 --libexecdir=/usr/lib \
42 --localstatedir=/var \
43 --mandir=/usr/share/man \
44 --sbindir=/usr/sbin \
45 --sysconfdir=/etc \
46 $(DISABLE_NLS) \
47 $(DISABLE_LARGEFILE) \
48 --enable-shared \
49 --enable-static \
50 --disable-java \
51 --disable-cxx \
52 --disable-tcl \
53 --disable-rpc \
54 --disable-compat185 \
55 --disable-debug \
56 --disable-statistics \
57 --disable-replication \
58 --disable-cryptography \
59 --enable-smallbuild \
60 );
61 touch $@
62
63 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
64 rm -rf $(PKG_INSTALL_DIR)
65 mkdir -p $(PKG_INSTALL_DIR)
66 $(MAKE) -C $(PKG_BUILD_DIR)/build_unix \
67 DESTDIR="$(PKG_INSTALL_DIR)" install
68 touch $@
69
70 $(IPKG_LIBDB): $(STAGING_DIR)/usr/lib/libdb.so
71 install -m0755 -d $(IDIR_LIBDB)/usr/lib
72 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libdb*.so $(IDIR_LIBDB)/usr/lib/
73 $(RSTRIP) $(IDIR_LIBDB)
74 $(IPKG_BUILD) $(IDIR_LIBDB) $(PACKAGE_DIR)
75
76 $(STAGING_DIR)/usr/lib/libdb.so: $(PKG_BUILD_DIR)/.built
77 mkdir -p $(STAGING_DIR)/usr/include
78 cp -fpR $(PKG_INSTALL_DIR)/usr/include/db.h $(STAGING_DIR)/usr/include/
79 mkdir -p $(STAGING_DIR)/usr/lib
80 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libdb*.{a,so} $(STAGING_DIR)/usr/lib/
81 touch $(STAGING_DIR)/usr/lib/libdb.so
82
83 install-dev: $(STAGING_DIR)/usr/lib/libdb.so
84
85 uninstall-dev:
86 rm -rf $(STAGING_DIR)/usr/include/db.h
87 rm -rf $(STAGING_DIR)/usr/lib/libdb*.{a,so}
88
89 compile: install-dev
90 clean: uninstall-dev