convert chillispot to new packaging style
[openwrt.git] / openwrt / package / postgresql / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=postgresql
6 PKG_VERSION:=7.4.7
7 PKG_RELEASE:=3
8 PKG_MD5SUM:=32dac2916d16287d95e0c958a75161fa
9
10 PKG_SOURCE_URL:=\
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
17 PKG_CAT:=bzcat
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20
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
24
25 EXTRA_CFLAGS:=
26 ifeq ($(BR2_GCC_3_4),y)
27 EXTRA_CFLAGS += -fno-unit-at-a-time
28 endif
29
30 $(DL_DIR)/$(PKG_SOURCE):
31 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
32
33 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
34 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
35 $(PATCH) $(PKG_BUILD_DIR) ./patches
36 touch $(PKG_BUILD_DIR)/.prepared
37
38 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
39 # ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
40 (cd $(PKG_BUILD_DIR); rm -rf config.cache config.status; \
41 $(TARGET_CONFIGURE_OPTS) \
42 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
43 CPPFLAGS="$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
44 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
45 ./configure \
46 --target=$(GNU_TARGET_NAME) \
47 --host=$(GNU_TARGET_NAME) \
48 --build=$(GNU_HOST_NAME) \
49 --program-prefix="" \
50 --program-suffix="" \
51 --prefix=/usr \
52 --exec-prefix=/usr \
53 --bindir=/usr/bin \
54 --datadir=/usr/share \
55 --includedir=/usr/include \
56 --docdir=/usr/share/info \
57 --libdir=/usr/lib \
58 --libexecdir=/usr/lib \
59 --localstatedir=/var \
60 --mandir=/usr/share/man \
61 --sbindir=/usr/sbin \
62 --sysconfdir=/etc \
63 $(DISABLE_NLS) \
64 $(DISABLE_LARGEFILE) \
65 --enable-shared \
66 --enable-static \
67 --disable-integer-datetimes \
68 --disable-rpath \
69 --without-java \
70 --without-krb4 \
71 --without-krb5 \
72 --without-openssl \
73 --without-pam \
74 --without-perl \
75 --without-python \
76 --without-readline \
77 --without-rendezvous \
78 --without-tcl \
79 --without-tk \
80 --with-zlib="yes" \
81 );
82 touch $(PKG_BUILD_DIR)/.configured
83
84 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
85 $(MAKE) -C "$(PKG_BUILD_DIR)" \
86 $(TARGET_CONFIGURE_OPTS)
87 touch $(PKG_BUILD_DIR)/.built
88
89 $(STAGING_DIR)/usr/lib/libpq.so: $(PKG_BUILD_DIR)/.built
90 $(MAKE) -C "$(PKG_BUILD_DIR)" \
91 DESTDIR="$(STAGING_DIR)" \
92 install
93
94 $(IPKG_LIBPQ): $(STAGING_DIR)/usr/lib/libpq.so
95 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBPQ) ./ipkg/libpq.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
96 mkdir -p $(IDIR_LIBPQ)/usr/lib
97 cp -fpR $(STAGING_DIR)/usr/lib/libpq.so.* $(IDIR_LIBPQ)/usr/lib/
98 $(STRIP) $(IDIR_LIBPQ)/usr/lib/*.so*
99 mkdir -p $(PACKAGE_DIR)
100 $(IPKG_BUILD) $(IDIR_LIBPQ) $(PACKAGE_DIR)
101
102 $(INFO_LIBPQ): $(IPKG_LIBPQ)
103 $(IPKG) install $(IPKG_LIBPQ)
104
105 prepare: $(PKG_BUILD_DIR)/.prepared
106 compile: $(IPKG_LIBPQ)
107 install: $(INFO_LIBPQ)
108
109 clean:
110 -$(MAKE) -C "$(PKG_BUILD_DIR)" \
111 DESTDIR="$(STAGING_DIR)" \
112 uninstall
113 rm -rf $(PKG_BUILD_DIR) $(IPKG_LIBPQ)
This page took 0.049969 seconds and 5 git commands to generate.