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.

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