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