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
12 PKG_CPE_ID
:=cpe
:/a
:postgresql
:postgresql
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 https
://ftp.postgresql.org
/pub
/source
/v
$(PKG_VERSION
) \
17 http
://ftp.postgresql.org
/pub
/source
/v
$(PKG_VERSION
) \
18 ftp
://ftp.postgresql.org
/pub
/source
/v
$(PKG_VERSION
)
20 PKG_HASH
:=ffc7d4891f00ffbf5c3f4eab7fbbced8460b8c0ee63c5a5167133b9e6599d932
22 PKG_BUILD_FLAGS
:=no-mips16
24 PKG_MACRO_PATHS
:=config
25 PKG_BUILD_DEPENDS
:=postgresql
/host
28 include $(INCLUDE_DIR
)/host-build.mk
29 include $(INCLUDE_DIR
)/package.mk
35 TITLE
:=PostgreSQL client library
36 URL
:=http
://www.postgresql.org
/
40 define Package
/libpq
/description
41 PostgreSQL client library.
44 define Package
/pgsql-cli
47 DEPENDS
:=+libncursesw
+libpq
+libreadline
+librt
+zlib
48 TITLE
:=Command Line Interface
(CLI
) to PostgreSQL databases
49 URL
:=http
://www.postgresql.org
/
53 define Package
/pgsql-cli
/description
54 Command Line Interface
(CLI
) to PostgreSQL databases.
57 define Package
/pgsql-cli-extra
60 DEPENDS
:=+libncursesw
+libpq
+libreadline
+librt
+zlib
61 TITLE
:=Command Line extras for PostgreSQL databases
62 URL
:=http
://www.postgresql.org
/
66 define Package
/pgsql-cli-extra
/description
67 Command Line extras for PostgreSQL databases.
70 define Package
/pgsql-server
73 DEPENDS
:=+pgsql-cli
+blockd
74 TITLE
:=PostgreSQL databases Server
75 URL
:=http
://www.postgresql.org
/
77 USERID
:=postgres
=5432:postgres
=5432
80 define Package
/pgsql-server
/description
81 PostgreSQL databases Server.
105 PGSQL_CLI_EXTRA_BIN
:= \
117 PGSQL_CONFIG_VARS
:= \
118 pgac_cv_snprintf_long_long_int_format
="%lld" \
119 pgac_cv_snprintf_size_t_support
=yes \
121 ac_cv_file__dev_urandom
="/dev/urandom" \
124 ifeq ($(CONFIG_USE_UCLIBC
),y
)
125 # PostgreSQL does not build against uClibc with locales
126 # enabled, due to an uClibc bug, see
127 # http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
128 # so overwrite automatic detection and disable locale support
129 PGSQL_CONFIG_VARS
+= \
130 pgac_cv_type_locale_t
=no
133 TARGET_CONFIGURE_OPTS
+=$(PGSQL_CONFIG_VARS
)
135 HOST_CONFIGURE_ARGS
+= \
165 $(if
$(CONFIG_arc
),--disable-spinlocks
)
167 HOST_CFLAGS
+= -std
=gnu99
169 # Need a native zic and pg_config for build
171 +$(HOST_MAKE_VARS
) MAKELEVEL
=0 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/bin
/pg_config CC
="$(HOSTCC)"
172 +$(HOST_MAKE_VARS
) MAKELEVEL
=0 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/timezone CC
="$(HOSTCC)"
176 $(INSTALL_DIR
) $(STAGING_DIR_HOSTPKG
)/lib
/
177 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/common
/libpgcommon.a
$(STAGING_DIR_HOSTPKG
)/lib
/
178 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/port
/libpgport.a
$(STAGING_DIR_HOSTPKG
)/lib
/
179 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/bin
/pg_config
/pg_config
$(STAGING_DIR_HOSTPKG
)/lib
/
180 $(INSTALL_DIR
) $(STAGING_DIR_HOSTPKG
)/bin
/
181 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/timezone
/zic
$(STAGING_DIR_HOSTPKG
)/bin
/
185 $(MAKE
) -C
$(PKG_BUILD_DIR
) MAKELEVEL
=0 all contrib
188 # because PROFILE means something else in the project Makefile
191 define Package
/libpq
/install
192 $(INSTALL_DIR
) $(1)/usr
/lib
193 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.so.
* $(1)/usr
/lib
/
196 define Package
/pgsql-cli
/install
197 $(INSTALL_DIR
) $(1)/usr
/bin
198 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/psql
$(1)/usr
/bin
/
201 define Package
/pgsql-cli-extra
/install
202 $(INSTALL_DIR
) $(1)/usr
/bin
203 $(INSTALL_BIN
) $(foreach bin
,$(PGSQL_CLI_EXTRA_BIN
),$(PKG_INSTALL_DIR
)/usr
/bin
/$(bin
)) $(1)/usr
/bin
/
206 define Package
/pgsql-server
/conffiles
207 /etc
/config
/postgresql
210 define Package
/pgsql-server
/install
211 $(INSTALL_DIR
) $(1)/usr
/bin
212 $(INSTALL_BIN
) $(foreach bin
,$(PGSQL_SERVER_BIN
),$(PKG_INSTALL_DIR
)/usr
/bin
/$(bin
)) $(1)/usr
/bin
/
214 ln
-sf postgres
$(1)/usr
/bin
/postmaster
216 $(INSTALL_DIR
) $(1)/usr
/share
/postgresql
217 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/postgresql
/* \
218 $(1)/usr
/share
/postgresql
220 $(INSTALL_DIR
) $(1)/usr
/lib
221 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/postgresql \
224 $(INSTALL_DIR
) $(1)/lib
/functions
225 $(INSTALL_BIN
) .
/files
/postgresql.sh
$(1)/lib
/functions
/
227 $(INSTALL_DIR
) $(1)/etc
/config
228 $(INSTALL_DATA
) .
/files
/postgresql.config
$(1)/etc
/config
/postgresql
230 $(INSTALL_DIR
) $(1)/etc
/init.d
231 $(INSTALL_BIN
) .
/files
/postgresql.init
$(1)/etc
/init.d
/postgresql
234 define Build
/InstallDev
235 $(INSTALL_DIR
) $(1)/usr
/bin
236 $(CP
) $(STAGING_DIR_HOSTPKG
)/lib
/pg_config
$(1)/usr
/bin
237 $(INSTALL_DIR
) $(1)/host
/bin
/
238 $(LN
) $(STAGING_DIR
)/usr
/bin
/pg_config
$(1)/host
/bin
239 $(INSTALL_DIR
) $(1)/usr
/include
240 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq
$(1)/usr
/include/
241 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq-fe.h
$(1)/usr
/include/
242 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config.h
$(1)/usr
/include/
243 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config_manual.h
$(1)/usr
/include/
244 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgres_ext.h
$(1)/usr
/include/
245 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config_ext.h
$(1)/usr
/include/
246 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgresql
$(1)/usr
/include/
247 $(INSTALL_DIR
) $(1)/usr
/lib
248 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.
{a
,so
*} $(1)/usr
/lib
/
249 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
250 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libpq.
pc $(1)/usr
/lib
/pkgconfig
/
253 $(eval
$(call HostBuild
))
254 $(eval
$(call BuildPackage
,libpq
))
255 $(eval
$(call BuildPackage
,pgsql-cli
))
256 $(eval
$(call BuildPackage
,pgsql-cli-extra
))
257 $(eval
$(call BuildPackage
,pgsql-server
))