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