| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # This is free software, licensed under the GNU General Public License v2. |
| 2 | # See /LICENSE for more information. |
| 3 | # |
| 4 | |
| 5 | include $(TOPDIR)/rules.mk |
| 6 | |
| 7 | PKG_NAME:=psqlodbc |
| 8 | PKG_VERSION:=11.00.0000 |
| 9 | PKG_RELEASE:=2 |
| 10 | |
| 11 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 12 | PKG_SOURCE_URL:=https://ftp.postgresql.org/pub/odbc/versions/src |
| 13 | PKG_HASH:=703e6b87022f95ffa00d9f86c8f0a877f8a55b9b3be0942081f382e794112a86 |
| 14 | |
| 15 | PKG_MAINTAINER:= |
| 16 | PKG_LICENSE:=LGPL-2.0-or-later |
| 17 | PKG_LICENSE_FILES:=license.txt |
| 18 | |
| 19 | PKG_BUILD_DEPENDS:=unixodbc/host |
| 20 | PKG_BUILD_PARALLEL:=1 |
| 21 | PKG_INSTALL:=1 |
| 22 | |
| 23 | include $(INCLUDE_DIR)/package.mk |
| 24 | |
| 25 | CONFIGURE_ARGS += \ |
| 26 | --with-unixodbc=$(STAGING_DIR)/host/bin/odbc_config \ |
| 27 | --with-libpq=$(STAGING_DIR)/usr |
| 28 | |
| 29 | define Package/psqlodbc/Default |
| 30 | SUBMENU:=Database |
| 31 | URL:=https://odbc.postgresql.org/ |
| 32 | SECTION:=libs |
| 33 | CATEGORY:=Libraries |
| 34 | TITLE:=Postgresql driver for ODBC |
| 35 | DEPENDS:=+unixodbc +libpq |
| 36 | endef |
| 37 | |
| 38 | define Package/psqlodbca |
| 39 | $(call Package/psqlodbc/Default) |
| 40 | TITLE:=psqlODBC - PostgreSQL ODBC driver (ASCII) |
| 41 | endef |
| 42 | |
| 43 | define Package/psqlodbcw |
| 44 | $(call Package/psqlodbc/Default) |
| 45 | TITLE:=psqlODBC - PostgreSQL ODBC driver (UTF-8) |
| 46 | endef |
| 47 | |
| 48 | define Package/psqlodbca/description |
| 49 | psqlODBC is the official PostgreSQL ODBC Driver. |
| 50 | It is released under the Library General Public Licence, or LGPL. |
| 51 | endef |
| 52 | |
| 53 | define Package/psqlodbcw/description |
| 54 | $(call Package/psqlodbca/description) |
| 55 | (UTF-8 version) |
| 56 | endef |
| 57 | |
| 58 | define Package/psqlodbca/install |
| 59 | $(INSTALL_DIR) $(1)/usr/lib |
| 60 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/psqlodbca.so* $(1)/usr/lib/ |
| 61 | $(INSTALL_DIR) $(1)/etc/odbcinst.ini.d |
| 62 | echo "[PostgreSQL ANSI]" > $(1)/etc/odbcinst.ini.d/psqlodbca.ini |
| 63 | echo "Description = PostgreSQL ODBC driver (ANSI version)" >> $(1)/etc/odbcinst.ini.d/psqlodbca.ini |
| 64 | echo "Driver = /usr/lib/psqlodbca.so" >> $(1)/etc/odbcinst.ini.d/psqlodbca.ini |
| 65 | |
| 66 | endef |
| 67 | |
| 68 | define Package/psqlodbcw/install |
| 69 | $(INSTALL_DIR) $(1)/usr/lib |
| 70 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/psqlodbcw.so* $(1)/usr/lib/ |
| 71 | $(INSTALL_DIR) $(1)/etc/odbcinst.ini.d |
| 72 | echo "[PostgreSQL Unicode]" > $(1)/etc/odbcinst.ini.d/psqlodbcw.ini |
| 73 | echo "Description = PostgreSQL ODBC driver (Unicode version)" >> $(1)/etc/odbcinst.ini.d/psqlodbcw.ini |
| 74 | echo "Driver = /usr/lib/psqlodbcw.so" >> $(1)/etc/odbcinst.ini.d/psqlodbcw.ini |
| 75 | endef |
| 76 | |
| 77 | $(eval $(call BuildPackage,psqlodbca)) |
| 78 | $(eval $(call BuildPackage,psqlodbcw)) |