remove PKG_CAT from packages
[openwrt/svn-archive/archive.git] / libs / sqlite3 / 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:=sqlite
12 PKG_VERSION:=3.4.2
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.sqlite.org/
17 PKG_MD5SUM:=2feec9b429f9298c9f288420c8b449f8
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(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/sqlite3/Default
27 TITLE:=SQLite (v3.x) database engine
28 URL:=http://www.sqlite.org/
29 endef
30
31 define Package/libsqlite3
32 $(call Package/sqlite3/Default)
33 SECTION:=libs
34 CATEGORY:=Libraries
35 TITLE+= (library)
36 endef
37
38 define Package/libsqlite3/description
39 =
40 SQLite is a small C library that implements a self-contained, embeddable,
41 zero-configuration SQL database engine. This package contains the SQLite (v3.x) shared library, used by other programs.
42 endef
43
44 define Package/sqlite3-cli
45 $(call Package/sqlite3/Default)
46 SECTION:=utils
47 CATEGORY:=Utilities
48 DEPENDS:=+libsqlite3 +libncurses +libreadline
49 TITLE+= (cli)
50 endef
51
52 define Package/sqlite3-cli/description
53 =
54 SQLite is a small C library that implements a self-contained, embeddable,
55 zero-configuration SQL database engine.
56 This package contains a terminal-based front-end to the SQLite (v3.x) library
57 that can evaluate queries interactively and display the results in
58 multiple formats.
59 endef
60
61 define Build/Configure
62 $(call Build/Configure/Default, \
63 --enable-shared \
64 --enable-static \
65 --disable-tcl \
66 , \
67 config_BUILD_CC="$(HOSTCC)" \
68 config_BUILD_CFLAGS="-O2" \
69 config_TARGET_CC="$(TARGET_CC)" \
70 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
71 config_TARGET_READLINE_INC="-I$(STAGING_DIR)/usr/include" \
72 config_TARGET_READLINE_LIBS="-L$(STAGING_DIR)/usr/lib -lreadline -lncurses" \
73 )
74 endef
75
76 define Build/Compile
77 $(MAKE) -C $(PKG_BUILD_DIR) \
78 DESTDIR="$(PKG_INSTALL_DIR)" \
79 all install
80 endef
81
82 define Build/InstallDev
83 mkdir -p $(1)/usr/include
84 $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3.h $(1)/usr/include/
85 mkdir -p $(1)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
87 mkdir -p $(1)/usr/lib/pkgconfig
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/
89 endef
90
91 define Build/UninstallDev
92 rm -rf $(STAGING_DIR)/usr/include/sqlite3.h \
93 $(STAGING_DIR)/usr/lib/libsqlite3.{a,so*} \
94 $(STAGING_DIR)/usr/lib/pkgconfig/sqlite3.pc
95 endef
96
97 define Package/libsqlite3/install
98 $(INSTALL_DIR) $(1)/usr/lib
99 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/
100 endef
101
102 define Package/sqlite3-cli/install
103 $(INSTALL_DIR) $(1)/usr/bin
104 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
105 endef
106
107 $(eval $(call BuildPackage,libsqlite3))
108 $(eval $(call BuildPackage,sqlite3-cli))