1 # This is free software, licensed under the GNU General Public License v2.
2 # See /LICENSE for more information.
5 include $(TOPDIR
)/rules.mk
10 PKG_MAINTAINER
:=Daniel Golle
<daniel@makrotopia.org
>
11 PKG_LICENSE
:=PostgreSQL
13 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
15 https
://ftp.postgresql.org
/pub
/source
/v
$(PKG_VERSION
) \
16 http
://ftp.postgresql.org
/pub
/source
/v
$(PKG_VERSION
) \
17 ftp
://ftp.postgresql.org
/pub
/source
/v
$(PKG_VERSION
)
19 PKG_HASH
:=2b3ab16d82e21cead54c08b95ce3ac480696944a68603b6c11b3205b7376ce13
23 PKG_MACRO_PATHS
:=config
24 PKG_BUILD_DEPENDS
+= readline
/host postgresql
/host
27 include $(INCLUDE_DIR
)/host-build.mk
28 include $(INCLUDE_DIR
)/package.mk
33 DEPENDS
:=+zlib
+libreadline
+libpthread
+libncursesw
34 TITLE
:=PostgreSQL client library
35 URL
:=http
://www.postgresql.org
/
39 define Package
/libpq
/description
40 PostgreSQL client library.
43 define Package
/pgsql-cli
46 DEPENDS
:=+libpq
+librt
47 TITLE
:=Command Line Interface
(CLI
) to PostgreSQL databases
48 URL
:=http
://www.postgresql.org
/
52 define Package
/pgsql-cli
/description
53 Command Line Interface
(CLI
) to PostgreSQL databases.
56 define Package
/pgsql-cli-extra
59 DEPENDS
:=+libpq
+librt
60 TITLE
:=Command Line extras for PostgreSQL databases
61 URL
:=http
://www.postgresql.org
/
65 define Package
/pgsql-cli-extra
/description
66 Command Line extras for PostgreSQL databases.
69 define Package
/pgsql-server
72 DEPENDS
:=+libpq
+librt
+pgsql-cli
73 TITLE
:=PostgreSQL databases Server
74 URL
:=http
://www.postgresql.org
/
76 USERID
:=postgres
=5432:postgres
=5432
79 define Package
/pgsql-server
/description
80 PostgreSQL databases Server.
101 PGSQL_CLI_EXTRA_BIN
:= \
113 PGSQL_CONFIG_VARS
:= \
114 pgac_cv_snprintf_long_long_int_format
="%lld" \
115 pgac_cv_snprintf_size_t_support
=yes
117 ifeq ($(CONFIG_USE_UCLIBC
),y
)
118 # PostgreSQL does not build against uClibc with locales
119 # enabled, due to an uClibc bug, see
120 # http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
121 # so overwrite automatic detection and disable locale support
122 PGSQL_CONFIG_VARS
+= \
123 pgac_cv_type_locale_t
=no
126 TARGET_CONFIGURE_OPTS
+=$(PGSQL_CONFIG_VARS
)
128 HOST_CONFIGURE_ARGS
+= \
156 $(if
$(CONFIG_TARGET_avr32
),--disable-spinlocks
)
158 EXTRA_CFLAGS
:= -I
$(PKG_BUILD_DIR
)/src
/include/
160 # Need a native ecpg, pg_config and zic for build
162 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/bin
/pg_config CC
="$(HOSTCC)"
163 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/interfaces
/ecpg
/preproc CC
="$(HOSTCC)"
164 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/timezone CC
="$(HOSTCC)"
168 $(INSTALL_DIR
) $(STAGING_DIR_HOSTPKG
)/lib
/
169 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/common
/libpgcommon.a
$(STAGING_DIR_HOSTPKG
)/lib
/
170 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/port
/libpgport.a
$(STAGING_DIR_HOSTPKG
)/lib
/
171 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/bin
/pg_config
/pg_config
$(STAGING_DIR_HOSTPKG
)/lib
/
172 $(INSTALL_DIR
) $(STAGING_DIR_HOSTPKG
)/bin
/
173 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/interfaces
/ecpg
/preproc
/ecpg
$(STAGING_DIR_HOSTPKG
)/bin
/
174 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/timezone
/zic
$(STAGING_DIR_HOSTPKG
)/bin
/
177 define Build
/Configure
178 $(Build
/Configure
/Default
)
179 $(SED
) 's@ECPG = ../../preproc/ecpg@ECPG = $(STAGING_DIR_HOSTPKG)/bin/ecpg@' $(PKG_BUILD_DIR
)/src
/interfaces
/ecpg
/test/Makefile.regress
182 TARGET_CFLAGS
+= $(FPIC
) -lpthread
184 # because PROFILE means something else in the project Makefile
187 define Package
/libpq
/install
188 $(INSTALL_DIR
) $(1)/usr
/lib
189 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.so.
* $(1)/usr
/lib
/
192 define Package
/pgsql-cli
/install
193 $(INSTALL_DIR
) $(1)/usr
/bin
194 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/psql
$(1)/usr
/bin
/
197 define Package
/pgsql-cli-extra
/install
198 $(INSTALL_DIR
) $(1)/usr
/bin
199 $(INSTALL_BIN
) $(foreach bin
,$(PGSQL_CLI_EXTRA_BIN
),$(PKG_INSTALL_DIR
)/usr
/bin
/$(bin
)) $(1)/usr
/bin
/
202 define Package
/pgsql-server
/install
203 $(INSTALL_DIR
) $(1)/usr
/bin
204 $(INSTALL_BIN
) $(foreach bin
,$(PGSQL_SERVER_BIN
),$(PKG_INSTALL_DIR
)/usr
/bin
/$(bin
)) $(1)/usr
/bin
/
206 ln
-sf postgres
$(1)/usr
/bin
/postmaster
208 $(INSTALL_DIR
) $(1)/usr
/share
/postgresql
209 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/postgresql
/* \
210 $(1)/usr
/share
/postgresql
212 $(INSTALL_DIR
) $(1)/usr
/lib
213 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/postgresql \
216 $(INSTALL_DIR
) $(1)/lib
/functions
217 $(INSTALL_BIN
) .
/files
/postgresql.sh
$(1)/lib
/functions
/
219 $(INSTALL_DIR
) $(1)/etc
/config
220 $(INSTALL_DATA
) .
/files
/postgresql.config
$(1)/etc
/config
/postgresql
222 $(INSTALL_DIR
) $(1)/etc
/init.d
223 $(INSTALL_BIN
) .
/files
/postgresql.init
$(1)/etc
/init.d
/postgresql
226 define Build
/InstallDev
227 $(INSTALL_DIR
) $(1)/usr
/bin
228 $(CP
) $(STAGING_DIR_HOSTPKG
)/lib
/pg_config
$(1)/usr
/bin
229 $(INSTALL_DIR
) $(1)/host
/bin
/
230 $(LN
) $(STAGING_DIR
)/usr
/bin
/pg_config
$(1)/host
/bin
231 $(INSTALL_DIR
) $(1)/usr
/include
232 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq
$(1)/usr
/include/
233 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq-fe.h
$(1)/usr
/include/
234 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config.h
$(1)/usr
/include/
235 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config_manual.h
$(1)/usr
/include/
236 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgres_ext.h
$(1)/usr
/include/
237 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config_ext.h
$(1)/usr
/include/
238 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgresql
$(1)/usr
/include/
239 $(INSTALL_DIR
) $(1)/usr
/lib
240 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.
{a
,so
*} $(1)/usr
/lib
/
241 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
242 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libpq.
pc $(1)/usr
/lib
/pkgconfig
/
245 $(eval
$(call HostBuild
))
246 $(eval
$(call BuildPackage
,libpq
))
247 $(eval
$(call BuildPackage
,pgsql-cli
))
248 $(eval
$(call BuildPackage
,pgsql-cli-extra
))
249 $(eval
$(call BuildPackage
,pgsql-server
))