more package submenus
[openwrt/svn-archive/archive.git] / libs / sqlite2 / 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:=sqlite2
12 PKG_VERSION:=2.8.17
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=sqlite-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.sqlite.org/
17 PKG_MD5SUM:=838dbac20b56d2c4292e98848505a05b
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/sqlite-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 PKG_BUILD_DEPENDS:=libncurses libreadline
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/sqlite2/Default
27 TITLE:=SQLite (v2.x) database engine
28 URL:=http://www.sqlite.org/
29 endef
30
31 define Package/libsqlite2
32 $(call Package/sqlite2/Default)
33 SECTION:=libs
34 CATEGORY:=Libraries
35 TITLE+= (library)
36 endef
37
38 define Package/libsqlite2/description
39 =
40 SQLite is a small C library that implements a self-contained, embeddable,
41 zero-configuration SQL database engine.
42 This package contains the SQLite (v2.x) shared library, used by other programs.
43 endef
44
45 define Package/sqlite2-cli
46 $(call Package/sqlite2/Default)
47 SECTION:=utils
48 CATEGORY:=Utilities
49 DEPENDS:=+libsqlite2 +libncurses +libreadline
50 TITLE+= (cli)
51 SUBMENU:=database
52 endef
53
54 define Package/sqlite2-cli/description
55 =
56 SQLite is a small C library that implements a self-contained, embeddable,
57 zero-configuration SQL database engine.
58 This package contains a terminal-based front-end to the SQLite (v2.x) library
59 that can evaluate queries interactively and display the results in
60 multiple formats.
61 endef
62
63 define Build/Configure
64 $(call Build/Configure/Default, \
65 --enable-shared \
66 --enable-static \
67 , \
68 config_BUILD_CC="$(HOSTCC)" \
69 config_BUILD_CFLAGS="-O2" \
70 config_TARGET_CC="$(TARGET_CC)" \
71 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
72 config_TARGET_READLINE_INC="-I$(STAGING_DIR)/usr/include" \
73 config_TARGET_READLINE_LIBS="-L$(STAGING_DIR)/usr/lib -lreadline -lncurses" \
74 config_TARGET_TCL_INC="-DNO_TCL=1" \
75 )
76 endef
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 Build/UninstallDev
94 rm -rf $(STAGING_DIR)/usr/include/sqlite.h \
95 $(STAGING_DIR)/usr/lib/libsqlite.{a,so*} \
96 $(STAGING_DIR)/usr/lib/pkgconfig/sqlite.pc
97 endef
98
99 define Package/libsqlite2/install
100 $(INSTALL_DIR) $(1)/usr/lib
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.so.* $(1)/usr/lib/
102 endef
103
104 define Package/sqlite2-cli/install
105 $(INSTALL_DIR) $(1)/usr/bin
106 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sqlite $(1)/usr/bin/
107 endef
108
109 $(eval $(call BuildPackage,libsqlite2))
110 $(eval $(call BuildPackage,sqlite2-cli))