f61222c83feb6aebbab502dea5e2eb4aa8fa7ed9
[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 rm -f $(PKG_BUILD_DIR)/lib/lib*
120 $(MAKE) -C $(PKG_BUILD_DIR) \
121 $(TARGET_CONFIGURE_OPTS) \
122 BUILD_CC="$(TARGET_CC)" \
123 HOSTCC="$(HOSTCC)" \
124 HOSTCCFLAGS="" \
125 DESTDIR="$(PKG_INSTALL_DIR)" \
126 libs install.libs install.data
127 endef
128
129 define Package/libncurses/install
130 install -d -m0755 $(1)/usr/lib
131 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu}*.so.* $(1)/usr/lib/
132 install -d -m0755 $(1)/usr/share/terminfo
133 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
134 for dir in ??; do \
135 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
136 done \
137 )
138 for file in a/ansi d/dumb l/linux r/rxvt s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
139 install -d -m0755 $(1)/usr/share/terminfo/`dirname $$$$file`; \
140 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
141 $(1)/usr/share/terminfo/$$$$file; \
142 done
143 endef
144
145 define Build/InstallDev
146 mkdir -p $(STAGING_DIR)/usr/include
147 $(CP) $(PKG_INSTALL_DIR)/usr/include/curses.h $(STAGING_DIR)/usr/include/
148 $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses.h $(STAGING_DIR)/usr/include/
149 $(CP) $(PKG_INSTALL_DIR)/usr/include/menu.h $(STAGING_DIR)/usr/include/
150 $(CP) $(PKG_INSTALL_DIR)/usr/include/panel.h $(STAGING_DIR)/usr/include/
151 $(CP) $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(STAGING_DIR)/usr/include/
152 $(CP) $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(STAGING_DIR)/usr/include/
153 $(CP) $(PKG_INSTALL_DIR)/usr/include/form.h $(STAGING_DIR)/usr/include/
154 $(CP) $(PKG_INSTALL_DIR)/usr/include/eti.h $(STAGING_DIR)/usr/include/
155 mkdir -p $(STAGING_DIR)/usr/lib
156 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(STAGING_DIR)/usr/lib/
157 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*} $(STAGING_DIR)/usr/lib/
158 endef
159
160 define Build/UninstallDev
161 rm -rf \
162 $(STAGING_DIR)/usr/include/curses.h \
163 $(STAGING_DIR)/usr/include/ncurses.h \
164 $(STAGING_DIR)/usr/include/menu.h \
165 $(STAGING_DIR)/usr/include/panel.h \
166 $(STAGING_DIR)/usr/include/term{,cap}.h \
167 $(STAGING_DIR)/usr/include/unctrl.h \
168 $(STAGING_DIR)/usr/lib/libcurses.so \
169 $(STAGING_DIR)/usr/lib/lib{ncurses,panel,menu}.{a,so*}
170 endef
171
172 $(eval $(call BuildPackage,libncurses))