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.

105 lines
2.6 KiB

  1. #
  2. # Copyright (C) 2009-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:=libdbi-drivers
  9. PKG_VERSION:=0.9.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@SF/libdbi-drivers
  13. PKG_HASH:=43d2eacd573a4faff296fa925dd97fbf2aedbf1ae35c6263478210c61004c854
  14. PKG_LICENSE:=LGPL-2.1
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  17. PKG_FIXUP:=autoreconf
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/libdbi-drivers/default
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. URL:=http://libdbi-drivers.sourceforge.net/
  24. endef
  25. define Package/libdbi-drivers
  26. $(call Package/libdbi-drivers/default)
  27. DEPENDS:=libdbi +libdbd-mysql +libdbd-pgsql +libdbd-sqlite3
  28. TITLE:=Database drivers for libdbi
  29. endef
  30. define Package/libdbd-mysql
  31. $(call Package/libdbi-drivers/default)
  32. DEPENDS:=libdbi +libmysqlclient
  33. TITLE:=MySQL database server driver for libdbi
  34. endef
  35. define Package/libdbd-pgsql
  36. $(call Package/libdbi-drivers/default)
  37. DEPENDS:=libdbi +libpq
  38. TITLE:=PostgreSQL database server driver for libdbi
  39. endef
  40. define Package/libdbd-sqlite3
  41. $(call Package/libdbi-drivers/default)
  42. DEPENDS:=libdbi +libsqlite3
  43. TITLE:=SQLite3 database driver for libdbi
  44. endef
  45. CONFIGURE_ARGS += \
  46. --enable-shared \
  47. --disable-static \
  48. --disable-rpath \
  49. --disable-docs \
  50. --with-dbi-incdir=$(STAGING_DIR)/usr/include \
  51. --with-dbi-libdir=$(STAGING_DIR)/usr/lib
  52. ifneq ($(CONFIG_PACKAGE_libdbd-mysql),)
  53. CONFIGURE_ARGS += \
  54. --with-mysql \
  55. --with-mysql-incdir=$(STAGING_DIR)/usr/include/mysql \
  56. --with-mysql-libdir=$(STAGING_DIR)/usr/lib/mysql
  57. TARGET_LDFLAGS += \
  58. -L$(STAGING_DIR)/usr/lib/mysql/
  59. else
  60. CONFIGURE_ARGS += --without-mysql
  61. endif
  62. ifneq ($(SDK)$(CONFIG_PACKAGE_libdbd-pgsql),)
  63. CONFIGURE_ARGS += \
  64. --with-pgsql \
  65. --with-pgsql-incdir=$(STAGING_DIR)/usr/include \
  66. --with-pgsql-libdir=$(STAGING_DIR)/usr/lib
  67. else
  68. CONFIGURE_ARGS += --without-pgsql
  69. endif
  70. ifneq ($(SDK)$(CONFIG_PACKAGE_libdbd-sqlite3),)
  71. CONFIGURE_ARGS += \
  72. --with-sqlite3 \
  73. --with-sqlite3-incdir=$(STAGING_DIR)/usr/include \
  74. --with-sqlite3-libdir=$(STAGING_DIR)/usr/lib
  75. else
  76. CONFIGURE_ARGS += --without-sqlite3
  77. endif
  78. define BuildPlugin
  79. define Package/libdbd-$(1)/install
  80. $(INSTALL_DIR) $$(1)/usr/lib/dbd
  81. $(CP) $(PKG_INSTALL_DIR)/usr/lib/dbd/libdbd$(1).so $$(1)/usr/lib/dbd/
  82. endef
  83. $$(eval $$(call BuildPackage,libdbd-$(1)))
  84. endef
  85. #$(eval $(call BuildPackage,libdbi-drivers))
  86. $(eval $(call BuildPlugin,mysql))
  87. $(eval $(call BuildPlugin,pgsql))
  88. $(eval $(call BuildPlugin,sqlite3))