[packages] Use default templates instead of custom reimplementations where applicable
[openwrt/svn-archive/archive.git] / libs / sqlite2 / Makefile
1 #
2 # Copyright (C) 2006-2010 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 PKG_INSTALL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24
25 TARGET_CFLAGS += $(FPIC)
26
27 define Package/sqlite2/Default
28 SUBMENU:=database
29 TITLE:=SQLite (v2.x) database engine
30 URL:=http://www.sqlite.org/
31 endef
32
33 define Package/libsqlite2
34 $(call Package/sqlite2/Default)
35 SECTION:=libs
36 CATEGORY:=Libraries
37 TITLE+= (library)
38 endef
39
40 define Package/libsqlite2/description
41 SQLite is a small C library that implements a self-contained, embeddable,
42 zero-configuration SQL database engine.
43 This package contains the SQLite (v2.x) shared library, used by other programs.
44 endef
45
46 define Package/sqlite2-cli
47 $(call Package/sqlite2/Default)
48 SECTION:=utils
49 CATEGORY:=Utilities
50 DEPENDS:=+libsqlite2 +libncurses +libreadline
51 TITLE+= (cli)
52 SUBMENU:=database
53 endef
54
55 define Package/sqlite2-cli/description
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="$(TARGET_CPPFLAGS)" \
73 config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
74 config_TARGET_TCL_INC="-DNO_TCL=1" \
75 )
76 endef
77
78 define Build/InstallDev
79 $(INSTALL_DIR) $(1)/usr/include
80 $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite.h $(1)/usr/include/
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.{a,so*} $(1)/usr/lib/
83 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite.pc $(1)/usr/lib/pkgconfig/
85 endef
86
87 define Package/libsqlite2/install
88 $(INSTALL_DIR) $(1)/usr/lib
89 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite.so.* $(1)/usr/lib/
90 endef
91
92 define Package/sqlite2-cli/install
93 $(INSTALL_DIR) $(1)/usr/bin
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite $(1)/usr/bin/
95 endef
96
97 $(eval $(call BuildPackage,libsqlite2))
98 $(eval $(call BuildPackage,sqlite2-cli))