75ca074b4fd8e0ce3221db91b2d59391276b0e83
[openwrt/svn-archive/archive.git] / libs / ncurses / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=ncurses
12 PKG_VERSION:=5.2
13 PKG_RELEASE:=8
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@GNU/ncurses
18 PKG_MD5SUM:=464d6a49010cf2a6eb9ce59a264d4d47
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libncurses
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=Terminal handling library
29 DESCRIPTION:=Terminal handling library
30 URL:=http://www.gnu.org/software/ncurses/
31 endef
32
33 define Build/Configure
34 endef
35
36 define Build/Compile
37 rm -rf $(PKG_INSTALL_DIR)
38 mkdir -p $(PKG_INSTALL_DIR)
39 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
40 ./configure \
41 --target=$(GNU_HOST_NAME) \
42 --host=$(GNU_HOST_NAME) \
43 --build=$(GNU_HOST_NAME) \
44 --program-prefix="" \
45 --program-suffix="" \
46 --prefix=/usr \
47 --exec-prefix=/usr \
48 --bindir=/usr/bin \
49 --datadir=/usr/share \
50 --includedir=/usr/include \
51 --infodir=/usr/share/info \
52 --libdir=/usr/lib \
53 --libexecdir=/usr/lib \
54 --localstatedir=/var \
55 --mandir=/usr/share/man \
56 --sbindir=/usr/sbin \
57 --sysconfdir=/etc \
58 $(DISABLE_NLS) \
59 $(DISABLE_LARGEFILE) \
60 --enable-echo \
61 --enable-const \
62 --enable-overwrite \
63 --disable-rpath \
64 --without-ada \
65 --without-cxx \
66 --without-cxx-binding \
67 --without-debug \
68 --without-profile \
69 --with-progs \
70 --with-normal \
71 --without-shared \
72 --with-terminfo-dirs=/usr/share/terminfo \
73 --with-default-terminfo-dir=/usr/share/terminfo \
74 );
75 $(MAKE) -C $(PKG_BUILD_DIR) \
76 DESTDIR="$(PKG_INSTALL_DIR)" \
77 libs install.progs
78 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
79 $(TARGET_CONFIGURE_OPTS) \
80 CFLAGS="$(TARGET_CFLAGS)" \
81 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
82 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
83 ac_cv_linux_vers="2" \
84 ./configure \
85 --target=$(GNU_TARGET_NAME) \
86 --host=$(GNU_TARGET_NAME) \
87 --build=$(GNU_HOST_NAME) \
88 --program-prefix="" \
89 --program-suffix="" \
90 --prefix=/usr \
91 --exec-prefix=/usr \
92 --bindir=/usr/bin \
93 --datadir=/usr/share \
94 --includedir=/usr/include \
95 --infodir=/usr/share/info \
96 --libdir=/usr/lib \
97 --libexecdir=/usr/lib \
98 --localstatedir=/var \
99 --mandir=/usr/share/man \
100 --sbindir=/usr/sbin \
101 --sysconfdir=/etc \
102 $(DISABLE_NLS) \
103 $(DISABLE_LARGEFILE) \
104 --enable-echo \
105 --enable-const \
106 --enable-overwrite \
107 --disable-rpath \
108 --without-ada \
109 --without-cxx \
110 --without-cxx-binding \
111 --without-debug \
112 --without-profile \
113 --without-progs \
114 --with-normal \
115 --with-shared \
116 --with-terminfo-dirs=/usr/share/terminfo \
117 --with-default-terminfo-dir=/usr/share/terminfo \
118 );
119 $(MAKE) -C $(PKG_BUILD_DIR) \
120 $(TARGET_CONFIGURE_OPTS) \
121 BUILD_CC="$(TARGET_CC)" \
122 HOSTCC="$(HOSTCC)" \
123 HOSTCCFLAGS="" \
124 DESTDIR="$(PKG_INSTALL_DIR)" \
125 libs install.libs install.data
126 endef
127
128 define Package/libncurses/install
129 install -d -m0755 $(1)/usr/lib
130 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu}*.so.* $(1)/usr/lib/
131 install -d -m0755 $(1)/usr/share/terminfo
132 for file in a/ansi d/dumb l/linux r/rxvt s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
133 install -d -m0755 $(1)/usr/share/terminfo/`dirname $$$$file`; \
134 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
135 $(1)/usr/share/terminfo/$$$$file; \
136 done
137 endef
138
139 define Build/InstallDev
140 mkdir -p $(STAGING_DIR)/usr/include
141 $(CP) $(PKG_INSTALL_DIR)/usr/include/curses.h $(STAGING_DIR)/usr/include/
142 $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses.h $(STAGING_DIR)/usr/include/
143 $(CP) $(PKG_INSTALL_DIR)/usr/include/menu.h $(STAGING_DIR)/usr/include/
144 $(CP) $(PKG_INSTALL_DIR)/usr/include/panel.h $(STAGING_DIR)/usr/include/
145 $(CP) $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(STAGING_DIR)/usr/include/
146 $(CP) $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(STAGING_DIR)/usr/include/
147 mkdir -p $(STAGING_DIR)/usr/lib
148 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(STAGING_DIR)/usr/lib/
149 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu}.{a,so*} $(STAGING_DIR)/usr/lib/
150 endef
151
152 define Build/UninstallDev
153 rm -rf \
154 $(STAGING_DIR)/usr/include/curses.h \
155 $(STAGING_DIR)/usr/include/ncurses.h \
156 $(STAGING_DIR)/usr/include/menu.h \
157 $(STAGING_DIR)/usr/include/panel.h \
158 $(STAGING_DIR)/usr/include/term{,cap}.h \
159 $(STAGING_DIR)/usr/include/unctrl.h \
160 $(STAGING_DIR)/usr/lib/libcurses.so \
161 $(STAGING_DIR)/usr/lib/lib{ncurses,panel,menu}.{a,so*}
162 endef
163
164 $(eval $(call BuildPackage,libncurses))