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