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.

106 lines
2.8 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:=3120200
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.sqlite.org/2016/
  13. PKG_MD5SUM:=c552a133aca1ce1d647163d9e43bbcb1
  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 \
  58. CONFIGURE_ARGS += \
  59. --enable-shared \
  60. --enable-static \
  61. CONFIGURE_VARS += \
  62. config_BUILD_CC="$(HOSTCC)" \
  63. config_BUILD_CFLAGS="-O2" \
  64. config_TARGET_CC="$(TARGET_CC)" \
  65. config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
  66. config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
  67. config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
  68. define Build/InstallDev
  69. $(INSTALL_DIR) $(1)/usr/include
  70. $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3{,ext}.h $(1)/usr/include/
  71. $(INSTALL_DIR) $(1)/usr/lib
  72. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
  73. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  74. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/
  75. endef
  76. define Package/libsqlite3/install
  77. $(INSTALL_DIR) $(1)/usr/lib
  78. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/
  79. endef
  80. define Package/sqlite3-cli/install
  81. $(INSTALL_DIR) $(1)/usr/bin
  82. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
  83. endef
  84. $(eval $(call BuildPackage,libsqlite3))
  85. $(eval $(call BuildPackage,sqlite3-cli))