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.
82 PGSQL_CLI_EXTRA_BIN
:= \
95 pgac_cv_snprintf_long_long_int_format
="%lld" \
96 pgac_cv_snprintf_size_t_support
=yes
98 ifeq ($(CONFIG_USE_UCLIBC
),y
)
99 # PostgreSQL does not build against uClibc with locales
100 # enabled, due to an uClibc bug, see
101 # http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
102 # so overwrite automatic detection and disable locale support
103 PGSQL_CONFIG_VARS
+= \
104 pgac_cv_type_locale_t
=no
107 TARGET_CONFIGURE_OPTS
+=$(PGSQL_CONFIG_VARS
)
109 HOST_CONFIGURE_ARGS
+= \
136 $(if
$(CONFIG_TARGET_avr32
),--disable-spinlocks
)
138 # Need a native ecpg ,pg_config, and zic for build
140 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/interfaces
/ecpg
/preproc CC
="$(HOSTCC)"
141 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/timezone CC
="$(HOSTCC)"
142 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src
/bin
/pg_config CC
="$(HOSTCC)"
146 $(INSTALL_DIR
) $(STAGING_DIR
)/host
/bin
/
147 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/bin
/pg_config
/pg_config
$(STAGING_DIR
)/host
/bin
/
148 $(INSTALL_DIR
) $(STAGING_DIR_HOSTPKG
)/bin
/
149 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/interfaces
/ecpg
/preproc
/ecpg
$(STAGING_DIR_HOSTPKG
)/bin
/
150 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/timezone
/zic
$(STAGING_DIR_HOSTPKG
)/bin
/
153 define Build
/Configure
154 $(Build
/Configure
/Default
)
155 $(SED
) 's@ECPG = ../../preproc/ecpg@ECPG = $(STAGING_DIR_HOSTPKG)/bin/ecpg@' $(PKG_BUILD_DIR
)/src
/interfaces
/ecpg
/test/Makefile.regress
158 TARGET_CFLAGS
+= $(FPIC
) -lpthread
160 # because PROFILE means something else in the project Makefile
163 define Package
/libpq
/install
164 $(INSTALL_DIR
) $(1)/usr
/lib
165 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.so.
* $(1)/usr
/lib
/
168 define Package
/pgsql-cli
/install
169 $(INSTALL_DIR
) $(1)/usr
/bin
170 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/psql
$(1)/usr
/bin
/
173 define Package
/pgsql-cli-extra
/install
174 $(INSTALL_DIR
) $(1)/usr
/bin
175 $(INSTALL_BIN
) $(foreach bin
,$(PGSQL_CLI_EXTRA_BIN
),$(PKG_INSTALL_DIR
)/usr
/bin
/$(bin
)) $(1)/usr
/bin
/
178 define Package
/pgsql-server
/install
179 $(INSTALL_DIR
) $(1)/usr
/bin
180 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/pg_
* $(PKG_INSTALL_DIR
)/usr
/bin
/postgres \
181 $(PKG_INSTALL_DIR
)/usr
/bin
/initdb
$(1)/usr
/bin
/
182 ln
-sf postgres
$(1)/usr
/bin
/postmaster
184 $(INSTALL_DIR
) $(1)/usr
/share
/postgresql
185 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/postgresql
/* \
186 $(1)/usr
/share
/postgresql
188 $(INSTALL_DIR
) $(1)/usr
/lib
189 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/postgresql \
192 $(INSTALL_DIR
) $(1)/lib
/functions
193 $(INSTALL_BIN
) .
/files
/postgresql.sh
$(1)/lib
/functions
/
195 $(INSTALL_DIR
) $(1)/etc
/config
196 $(INSTALL_DATA
) .
/files
/postgresql.config
$(1)/etc
/config
/postgresql
198 $(INSTALL_DIR
) $(1)/etc
/init.d
199 $(INSTALL_BIN
) .
/files
/postgresql.init
$(1)/etc
/init.d
/postgresql
202 define Build
/InstallDev
203 $(INSTALL_DIR
) $(1)/usr
/bin
204 $(LN
) $(STAGING_DIR
)/host
/bin
/pg_config
$(1)/usr
/bin
205 $(INSTALL_DIR
) $(1)/usr
/include
206 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq
$(1)/usr
/include/
207 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libpq-fe.h
$(1)/usr
/include/
208 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config.h
$(1)/usr
/include/
209 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config_manual.h
$(1)/usr
/include/
210 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgres_ext.h
$(1)/usr
/include/
211 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pg_config_ext.h
$(1)/usr
/include/
212 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/postgresql
$(1)/usr
/include/
213 $(INSTALL_DIR
) $(1)/usr
/lib
214 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpq.
{a
,so
*} $(1)/usr
/lib
/
217 $(eval
$(call HostBuild
))
218 $(eval
$(call BuildPackage
,libpq
))
219 $(eval
$(call BuildPackage
,pgsql-cli
))
220 $(eval
$(call BuildPackage
,pgsql-cli-extra
))
221 $(eval
$(call BuildPackage
,pgsql-server
))