blob: 4f916690259a85a0cf96725a253d76304b141280 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001# This is free software, licensed under the GNU General Public License v2.
2# See /LICENSE for more information.
3#
4
5include $(TOPDIR)/rules.mk
6
7PKG_NAME:=psqlodbc
8PKG_VERSION:=11.00.0000
9PKG_RELEASE:=2
10
11PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12PKG_SOURCE_URL:=https://ftp.postgresql.org/pub/odbc/versions/src
13PKG_HASH:=703e6b87022f95ffa00d9f86c8f0a877f8a55b9b3be0942081f382e794112a86
14
15PKG_MAINTAINER:=
16PKG_LICENSE:=LGPL-2.0-or-later
17PKG_LICENSE_FILES:=license.txt
18
19PKG_BUILD_DEPENDS:=unixodbc/host
20PKG_BUILD_PARALLEL:=1
21PKG_INSTALL:=1
22
23include $(INCLUDE_DIR)/package.mk
24
25CONFIGURE_ARGS += \
26 --with-unixodbc=$(STAGING_DIR)/host/bin/odbc_config \
27 --with-libpq=$(STAGING_DIR)/usr
28
29define 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
36endef
37
38define Package/psqlodbca
39$(call Package/psqlodbc/Default)
40 TITLE:=psqlODBC - PostgreSQL ODBC driver (ASCII)
41endef
42
43define Package/psqlodbcw
44$(call Package/psqlodbc/Default)
45 TITLE:=psqlODBC - PostgreSQL ODBC driver (UTF-8)
46endef
47
48define Package/psqlodbca/description
49 psqlODBC is the official PostgreSQL ODBC Driver.
50 It is released under the Library General Public Licence, or LGPL.
51endef
52
53define Package/psqlodbcw/description
54$(call Package/psqlodbca/description)
55 (UTF-8 version)
56endef
57
58define 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
66endef
67
68define 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
75endef
76
77$(eval $(call BuildPackage,psqlodbca))
78$(eval $(call BuildPackage,psqlodbcw))