2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
18 ftp
://ftp.us.postgresql.org
/pub
/mirrors
/postgresql
/source
/v
$(PKG_VERSION
) \
19 ftp
://ftp-archives.postgresql.org
/pub
/source
/v
$(PKG_VERSION
)
20 PKG_MD5SUM
:=2e0e82552f8463343df5d89348356481
23 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
25 include $(INCLUDE_DIR
)/package.mk
31 TITLE
:=PostgreSQL client library
32 DESCRIPTION
:=PostgreSQL client library.
33 URL
:=http
://www.postgresql.org
/
36 define Package
/pgsql-cli
40 TITLE
:=Command Line Interface
(CLI
) to PostgreSQL databases
41 DESCRIPTION
:=Command Line Interface
(CLI
) to PostgreSQL databases.
42 URL
:=http
://www.postgresql.org
/
45 # ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
46 define Build
/Configure
47 (cd
$(PKG_BUILD_DIR
); rm -f config.cache
; \
48 $(TARGET_CONFIGURE_OPTS
) \
49 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
50 CPPFLAGS
="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
51 LDFLAGS
="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
53 --target
=$(GNU_TARGET_NAME
) \
54 --host
=$(GNU_TARGET_NAME
) \
55 --build
=$(GNU_HOST_NAME
) \
61 --datadir=/usr
/share \
62 --includedir=/usr
/include \
63 --docdir
=/usr
/share
/info \
65 --libexecdir
=/usr
/lib \
66 --localstatedir
=/var \
67 --mandir=/usr
/share
/man \
71 $(DISABLE_LARGEFILE
) \
74 --disable-integer-datetimes \
84 --without-rendezvous \
92 $(MAKE
) -C
"$(PKG_BUILD_DIR)/src/include" \
93 DESTDIR
="$(PKG_INSTALL_DIR)" \
95 $(MAKE
) -C
"$(PKG_BUILD_DIR)/src/interfaces/libpq" \
96 DESTDIR
="$(PKG_INSTALL_DIR)" \
98 $(MAKE
) -C
"$(PKG_BUILD_DIR)/src/bin/pg_config" \
99 DESTDIR
="$(PKG_INSTALL_DIR)" \
100 includedir="$(STAGING_DIR)/usr/include" \
101 libdir="$(STAGING_DIR)/usr/lib" \
103 $(MAKE
) -C
"$(PKG_BUILD_DIR)/src/bin/psql" \
104 DESTDIR
="$(PKG_INSTALL_DIR)" \
108 define Package
/libpq
/install
109 install -d
-m0755
$(1)/usr
/lib
110 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.so.
* $(1)/usr
/lib
/
113 define Package
/pgsql-cli
/install
114 install -d
-m0755
$(1)/usr
/bin
115 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/psql
$(1)/usr
/bin
/
118 define Build
/InstallDev
119 mkdir
-p
$(STAGING_DIR
)/usr
/bin
120 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/pg_config
$(STAGING_DIR
)/usr
/bin
/
121 mkdir
-p
$(STAGING_DIR
)/usr
/include
122 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq
$(STAGING_DIR
)/usr
/include/
123 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq-fe.h
$(STAGING_DIR
)/usr
/include/
124 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config.h
$(STAGING_DIR
)/usr
/include/
125 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgres_ext.h
$(STAGING_DIR
)/usr
/include/
126 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgresql
$(STAGING_DIR
)/usr
/include/
127 mkdir
-p
$(STAGING_DIR
)/usr
/lib
128 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.
{a
,so
*} $(STAGING_DIR
)/usr
/lib
/
131 define Build
/UninstallDev
133 $(STAGING_DIR
)/usr
/bin
/pg_config \
134 $(STAGING_DIR
)/usr
/include/libpq \
135 $(STAGING_DIR
)/usr
/include/libpq-fe.h \
136 $(STAGING_DIR
)/usr
/include/pg_config.h \
137 $(STAGING_DIR
)/usr
/include/postgres_ext.h \
138 $(STAGING_DIR
)/usr
/include/postgresql \
139 $(STAGING_DIR
)/usr
/lib
/libpq.
{a
,so
*}
142 $(eval
$(call BuildPackage
,libpq
))
143 $(eval
$(call BuildPackage
,pgsql-cli
))