Merge pull request #4180 from michael-dev/features/libpq-pkgconfig-files
[feed/packages.git] / libs / psqlodbc / Makefile
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_RELEASE:=1
9 PKG_VERSION:=09.06.0310
10 PKG_HASH:=6c42078af094d61baca2c8bd1dc4d137a77377198ef94e4eda5989bdce3474c3
11
12 PKG_SOURCE_URL:=https://ftp.postgresql.org/pub/odbc/versions/src/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14
15 PKG_LICENSE:=LGPL-2.0+
16 PKG_LICENSE_FILES:=license.txt
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 CONFIGURE_ARGS += \
23 --with-unixodbc=$(STAGING_DIR)/usr \
24 --with-libpq=$(STAGING_DIR)/usr
25
26 define Package/psqlodbc/Default
27 SUBMENU:=database
28 URL:=https://odbc.postgresql.org/
29 SECTION:=libs
30 CATEGORY:=Libraries
31 TITLE:=Postgresql driver for ODBC
32 DEPENDS:=+unixodbc +libpq
33 endef
34
35 define Package/psqlodbca
36 $(call Package/psqlodbc/Default)
37 TITLE:=psqlODBC - PostgreSQL ODBC driver (ASCII)
38 endef
39
40 define Package/psqlodbcw
41 $(call Package/psqlodbc/Default)
42 TITLE:=psqlODBC - PostgreSQL ODBC driver (UTF-8)
43 endef
44
45 define Package/psqlodbca/description
46 psqlODBC is the official PostgreSQL ODBC Driver.
47 It is released under the Library General Public Licence, or LGPL.
48 endef
49
50 define Package/psqlodbcw/description
51 $(call Package/psqlodbca/description)
52 (UTF-8 version)
53 endef
54
55 define Package/psqlodbca/install
56 $(INSTALL_DIR) $(1)/usr/lib
57 $(CP) $(PKG_INSTALL_DIR)/usr/lib/psqlodbca.so* $(1)/usr/lib/
58 $(INSTALL_DIR) $(1)/etc/odbcinst.ini.d
59 echo "[PostgreSQL ANSI]" > $(1)/etc/odbcinst.ini.d/psqlodbca.ini
60 echo "Description = PostgreSQL ODBC driver (ANSI version)" >> $(1)/etc/odbcinst.ini.d/psqlodbca.ini
61 echo "Driver = /usr/lib/psqlodbca.so" >> $(1)/etc/odbcinst.ini.d/psqlodbca.ini
62
63 endef
64
65 define Package/psqlodbcw/install
66 $(INSTALL_DIR) $(1)/usr/lib
67 $(CP) $(PKG_INSTALL_DIR)/usr/lib/psqlodbcw.so* $(1)/usr/lib/
68 $(INSTALL_DIR) $(1)/etc/odbcinst.ini.d
69 echo "[PostgreSQL Unicode]" > $(1)/etc/odbcinst.ini.d/psqlodbcw.ini
70 echo "Description = PostgreSQL ODBC driver (Unicode version)" >> $(1)/etc/odbcinst.ini.d/psqlodbcw.ini
71 echo "Driver = /usr/lib/psqlodbcw.so" >> $(1)/etc/odbcinst.ini.d/psqlodbcw.ini
72 endef
73
74 $(eval $(call BuildPackage,psqlodbca))
75 $(eval $(call BuildPackage,psqlodbcw))