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.

117 lines
2.9 KiB

  1. #
  2. # Copyright (C) 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:=unixodbc
  9. PKG_VERSION:=2.3.4
  10. PKG_RELEASE:=2
  11. PKG_SOURCE_URL:=ftp://ftp.unixodbc.org/pub/unixODBC/
  12. PKG_SOURCE:=unixODBC-$(PKG_VERSION).tar.gz
  13. PKG_MD5SUM:=bd25d261ca1808c947cb687e2034be81
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/unixODBC-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
  16. PKG_LICENSE:=prog GPL libs LGPL
  17. include $(INCLUDE_DIR)/package.mk
  18. CONFIGURE_ARGS += \
  19. --disable-gui \
  20. --with-pic \
  21. --enable-drivers
  22. define Package/unixodbc/Default
  23. SUBMENU:=database
  24. TITLE:=unixODBC
  25. URL:=http://www.unixodbc.org/
  26. endef
  27. define Package/unixodbc
  28. $(call Package/unixodbc/Default)
  29. TITLE+= (libraries)
  30. SECTION:=libs
  31. CATEGORY:=Libraries
  32. DEPENDS:=+libltdl +libpthread
  33. endef
  34. define Package/unixodbc/description
  35. unixODBC is an Open Source ODBC sub-system and an ODBC SDK for Linux,
  36. Mac OSX, and UNIX.
  37. endef
  38. define Package/unixodbc-tools
  39. $(call Package/unixodbc/Default)
  40. SECTION:=utils
  41. CATEGORY:=Utilities
  42. TITLE+= Tools
  43. DEPENDS:=+unixodbc +libncurses +libreadline
  44. endef
  45. define Package/unixodbc-tools/description
  46. Command Line Tools to help install a driver and work with SQL.
  47. endef
  48. define Package/pgsqlodbc
  49. $(call Package/unixodbc/Default)
  50. SECTION:=libs
  51. CATEGORY:=Libraries
  52. TITLE:=Postgresql driver for ODBC
  53. DEPENDS:=+unixodbc +libpq
  54. endef
  55. define Package/pgsqlodbc/description
  56. Postgresql driver for ODBC.
  57. endef
  58. define Build/Compile
  59. $(MAKE) -C $(PKG_BUILD_DIR) \
  60. DESTDIR="$(PKG_INSTALL_DIR)" \
  61. $(MAKE_FLAGS) \
  62. ARCH="$(ARCH)" \
  63. CC="$(TARGET_CC)"
  64. $(MAKE) -C $(PKG_BUILD_DIR) \
  65. DESTDIR="$(PKG_INSTALL_DIR)" \
  66. $(MAKE_FLAGS) \
  67. ARCH="$(ARCH)" \
  68. install -i
  69. endef
  70. define Build/InstallDev
  71. $(INSTALL_DIR) $(1)/usr/bin
  72. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  73. $(INSTALL_DIR) $(1)/usr/include
  74. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  75. $(INSTALL_DIR) $(1)/usr/lib
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  77. $(INSTALL_DIR) $(1)/etc
  78. $(CP) $(PKG_INSTALL_DIR)/etc/odbc* $(1)/etc/
  79. $(INSTALL_DIR) $(1)/etc/ODBCDataSources
  80. $(TARGET_CC) $(TARGET_CFLAGS) -E ./files/unixodbc_conf.h | tr '@' '\#' >$(1)/usr/include/unixodbc_conf.h
  81. endef
  82. define Package/unixodbc/install
  83. $(INSTALL_DIR) $(1)/usr/lib
  84. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbc[ci]*so* $(1)/usr/lib/
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbc.*so* $(1)/usr/lib/
  86. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnn*so* $(1)/usr/lib/
  87. $(INSTALL_DIR) $(1)/etc
  88. $(CP) $(PKG_INSTALL_DIR)/etc/odbc* $(1)/etc/
  89. endef
  90. define Package/unixodbc-tools/install
  91. $(INSTALL_DIR) $(1)/usr/bin
  92. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  93. endef
  94. define Package/pgsqlodbc/install
  95. $(INSTALL_DIR) $(1)/usr/lib
  96. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbcpsql*so* $(1)/usr/lib/
  97. endef
  98. $(eval $(call BuildPackage,unixodbc))
  99. $(eval $(call BuildPackage,unixodbc-tools))
  100. $(eval $(call BuildPackage,pgsqlodbc))