Change ncurses packaging
[openwrt.git] / openwrt / package / ncurses / ipkg / rules
1 #!/usr/bin/make -f
2
3 ifneq ($(strip ${IPKG_RULES_INC}),)
4 include $(IPKG_RULES_INC)
5 endif
6
7 ##
8
9 PKG_VERSION := $(shell cat ./ipkg/version)
10 CURRENT_DIR := $(shell pwd)
11 INSTALL_DIR ?= $(CURRENT_DIR)/ipkg-install
12
13 unexport INSTALL_DIR
14
15 I_LIBNCURSES := ipkg/libncurses
16 I_LIBNCURSES_DEV := ipkg/libncurses-dev
17 I_NCURSES_TERM := ipkg/ncurses-term
18
19 BUILD_DEPS := \
20
21 CONFIGURE_OPTS = \
22 --with-terminfo-dirs=/usr/share/terminfo \
23 --with-default-terminfo-dir=/usr/share/terminfo \
24 --without-ada \
25 --without-cxx \
26 --without-cxx-binding \
27 --without-progs \
28 --without-profile \
29 --without-debug \
30 --disable-rpath \
31 --enable-echo \
32 --enable-const \
33 --enable-overwrite \
34 --with-shared \
35 --with-normal \
36 ##
37
38 all: package
39
40
41 .stamp-configured: $(BUILD_DEPS)
42
43 rm -rf config.cache
44 $(TARGET_CONFIGURE_OPTS) \
45 CFLAGS="$(TARGET_CFLAGS)" \
46 ac_cv_linux_vers="2" \
47 ./configure \
48 --target=$(GNU_TARGET_NAME) \
49 --host=$(GNU_TARGET_NAME) \
50 --build=$(GNU_HOST_NAME) \
51 --program-prefix="" \
52 --program-suffix="" \
53 --prefix=/usr \
54 --exec-prefix=/usr \
55 --bindir=/usr/bin \
56 --datadir=/usr/share \
57 --includedir=/usr/include \
58 --infodir=/usr/share/info \
59 --libdir=/usr/lib \
60 --libexecdir=/usr/lib \
61 --localstatedir=/var \
62 --mandir=/usr/share/man \
63 --sbindir=/usr/sbin \
64 --sysconfdir=/etc \
65 $(DISABLE_LARGEFILE) \
66 $(DISABLE_NLS) \
67 $(CONFIGURE_OPTS) \
68
69 touch .stamp-configured
70
71
72 .stamp-built: .stamp-configured
73
74 $(MAKE) \
75 $(TARGET_CONFIGURE_OPTS) \
76 BUILD_CC="$(TARGET_CROSS)gcc" \
77 HOSTCC="$(HOSTCC)" \
78 HOSTCCFLAGS="\$$(CPPFLAGS)" \
79
80 touch .stamp-built
81
82
83 $(INSTALL_DIR)/usr/include/ncurses.h: .stamp-built
84
85 mkdir -p $(INSTALL_DIR)
86
87 $(MAKE) \
88 DESTDIR="$(INSTALL_DIR)" \
89 install
90
91
92 configure: .stamp-configured
93
94
95 build: .stamp-built
96
97
98 install: $(INSTALL_DIR)/usr/include/ncurses.h
99
100
101 package: $(INSTALL_DIR)/usr/include/ncurses.h
102
103 mkdir -p $(I_LIBNCURSES)/usr/lib
104 cp -fpR $(INSTALL_DIR)/usr/lib/libncurses*.so.* $(I_LIBNCURSES)/usr/lib/
105 cp -fpR $(INSTALL_DIR)/usr/lib/libpanel*.so.* $(I_LIBNCURSES)/usr/lib/
106 $(STRIP) $(I_LIBNCURSES)/usr/lib/*
107
108 mkdir -p $(I_LIBNCURSES_DEV)/usr/include
109 cp -fpR $(INSTALL_DIR)/usr/include/curses.h $(I_LIBNCURSES_DEV)/usr/include/
110 cp -fpR $(INSTALL_DIR)/usr/include/ncurses.h $(I_LIBNCURSES_DEV)/usr/include/
111 cp -fpR $(INSTALL_DIR)/usr/include/panel.h $(I_LIBNCURSES_DEV)/usr/include/
112 mkdir -p $(I_LIBNCURSES_DEV)/usr/lib
113 cp -fpR $(INSTALL_DIR)/usr/lib/libncurses.a $(I_LIBNCURSES_DEV)/usr/lib/
114 cp -fpR $(INSTALL_DIR)/usr/lib/libpanel.a $(I_LIBNCURSES_DEV)/usr/lib/
115 cp -fpR $(INSTALL_DIR)/usr/lib/libncurses*.so* $(I_LIBNCURSES_DEV)/usr/lib/
116 cp -fpR $(INSTALL_DIR)/usr/lib/libpanel*.so* $(I_LIBNCURSES_DEV)/usr/lib/
117
118 mkdir -p $(I_NCURSES_TERM)/usr/share/terminfo
119 for f in a/ansi d/dumb l/linux s/screen v/vt100; do \
120 mkdir -p $(I_NCURSES_TERM)/usr/share/terminfo/`dirname $${f}`; \
121 cp -fpR \
122 $(INSTALL_DIR)/usr/share/terminfo/$${f} \
123 $(I_NCURSES_TERM)/usr/share/terminfo/$${f}; \
124 done
125
126 chmod 0755 ipkg/*/CONTROL/
127 chmod 0644 ipkg/*/CONTROL/control
128
129 perl -pi -e "s/^Arch.*:.*/Architecture: $(ARCH)/g" ipkg/*/CONTROL/control
130 ifneq ($(strip $(PKG_VERSION)),)
131 perl -pi -e "s/^Vers.*:.*/Version: $(PKG_VERSION)/g" ipkg/*/CONTROL/control
132 endif
133
134 $(IPKG_BUILD) $(I_LIBNCURSES) $(IPKG_TARGET_DIR)
135 $(IPKG_BUILD) $(I_LIBNCURSES_DEV) $(IPKG_TARGET_DIR)
136 $(IPKG_BUILD) $(I_NCURSES_TERM) $(IPKG_TARGET_DIR)
137
138
139 clean:
140
141 -$(MAKE) \
142 DESTDIR="$(INSTALL_DIR)" \
143 uninstall clean
144
145 rm -rf .stamp-* \
146 $(I_LIBNCURSES)/usr \
147 $(I_LIBNCURSES_DEV)/usr \
148 $(I_NCURSES_TERM)/usr \
149
150
151 control:
152
153 @cat $(I_LIBNCURSES)/CONTROL/control
154 @echo
155 @cat $(I_LIBNCURSES_DEV)/CONTROL/control
156 @echo
157 @cat $(I_NCURSES_TERM)/CONTROL/control
158 @echo
159
160
161 .PHONY: configure build install package clean control
This page took 0.04851 seconds and 5 git commands to generate.