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
)
18 PKG_MD5SUM
:=fca055481875d1c49e31c28443f56472a1474b3fbe25b7ae64440c6118f82e64
22 PKG_MACRO_PATHS
:=config
23 PKG_BUILD_DEPENDS
+= postgresql
/host
26 include $(INCLUDE_DIR
)/host-build.mk
27 include $(INCLUDE_DIR
)/package.mk
32 DEPENDS
:=+zlib
+libreadline
+libpthread
+libncursesw
33 TITLE
:=PostgreSQL client library
34 URL
:=http
://www.postgresql.org
/
38 define Package
/libpq
/description
39 PostgreSQL client library.
42 define Package
/pgsql-cli
45 DEPENDS
:=+libpq
+librt
46 TITLE
:=Command Line Interface
(CLI
) to PostgreSQL databases
47 URL
:=http
://www.postgresql.org
/
51 define Package
/pgsql-cli
/description
52 Command Line Interface
(CLI
) to PostgreSQL databases.
55 define Package
/pgsql-cli-extra
58 DEPENDS
:=+libpq
+librt
59 TITLE
:=Command Line extras for PostgreSQL databases
60 URL
:=http
://www.postgresql.org
/
64 define Package
/pgsql-cli-extra
/description
65 Command Line extras for PostgreSQL databases.
68 define Package
/pgsql-server
71 DEPENDS
:=+libpq
+librt
+pgsql-cli
72 TITLE
:=PostgreSQL databases Server
73 URL
:=http
://www.postgresql.org
/
75 USERID
:=postgres
=5432:postgres
=5432
78 define Package
/pgsql-server
/description
79 PostgreSQL databases Server.
100 PGSQL_CLI_EXTRA_BIN
:= \
112 PGSQL_CONFIG_VARS
:= \
113 pgac_cv_snprintf_long_long_int_format
="%lld" \
114 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
+= \
154 $(if
$(CONFIG_TARGET_avr32
),--disable-spinlocks
)
156 EXTRA_CFLAGS
:= -I
$(PKG_BUILD_DIR
)/src
/include/
158 # Need a native ecpg and zic for build
160 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/interfaces
/ecpg
/preproc CC
="$(HOSTCC)"
161 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/timezone CC
="$(HOSTCC)"
165 $(INSTALL_DIR
) $(STAGING_DIR_HOSTPKG
)/bin
/
166 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/interfaces
/ecpg
/preproc
/ecpg
$(STAGING_DIR_HOSTPKG
)/bin
/
167 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/timezone
/zic
$(STAGING_DIR_HOSTPKG
)/bin
/
170 define Build
/Configure
171 $(Build
/Configure
/Default
)
172 $(SED
) 's@ECPG = ../../preproc/ecpg@ECPG = $(STAGING_DIR_HOSTPKG)/bin/ecpg@' $(PKG_BUILD_DIR
)/src
/interfaces
/ecpg
/test/Makefile.regress
176 $(call Build
/Compile
/Default
, )
177 $(MAKE
) -C
$(PKG_BUILD_DIR
)/src
/bin
/pg_config
clean
178 $(MAKE
) -C
$(PKG_BUILD_DIR
)/src
/bin
/pg_config CC
="$(HOSTCC)" TARGET_CC
="$(TARGET_CC)" CFLAGS
="$(HOST_CFLAGS)" TARGET_CFLAGS
="$(TARGET_CFLAGS)" LDFLAGS
="$(HOST_LDFLAGS)" STD_LDFLAGS
="$(TARGET_LDFLAGS)"
181 TARGET_CFLAGS
+= $(FPIC
) -lpthread
183 # because PROFILE means something else in the project Makefile
186 define Package
/libpq
/install
187 $(INSTALL_DIR
) $(1)/usr
/lib
188 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.so.
* $(1)/usr
/lib
/
191 define Package
/pgsql-cli
/install
192 $(INSTALL_DIR
) $(1)/usr
/bin
193 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/psql
$(1)/usr
/bin
/
196 define Package
/pgsql-cli-extra
/install
197 $(INSTALL_DIR
) $(1)/usr
/bin
198 $(INSTALL_BIN
) $(foreach bin
,$(PGSQL_CLI_EXTRA_BIN
),$(PKG_INSTALL_DIR
)/usr
/bin
/$(bin
)) $(1)/usr
/bin
/
201 define Package
/pgsql-server
/install
202 $(INSTALL_DIR
) $(1)/usr
/bin
203 $(INSTALL_BIN
) $(foreach bin
,$(PGSQL_SERVER_BIN
),$(PKG_INSTALL_DIR
)/usr
/bin
/$(bin
)) $(1)/usr
/bin
/
205 ln
-sf postgres
$(1)/usr
/bin
/postmaster
207 $(INSTALL_DIR
) $(1)/usr
/share
/postgresql
208 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/postgresql
/* \
209 $(1)/usr
/share
/postgresql
211 $(INSTALL_DIR
) $(1)/usr
/lib
212 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/postgresql \
215 $(INSTALL_DIR
) $(1)/lib
/functions
216 $(INSTALL_BIN
) .
/files
/postgresql.sh
$(1)/lib
/functions
/
218 $(INSTALL_DIR
) $(1)/etc
/config
219 $(INSTALL_DATA
) .
/files
/postgresql.config
$(1)/etc
/config
/postgresql
221 $(INSTALL_DIR
) $(1)/etc
/init.d
222 $(INSTALL_BIN
) .
/files
/postgresql.init
$(1)/etc
/init.d
/postgresql
225 define Build
/InstallDev
226 $(INSTALL_DIR
) $(1)/usr
/bin
227 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/src
/bin
/pg_config
/pg_config
$(1)/usr
/bin
/
228 $(INSTALL_DIR
) $(1)/host
/bin
/
229 $(LN
) $(STAGING_DIR
)/usr
/bin
/pg_config
$(1)/host
/bin
230 $(INSTALL_DIR
) $(1)/usr
/include
231 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq
$(1)/usr
/include/
232 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq-fe.h
$(1)/usr
/include/
233 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config.h
$(1)/usr
/include/
234 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config_manual.h
$(1)/usr
/include/
235 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgres_ext.h
$(1)/usr
/include/
236 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config_ext.h
$(1)/usr
/include/
237 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgresql
$(1)/usr
/include/
238 $(INSTALL_DIR
) $(1)/usr
/lib
239 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.
{a
,so
*} $(1)/usr
/lib
/
242 $(eval
$(call HostBuild
))
243 $(eval
$(call BuildPackage
,libpq
))
244 $(eval
$(call BuildPackage
,pgsql-cli
))
245 $(eval
$(call BuildPackage
,pgsql-cli-extra
))
246 $(eval
$(call BuildPackage
,pgsql-server
))