slitaz-doc-wiki-data view pages/en/scratchbook/base-ncurses.txt @ rev 45

Update pages/en folder.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun May 01 07:41:07 2011 +0000 (2011-05-01)
parents
children
line source
1 ====== Ncurses libraries and applications ======
3 Installation and configuration of ncurses libraries and applications.
5 ===== About =====
7 This chapter describes the construction and installation of some ncurses applications and libraries in SliTaz. The procedure consists of moving into the /src directory, downloading the sources for the application in question, unpacking, reading the README or INSTALL file(s), compiling and installing the binary in SliTaz. Once the applications are installed, we can create a new initramfs, copy it to the root of the cdrom and generate a new ISO image. For this you can also use "mktaziso" in [[http://doc.slitaz.org/en:cookbook:slitaztools|SliTaz tools]].
9 ==== Assign an environment variable ($fs) ====
11 An environmental variable can't specify the path to the directory, just the name of the directory. We will affect a variable '$fs' to indicate the path to the root filesystem (rootfs). To do this, we venture into the working directory SliTaz/, and type:
13 # export fs=$PWD/rootfs
15 To check:
17 # echo $fs
19 ===== ncurses-5.6 - Terminal utilities and libraries =====
21 ncurses ([[http://dickey.his.com/ncurses/|dickey.his.com/ncurses/]]) contains functions to display text in different ways on the screen of a Linux terminal and also provides the terminfo file. Ncurses libraries are used among others by retawq, nano and some games. We install the libraries in /lib and the rest in /usr/bin with a small strip to clean the executables:
23 # cd src
24 # wget ftp://invisible-island.net/ncurses/ncurses-5.6.tar.gz
25 # tar xzf ncurses-5.6.tar.gz
26 # cd ncurses-5.6
27 # ./configure --prefix=/usr \
28 --libdir=/lib --sysconfdir=/etc \
29 --infodir=/usr/share/info --mandir=/usr/share/man \
30 --with-shared --without-debug --without-ada
31 # make
32 # make DESTDIR=$PWD/_pkg install
33 # strip -v _pkg/lib/*
34 # strip -v _pkg/usr/bin/*
36 Copy the libncurses library and some applications in SliTaz. The reset utility is used at the end of the rcS initialization script to remove the Linux logo. If you wish, you can copy the associated utilities (tic, tack, toe, etc), being careful not to delete the link to BusyBox:
38 # cp -a _pkg/lib/libncurses.so* $fs/lib
39 # cp -ia _pkg/usr/bin/{clear,ncurses5-config,tset,reset} \
40 $fs/usr/bin
42 Copy terminfo files, we only use a few files. If you want more, you can copy:
44 # mkdir -v $fs/usr/share/terminfo
45 # mkdir -v $fs/usr/share/terminfo/{a,l,r,v,x}
46 # cp _pkg/usr/share/terminfo/a/ansi \
47 $fs/usr/share/terminfo/a
48 # cp _pkg/usr/share/terminfo/l/linux \
49 $fs/usr/share/terminfo/l
50 # cp _pkg/usr/share/terminfo/r/rxvt \
51 $fs/usr/share/terminfo/r
52 # cp _pkg/usr/share/terminfo/x/{xterm,xterm-color,xterm-new,xterm-vt220} \
53 $fs/usr/share/terminfo/x
54 # cp _pkg/usr/share/terminfo/v/{vt100,vt102*} \
55 $fs/usr/share/terminfo/v
57 Copy the tabset files:
59 # cp -a _pkg/usr/share/tabset $fs/usr/share
61 ===== clex-3.16 - File Manager =====
63 CLEX (http://www.clex.sk/) is a small ncurses file manager (160 KB). The configuration file (rc) is ~/clexrc; ~/.clexbm is used for bookmarks:
65 # cd ..
66 # wget http://www.clex.sk/download/clex-3.16.tar.gz
67 # tar xzf clex-3.16.tar.gz
68 # cd clex-3.16
69 # ./configure --prefix=/usr --infodir=/usr/share/info \
70 --mandir=/usr/share/man
71 # make
72 # make DESTDIR=$PWD/_pkg install
73 # strip -v _pkg/usr/bin/clex
75 Install the clex binary in the rootfs of SliTaz:
77 # cp _pkg/usr/bin/clex $fs/usr/bin
79 ==== libs ====
81 If we execute the "ldd" command on clex, the following dependancies should be displayed:
82 <file>
83 libncurses.so.5 => /lib/libncurses.so.5 (0x40025000)
84 libc.so.6 => /lib/libc.so.6 (0x40064000)
85 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
86 </file>
87 ===== nano-2.0.6 - Advanced Text Editor =====
89 GNU nano ([[http://www.nano-editor.org/|www.nano-editor.org]]) is a well known, fast, effective GNU/Linux text editor that supports colored syntax. This is the default text editor in SliTaz:
91 # cd ..
92 # wget http://www.nano-editor.org/dist/v2.0/nano-2.0.6.tar.gz
93 # tar xzf nano-2.0.6.tar.gz
94 # cd nano-2.0.6
95 # ./configure --enable-all --enable-extra --prefix=/usr \
96 --infodir=/usr/share/info --mandir=/usr/share/man \
97 --sysconfdir=/etc
98 # make
99 # make DESTDIR=$PWD/_pkg install
100 # strip -v _pkg/usr/bin/nano
102 Copy the nano binary and the rnano link in SliTaz:
104 # cp -a _pkg/usr/bin/* $fs/usr/bin
106 Copy the configuration files in _pkg/usr/share/nano to our rootfs:
108 # cp -a _pkg/usr/share/nano $fs/usr/share
110 ==== libs ====
112 If we execute the "ldd" command on nano, the following dependancies should be displayed:
113 <file>
114 libncurses.so.5 => /lib/libncurses.so.5 (0x40025000)
115 libc.so.6 => /lib/libc.so.6 (0x40064000)
116 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
117 </file>
118 ==== locale ====
120 About the language, you can copy the .mo files created when installing nano from /usr/share/locale/(fr,en,de,es,etc)/LC_MESSAGES to the rootfs. Example for the French language:
122 # cp -a _pkg/usr/share/locale/fr/LC_MESSAGES $fs/usr/share/locale/fr
124 ==== Customize nano ====
126 You can customize nano via /etc/nanorc or ~/.nanorc for each user of the system. It's in this file that you can define the colors used by nano through the files in /usr/share/nano. You will find a broad example of this file in the archive of nano and [[http://doc.slitaz.org/en:cookbook:slitaztools|SliTaz tools]].
128 For a system configuration file, you can copy the file in SliTaz tools to /etc in the rootfs:
130 # cd ..
131 # cp -a slitaz-tools-1.1/etc/nanorc $fs/etc
133 ===== retawq-0.2.6c - Text mode Web browser =====
135 retawq ([[http://retawq.sourceforge.net/|retawq.sourceforge.net]]) is a small text-only web browser. We only flag a few useful options when configuring, retawq needs terminfo files, libncurses libraries and libthread:
137 # wget http://switch.dl.sourceforge.net/sourceforge/retawq/retawq-0.2.6c.tar.gz
138 # tar xzf retawq-0.2.6c.tar.gz
139 # cd retawq-0.2.6c
140 # ./configure --enable-i18n --enable-local-cgi --path-prefix=/usr \
141 --path-doc=/usr/share/doc/retawq --path-man=/usr/share/man
142 # make
143 # strip -v retawq
145 Copy the retawq binary in SliTaz:
147 # cp retawq $fs/usr/bin
149 ==== libs ====
150 <file>
151 libncurses.so.5 => /lib/libncurses.so.5 (0x40025000)
152 libpthread.so.0 => /lib/libpthread.so.0 (0x40064000)
153 libc.so.6 => /lib/libc.so.6 (0x40074000)
154 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
155 </file>
156 You can copy the lipthread library from your host system or use the minimum package glibc-2.3.6 distributed by SliTaz:
158 # cp -a /lib/libpthread* $fs/lib
159 # strip --strip-unneeded $fs/lib/*
161 ==== locale ====
163 For language, you can copy the .mo files in /i18n of the retawq archive to /usr/share/locale/(fr,en,es,etc)/LC_MESSAGES. Example for the French language, renaming the file to retawq.mo:
165 # cp -v i18n/fr.mo $fs/usr/share/locale/fr/LC_MESSAGES/retawq.mo
167 ==== Customize retawq ====
169 To personalize retawq, you can use a ~/.retawq directory containing a config file. You can also save bookmarks (html) in the root directory of the user. You will find an examples/ in the archive of retawq (or SliTaz tools) containing a bookmarks.html page with a list of favorite web sites. You can also copy the docs (/documents) from retawq to /usr/share/doc/retawq.
171 ===== htop-6.0.5 - System process viewer =====
173 htop ([[http://htop.sourceforge.net/|htop.sourceforge.net/]]) is software that displays system processes using ncurses.
175 Returning to the /src directory, download, unpack, configure, compile and clean (with strip):
177 # cd ..
178 # wget http://switch.dl.sourceforge.net/sourceforge/htop/htop-0.6.5.tar.gz
179 # tar xzf htop-0.6.5.tar.gz
180 # cd htop-0.6.5
181 # ./configure --prefix=/usr --mandir=/usr/share/man
182 # make
183 # make DESTDIR=$PWD/_pkg install
184 # strip -v _pkg/usr/bin/htop
186 Copy the htop binary in SliTaz:
188 # cp _pkg/usr/bin/htop $fs/usr/bin
190 You can still copy the htop icon found in: _pkg/usr/share/pixmaps.
192 ==== libs ====
193 <file>
194 libm.so.6 => /lib/libm.so.6 (0xb7f97000)
195 libncurses.so.5 => /lib/libncurses.so.5 (0xb7f55000)
196 libc.so.6 => /lib/libc.so.6 (0xb7e20000)
197 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fc9000)
198 </file>
199 ===== dialog-1.1.20070409 - GUI shell scripts =====
201 dialog ([[http://invisible-island.net/dialog/dialog.html|invisible-island.net/dialog/dialog.html]]), is a utility to build GUI-based consoles:
203 # cd ..
204 # wget ftp://invisible-island.net/dialog/dialog.tar.gz
205 # tar xzf dialog.tar.gz
206 # cd dialog-1.1-20070409
207 # ./configure --enable-nls --with-ncurses --prefix=/usr \
208 --sysconfdir=/etc --mandir=/usr/share/man
209 # make
210 # make DESTDIR=$PWD/_pkg install
211 # strip -v _pkg/usr/bin/dialog
213 Copy dialog binary in SliTaz:
215 # cp _pkg/usr/bin/dialog $fs/usr/bin
217 ==== libs ====
218 <file>
219 libncurses.so.5 => /lib/libncurses.so.5 (0x40027000)
220 libm.so.6 => /lib/libm.so.6 (0x40066000)
221 libc.so.6 => /lib/libc.so.6 (0x40089000)
222 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
223 </file>
224 ==== locale ====
226 You can install locale files if you wish:
228 # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
230 The dialog configuration file is /etc/dialogrc and/or ~/.dialogrc for each user. There are also full examples of scripts in the /sample directory in the sources of dialog.
232 ===== Ninvaders-0.1.1 - Space Invaders clone =====
234 ninvaders (http://ninvaders.sourceforge.net/) is a clone of the popular Space Invaders game (46 KB). We begin by placing ourselves in the /src directory, then we download, untar, compile, clean using strip and copy the nInvaders binary in /usr/games of SliTaz:
236 # cd ..
237 # wget http://ovh.dl.sourceforge.net/sourceforge/ninvaders/ninvaders-0.1.1.tar.gz
238 # tar xzf ninvaders-0.1.1.tar.gz
239 # cd ninvaders-0.1.1
240 # make
241 # strip -v nInvaders
242 # cp nInvaders $fs/usr/games
244 ===== bastet-0.41 - Bastard Tetris clone =====
246 A game of Tetris (17 KB):
248 # wget http://fph.altervista.org/prog/bastet-0.41.tgz
249 # tar xzf bastet-0.41.tgz
250 # cd bastet-0.41
251 # make
252 # strip bastet
253 # cp bastet $fs/usr/games
254 # mkdir -p $fs/var/games
255 # touch $fs/var/games/bastet.scores
256 # chmod 666 $fs/var/games/bastet.scores
258 ===== rhapsody-0.28b - IRC chat client =====
260 Rhapsody (http://rhapsody.sourceforge.net/) is a fast and lightweight chat client supporting the IRC protocol. It provides a menu for managing servers, channels and configuration. It is therefore easy to use:
262 # cd ..
263 # wget http://switch.dl.sourceforge.net/sourceforge/rhapsody/rhapsody_0.28b.tgz
264 # tar xzf rhapsody_0.28b.tgz
265 # cd rhapsody-0.28b
266 # ./configure -i /usr/bin -d /usr/share/doc/rhapsody
267 # make
268 # strip -v rhapsody
270 Install the binary and help files in SliTaz. We must adjust permissions on these files so that everyone can read:
272 # cp rhapsody $fs/usr/bin
273 # mkdir $fs/usr/share/doc/rhapsody
274 # cp -a help $fs/usr/share/doc/rhapsody/help
275 # chmod 644 $fs/usr/share/doc/rhapsody/help/*
277 ==== libs ====
279 Rhapsody uses the following libraries:
280 <file>
281 libncurses.so.5 => /lib/libncurses.so.5 (0x40026000)
282 libc.so.6 => /lib/libc.so.6 (0x40066000)
283 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000))
284 </file>
285 ==== Rhapsody use the following libraries: ====
287 You can customize rhapsody via ~/.rhapsodyrc or use <Ctrl+T> for options:
289 ===== Generate the initramfs and an ISO image =====
291 To create a new ISO image, you can use 'mktaziso' in SliTaz tools. Or you can create a new initramfs image, copy it to /boot in the root of the cdrom (rootcd) and finally generate an ISO image with genisoimage:
293 # cd $fs
294 # find . -print | cpio -o -H newc | gzip -9 > ../rootfs.gz
295 # cd ..
296 # cp rootfs.gz rootcd/boot
297 # genisoimage -R -o slitaz-cooking.iso -b boot/isolinux/isolinux.bin \
298 -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
299 -V "SliTaz" -input-charset iso8859-1 -boot-info-table rootcd
301 ==== Following chapter ====
303 The next chapter describes the installation of the [[locale|locales]] and i18n.