3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=f0ea2b372a7bdaf2613e92176ebf5e0f
11 ftp
://ftp3.us.postgresql.org
/pub
/postgresql
/source
/v
$(PKG_VERSION
)/ \
12 ftp
://ftp.br.postgresql.org
/pub
/PostgreSQL
/source
/v
$(PKG_VERSION
)/ \
13 ftp
://ftp.au.postgresql.org
/pub
/postgresql
/source
/v
$(PKG_VERSION
)/ \
14 ftp
://ftp.tw.postgresql.org
/pub
/postgresql
/source
/v
$(PKG_VERSION
)/ \
15 http
://nthill.free.fr
/openwrt
/sources
/$(PKG_NAME
)/
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
21 IPKG_LIBPQ
:=$(PACKAGE_DIR
)/libpq_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
22 IDIR_LIBPQ
:=$(PKG_BUILD_DIR
)/ipkg
23 INFO_LIBPQ
:=$(IPKG_STATE_DIR
)/info/libpq.list
25 $(DL_DIR
)/$(PKG_SOURCE
):
26 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(PKG_SOURCE
) $(PKG_MD5SUM
) $(PKG_SOURCE_URL
)
28 $(PKG_BUILD_DIR
)/.prepared
: $(DL_DIR
)/$(PKG_SOURCE
)
29 $(PKG_CAT
) $(DL_DIR
)/$(PKG_SOURCE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
30 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
31 touch
$(PKG_BUILD_DIR
)/.prepared
33 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.prepared
34 # ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
35 (cd
$(PKG_BUILD_DIR
); rm -rf config.cache config.status
; \
36 $(TARGET_CONFIGURE_OPTS
) \
37 CFLAGS
="$(TARGET_CFLAGS)" \
38 CPPFLAGS
="$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
39 LDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
41 --target
=$(GNU_TARGET_NAME
) \
42 --host
=$(GNU_TARGET_NAME
) \
43 --build
=$(GNU_HOST_NAME
) \
49 --datadir=/usr
/share \
50 --includedir=/usr
/include \
51 --docdir
=/usr
/share
/info \
53 --libexecdir
=/usr
/lib \
54 --localstatedir
=/var \
55 --mandir=/usr
/share
/man \
59 $(DISABLE_LARGEFILE
) \
62 --disable-integer-datetimes \
72 --without-rendezvous \
77 touch
$(PKG_BUILD_DIR
)/.configured
79 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/.configured
80 $(MAKE
) -C
"$(PKG_BUILD_DIR)" \
81 $(TARGET_CONFIGURE_OPTS
)
82 touch
$(PKG_BUILD_DIR
)/.built
84 $(STAGING_DIR
)/usr
/lib
/libpq.so
: $(PKG_BUILD_DIR
)/.built
85 $(MAKE
) -C
"$(PKG_BUILD_DIR)" \
86 DESTDIR
="$(STAGING_DIR)" \
89 $(IPKG_LIBPQ
): $(STAGING_DIR
)/usr
/lib
/libpq.so
90 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(IDIR_LIBPQ
) libpq.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
91 mkdir
-p
$(IDIR_LIBPQ
)/usr
/lib
92 cp
-fp
$(STAGING_DIR
)/usr
/lib
/libpq.so.
* $(IDIR_LIBPQ
)/usr
/lib
/
93 $(STRIP
) $(IDIR_LIBPQ
)/usr
/lib
/*.so
*
94 mkdir
-p
$(PACKAGE_DIR
)
95 $(IPKG_BUILD
) $(IDIR_LIBPQ
) $(PACKAGE_DIR
)
97 $(INFO_LIBPQ
): $(IPKG_LIBPQ
)
98 $(IPKG
) install $(IPKG_LIBPQ
)
100 prepare
: $(PKG_BUILDPKG_SOURCE_DIR
)/.prepared
101 compile
: $(IPKG_LIBPQ
)
102 install: $(INFO_LIBPQ
)
105 -$(MAKE
) -C
"$(PKG_BUILD_DIR)" \
106 DESTDIR
="$(STAGING_DIR)" \
108 rm -rf
$(PKG_BUILD_DIR
) $(IPKG_LIBPQ
)