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