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