36ecd83c2cc3bb358d7f415077ad005bb963e53b
[openwrt/svn-archive/archive.git] / libs / sqlite3 / 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:=sqlite
12 PKG_VERSION:=3.4.2
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.sqlite.org/
17 PKG_MD5SUM:=2feec9b429f9298c9f288420c8b449f8
18
19 PKG_BUILD_DEPENDS:=libncurses libreadline
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/sqlite3/Default
24 TITLE:=SQLite (v3.x) database engine
25 URL:=http://www.sqlite.org/
26 SUBMENU:=database
27 endef
28
29 define Package/libsqlite3
30 $(call Package/sqlite3/Default)
31 SECTION:=libs
32 CATEGORY:=Libraries
33 TITLE+= (library)
34 endef
35
36 define Package/libsqlite3/description
37 =
38 SQLite is a small C library that implements a self-contained, embeddable,
39 zero-configuration SQL database engine. This package contains the SQLite (v3.x) shared library, used by other programs.
40 endef
41
42 define Package/sqlite3-cli
43 $(call Package/sqlite3/Default)
44 SECTION:=utils
45 CATEGORY:=Utilities
46 DEPENDS:=+libsqlite3 +libncurses +libreadline
47 TITLE+= (cli)
48 endef
49
50 define Package/sqlite3-cli/description
51 =
52 SQLite is a small C library that implements a self-contained, embeddable,
53 zero-configuration SQL database engine.
54 This package contains a terminal-based front-end to the SQLite (v3.x) library
55 that can evaluate queries interactively and display the results in
56 multiple formats.
57 endef
58
59 TARGET_CFLAGS += $(FPIC)
60
61 define Build/Configure
62 $(call Build/Configure/Default, \
63 --enable-shared \
64 --enable-static \
65 --disable-tcl \
66 , \
67 config_BUILD_CC="$(HOSTCC)" \
68 config_BUILD_CFLAGS="-O2" \
69 config_TARGET_CC="$(TARGET_CC)" \
70 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
71 config_TARGET_READLINE_INC="-I$(STAGING_DIR)/usr/include" \
72 config_TARGET_READLINE_LIBS="-L$(STAGING_DIR)/usr/lib -lreadline -lncurses" \
73 )
74 endef
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 mkdir -p $(1)/usr/include
84 $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3.h $(1)/usr/include/
85 mkdir -p $(1)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
87 mkdir -p $(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))