[packages] sqlite3: update to v3.6.18
[openwrt/svn-archive/archive.git] / libs / sqlite3 / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=sqlite
11 PKG_VERSION:=3.6.18
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-amalgamation-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.sqlite.org/
16 PKG_MD5SUM:=18c9f044e2f50cdab3bca87386d4fcc8
17
18 PKG_BUILD_DEPENDS:=libncurses libreadline
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/sqlite3/Default
23 SUBMENU:=database
24 TITLE:=SQLite (v3.x) database engine
25 URL:=http://www.sqlite.org/
26 endef
27
28 define Package/sqlite3/Default/description
29 SQLite is a small C library that implements a self-contained, embeddable,
30 zero-configuration SQL database engine.
31 endef
32
33 define Package/libsqlite3
34 $(call Package/sqlite3/Default)
35 SECTION:=libs
36 CATEGORY:=Libraries
37 DEPENDS:=+libpthread
38 TITLE+= (library)
39 endef
40
41 define Package/libsqlite3/description
42 $(call Package/sqlite3/Default/description)
43 This package contains the SQLite (v3.x) shared library, used by other
44 programs.
45 endef
46
47 define Package/sqlite3-cli
48 $(call Package/sqlite3/Default)
49 SECTION:=utils
50 CATEGORY:=Utilities
51 DEPENDS:=+libsqlite3 +libncurses +libreadline
52 TITLE+= (cli)
53 endef
54
55 define Package/sqlite3-cli/description
56 $(call Package/sqlite3/Default/description)
57 This package contains a terminal-based front-end to the SQLite (v3.x) library
58 that can evaluate queries interactively and display the results in multiple
59 formats.
60 endef
61
62 TARGET_CFLAGS += $(FPIC)
63
64 CONFIGURE_ARGS += \
65 --enable-shared \
66 --enable-static \
67
68 CONFIGURE_VARS += \
69 config_BUILD_CC="$(HOSTCC)" \
70 config_BUILD_CFLAGS="-O2" \
71 config_TARGET_CC="$(TARGET_CC)" \
72 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
73 config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
74 config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
75
76 define Build/Compile
77 $(MAKE) -C $(PKG_BUILD_DIR) \
78 DESTDIR="$(PKG_INSTALL_DIR)" \
79 all install
80 endef
81
82 define Build/InstallDev
83 $(INSTALL_DIR) $(1)/usr/include
84 $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3.h $(1)/usr/include/
85 $(INSTALL_DIR) $(1)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
87 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/
89 endef
90
91 define Package/libsqlite3/install
92 $(INSTALL_DIR) $(1)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/
94 endef
95
96 define Package/sqlite3-cli/install
97 $(INSTALL_DIR) $(1)/usr/bin
98 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
99 endef
100
101 $(eval $(call BuildPackage,libsqlite3))
102 $(eval $(call BuildPackage,sqlite3-cli))