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
:=12345c83b89aa29808568977f5200d6da00f88a035517f925293355432ffe61f
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
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.
100 PGSQL_CLI_EXTRA_BIN
:= \
110 PGSQL_CONFIG_VARS
:= \
111 pgac_cv_snprintf_long_long_int_format
="%lld" \
112 pgac_cv_snprintf_size_t_support
=yes \
116 ifeq ($(CONFIG_USE_UCLIBC
),y
)
117 # PostgreSQL does not build against uClibc with locales
118 # enabled, due to an uClibc bug, see
119 # http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
120 # so overwrite automatic detection and disable locale support
121 PGSQL_CONFIG_VARS
+= \
122 pgac_cv_type_locale_t
=no
125 TARGET_CONFIGURE_OPTS
+=$(PGSQL_CONFIG_VARS
)
127 HOST_CONFIGURE_ARGS
+= \
157 $(if
$(CONFIG_arc
),--disable-spinlocks
)
159 HOST_CFLAGS
+= -std
=gnu99
161 # Need a native zic and pg_config for build
163 +$(HOST_MAKE_VARS
) MAKELEVEL
=0 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/bin
/pg_config CC
="$(HOSTCC)"
164 +$(HOST_MAKE_VARS
) MAKELEVEL
=0 $(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
/timezone
/zic
$(STAGING_DIR_HOSTPKG
)/bin
/
177 $(MAKE
) -C
$(PKG_BUILD_DIR
) MAKELEVEL
=0 all contrib
180 # because PROFILE means something else in the project Makefile
183 define Package
/libpq
/install
184 $(INSTALL_DIR
) $(1)/usr
/lib
185 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.so.
* $(1)/usr
/lib
/
188 define Package
/pgsql-cli
/install
189 $(INSTALL_DIR
) $(1)/usr
/bin
190 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/psql
$(1)/usr
/bin
/
193 define Package
/pgsql-cli-extra
/install
194 $(INSTALL_DIR
) $(1)/usr
/bin
195 $(INSTALL_BIN
) $(foreach bin
,$(PGSQL_CLI_EXTRA_BIN
),$(PKG_INSTALL_DIR
)/usr
/bin
/$(bin
)) $(1)/usr
/bin
/
198 define Package
/pgsql-server
/conffiles
199 /etc
/config
/postgresql
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
))