44a90fdce9e11c27e5da0db06f9a4e656d758274
[openwrt/svn-archive/archive.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 TITLE:=SQLite (v2.x) database engine
26 URL:=http://www.sqlite.org/
27 endef
28
29 define Package/libsqlite2
30 $(call Package/sqlite2/Default)
31 SECTION:=libs
32 CATEGORY:=Libraries
33 TITLE+= (library)
34 endef
35
36 define Package/libsqlite2/description
37 =
38 SQLite is a small C library that implements a self-contained, embeddable,
39 zero-configuration SQL database engine.
40 This package contains the SQLite (v2.x) shared library, used by other programs.
41 endef
42
43 define Package/sqlite2-cli
44 $(call Package/sqlite2/Default)
45 SECTION:=utils
46 CATEGORY:=Utilities
47 DEPENDS:=+libsqlite2 +libncurses +libreadline
48 TITLE+= (cli)
49 SUBMENU:=database
50 endef
51
52 define Package/sqlite2-cli/description
53 =
54 SQLite is a small C library that implements a self-contained, embeddable,
55 zero-configuration SQL database engine.
56 This package contains a terminal-based front-end to the SQLite (v2.x) library
57 that can evaluate queries interactively and display the results in
58 multiple formats.
59 endef
60
61 define Build/Configure
62 $(call Build/Configure/Default, \
63 --enable-shared \
64 --enable-static \
65 , \
66 config_BUILD_CC="$(HOSTCC)" \
67 config_BUILD_CFLAGS="-O2" \
68 config_TARGET_CC="$(TARGET_CC)" \
69 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
70 config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
71 config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
72 config_TARGET_TCL_INC="-DNO_TCL=1" \
73 )
74 endef
75
76 TARGET_CFLAGS += $(FPIC)
77
78 define Build/Compile
79 $(MAKE) -C $(PKG_BUILD_DIR) \
80 DESTDIR="$(PKG_INSTALL_DIR)" \
81 all install
82 endef
83
84 define Build/InstallDev
85 mkdir -p $(1)/usr/include
86 $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite.h $(1)/usr/include/
87 mkdir -p $(1)/usr/lib
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.{a,so*} $(1)/usr/lib/
89 mkdir -p $(1)/usr/lib/pkgconfig
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite.pc $(1)/usr/lib/pkgconfig/
91 endef
92
93 define Package/libsqlite2/install
94 $(INSTALL_DIR) $(1)/usr/lib
95 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.so.* $(1)/usr/lib/
96 endef
97
98 define Package/sqlite2-cli/install
99 $(INSTALL_DIR) $(1)/usr/bin
100 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite $(1)/usr/bin/
101 endef
102
103 $(eval $(call BuildPackage,libsqlite2))
104 $(eval $(call BuildPackage,sqlite2-cli))