fix gmediaserver compile
[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.3.3
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:=eb5d9d7e7853b3af78e767d709b7fced
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 PKG_BUILD_DEPENDS:=libncurses libreadline
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/sqlite3/Default
28 TITLE:=SQLite (v3.x) database engine
29 DESCRIPTION:=\
30 SQLite is a small C library that implements a self-contained, embeddable, \\\
31 zero-configuration SQL database engine.
32 URL:=http://www.sqlite.org/
33 endef
34
35 define Package/libsqlite3
36 $(call Package/sqlite3/Default)
37 SECTION:=libs
38 CATEGORY:=Libraries
39 TITLE+= (library)
40 DESCRIPTION+=\\\
41 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 DESCRIPTION+=\\\
51 \\\
52 This package contains a terminal-based front-end to the SQLite (v3.x) library \\\
53 that can evaluate queries interactively and display the results in \\\
54 multiple formats.
55 endef
56
57 define Build/Configure
58 $(call Build/Configure/Default, \
59 --enable-shared \
60 --enable-static \
61 --disable-tcl \
62 , \
63 config_BUILD_CC="$(HOSTCC)" \
64 config_BUILD_CFLAGS="-O2" \
65 config_TARGET_CC="$(TARGET_CC)" \
66 config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
67 config_TARGET_READLINE_INC="-I$(STAGING_DIR)/usr/include" \
68 config_TARGET_READLINE_LIBS="-L$(STAGING_DIR)/usr/lib -lreadline -lncurses" \
69 )
70 endef
71
72 define Build/Compile
73 $(MAKE) -C $(PKG_BUILD_DIR) \
74 DESTDIR="$(PKG_INSTALL_DIR)" \
75 all install
76 endef
77
78 define Build/InstallDev
79 mkdir -p $(STAGING_DIR)/usr/include
80 $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3.h $(STAGING_DIR)/usr/include/
81 mkdir -p $(STAGING_DIR)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(STAGING_DIR)/usr/lib/
83 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(STAGING_DIR)/usr/lib/pkgconfig/
85 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/sqlite3.pc
86 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/sqlite3.pc
87 endef
88
89 define Build/UninstallDev
90 rm -rf $(STAGING_DIR)/usr/include/sqlite3.h \
91 $(STAGING_DIR)/usr/lib/libsqlite3.{a,so*} \
92 $(STAGING_DIR)/usr/lib/pkgconfig/sqlite3.pc
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 $(CP) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
103 endef
104
105 $(eval $(call BuildPackage,libsqlite3))
106 $(eval $(call BuildPackage,sqlite3-cli))