You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.9 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=sqlite
  9. PKG_VERSION:=3170000
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.sqlite.org/2017/
  13. PKG_MD5SUM:=450a95a7bde697c9fe4de9ae2fffdcca
  14. PKG_HASH:=a4e485ad3a16e054765baf6371826b5000beed07e626510896069c0bf013874c
  15. PKG_LICENSE:=PUBLICDOMAIN
  16. PKG_LICENSE_FILES:=
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-autoconf-$(PKG_VERSION)
  18. PKG_BUILD_DEPENDS:=libncurses libreadline
  19. PKG_FIXUP:=autoreconf
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/sqlite3/Default
  23. SUBMENU:=database
  24. TITLE:=SQLite (v3.x) database engine
  25. URL:=http://www.sqlite.org/
  26. MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
  27. endef
  28. define Package/sqlite3/Default/description
  29. SQLite is a small C library that implements a self-contained, embeddable,
  30. zero-configuration SQL database engine.
  31. endef
  32. define Package/libsqlite3
  33. $(call Package/sqlite3/Default)
  34. SECTION:=libs
  35. CATEGORY:=Libraries
  36. DEPENDS:=+libpthread
  37. TITLE+= (library)
  38. endef
  39. define Package/libsqlite3/description
  40. $(call Package/sqlite3/Default/description)
  41. This package contains the SQLite (v3.x) shared library, used by other
  42. programs.
  43. endef
  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. define Package/sqlite3-cli/description
  52. $(call Package/sqlite3/Default/description)
  53. This package contains a terminal-based front-end to the SQLite (v3.x) library
  54. that can evaluate queries interactively and display the results in multiple
  55. formats.
  56. endef
  57. TARGET_CFLAGS += $(FPIC) \
  58. -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
  59. -DHAVE_ISNAN=1 \
  60. -DHAVE_MALLOC_USABLE_SIZE=1
  61. CONFIGURE_ARGS += \
  62. --enable-shared \
  63. --enable-static \
  64. --disable-editline
  65. CONFIGURE_VARS += \
  66. config_BUILD_CC="$(HOSTCC)" \
  67. config_BUILD_CFLAGS="-O2" \
  68. config_TARGET_CC="$(TARGET_CC)" \
  69. config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
  70. config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
  71. config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
  72. define Build/InstallDev
  73. $(INSTALL_DIR) $(1)/usr/include
  74. $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3{,ext}.h $(1)/usr/include/
  75. $(INSTALL_DIR) $(1)/usr/lib
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
  77. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  78. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/
  79. endef
  80. define Package/libsqlite3/install
  81. $(INSTALL_DIR) $(1)/usr/lib
  82. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/
  83. endef
  84. define Package/sqlite3-cli/install
  85. $(INSTALL_DIR) $(1)/usr/bin
  86. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
  87. endef
  88. $(eval $(call BuildPackage,libsqlite3))
  89. $(eval $(call BuildPackage,sqlite3-cli))