update ncurses to experimental packaging style (fix dependency on terminfo in staging...
[openwrt.git] / package / ncurses / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=ncurses
6 PKG_VERSION:=5.2
7 PKG_RELEASE:=6
8 PKG_MD5SUM:=464d6a49010cf2a6eb9ce59a264d4d47
9
10 PKG_SOURCE_URL:=ftp://ftp.gnu.org/pub/gnu/$(PKG_NAME) \
11 ftp://gatekeeper.dec.com/pub/GNU/$(PKG_NAME) \
12 ftp://ftp.uu.net/archive/systems/gnu/$(PKG_NAME) \
13 ftp://ftp.eu.uu.net/pub/gnu/$(PKG_NAME) \
14 ftp://ftp.funet.fi/pub/gnu/prep/$(PKG_NAME) \
15 ftp://ftp.leo.org/pub/comp/os/unix/gnu/$(PKG_NAME) \
16 ftp://ftp.digex.net/pub/gnu/$(PKG_NAME)
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_CAT:=zcat
21 PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
22 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
23
24 $(DL_DIR)/$(PKG_SOURCE):
25 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
26
27 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
28 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
29 touch $(PKG_BUILD_DIR)/.unpacked
30
31 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked
32 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
33 $(TARGET_CONFIGURE_OPTS) \
34 CFLAGS="$(TARGET_CFLAGS)" \
35 ac_cv_linux_vers="2" \
36 ./configure \
37 --target=$(GNU_TARGET_NAME) \
38 --host=$(GNU_TARGET_NAME) \
39 --build=$(GNU_HOST_NAME) \
40 --prefix=/usr \
41 --exec-prefix=/usr \
42 --bindir=/usr/bin \
43 --sbindir=/usr/sbin \
44 --libexecdir=/usr/lib \
45 --sysconfdir=/etc \
46 --datadir=/usr/share \
47 --localstatedir=/var \
48 --mandir=/usr/man \
49 --infodir=/usr/info \
50 --with-terminfo-dirs=/usr/share/terminfo \
51 --with-default-terminfo-dir=/usr/share/terminfo \
52 --without-ada \
53 --without-cxx \
54 --without-cxx-binding \
55 --without-progs \
56 --without-profile \
57 --without-debug \
58 --disable-rpath \
59 --enable-echo \
60 --enable-const \
61 --enable-overwrite \
62 --with-shared \
63 --with-normal \
64 $(DISABLE_NLS) \
65 $(DISABLE_LARGEFILE) \
66 );
67 touch $(PKG_BUILD_DIR)/.configured
68
69 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
70 $(MAKE) -C $(PKG_BUILD_DIR) \
71 $(TARGET_CONFIGURE_OPTS) \
72 BUILD_CC="$(TARGET_CC)" \
73 HOSTCC="$(HOSTCC)" \
74 HOSTCCFLAGS="\$$(CPPFLAGS)"
75 mkdir -p $(PKG_BUILD_DIR)/terminfo
76 $(MAKE) -C $(PKG_BUILD_DIR) \
77 DESTDIR="$(PKG_BUILD_DIR)/install" \
78 install
79 touch $(PKG_BUILD_DIR)/.built
80
81 $(STAGING_DIR)/usr/include/ncurses.h: $(PKG_BUILD_DIR)/.built
82 $(MAKE) -C $(PKG_BUILD_DIR) \
83 DESTDIR="$(STAGING_DIR)" \
84 install
85
86 $(PKG_IPK): $(PKG_BUILD_DIR)/.built
87 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) libncurses.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
88 mkdir -p $(PKG_IPK_DIR)/usr/lib
89 cp -a $(PKG_BUILD_DIR)/lib/lib*.so.* $(PKG_IPK_DIR)/usr/lib/
90 mkdir -p $(PKG_IPK_DIR)/usr/share/terminfo
91 for f in a/ansi d/dumb l/linux s/screen v/vt100 x/xterm x/xterm-color; do \
92 mkdir -p $(PKG_IPK_DIR)/usr/share/terminfo/`dirname $${f}`; \
93 cp -fpR \
94 $(PKG_BUILD_DIR)/install/usr/share/terminfo/$${f} \
95 $(PKG_IPK_DIR)/usr/share/terminfo/$${f}; \
96 done
97 mkdir -p $(PACKAGE_DIR)
98 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
99
100 $(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)
101 $(IPKG) install $(PKG_IPK)
102
103 source: $(DL_DIR)/$(PKG_SOURCE)
104 prepare: $(PKG_BUILD_DIR)/.unpacked
105 compile: $(STAGING_DIR)/usr/include/ncurses.h $(PKG_IPK)
106 install: $(IPKG_STATE_DIR)/info/$(PKG_NAME).list
107
108 clean:
109 rm -rf $(PKG_BUILD_DIR)
110 rm -f $(PKG_IPK)
This page took 0.056611 seconds and 5 git commands to generate.