Linux HOWTOs

About | Home | Search

HOWTO: newt
Description: Terminal-based window and widget library
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# newt 0.51.6
# ===========
# newt is a prerequisite of mondo, partimage, and a few other apps that I
# use.  I couldn't find a newt home page anywhere.  Below we take the
# source from one of the places that I found it.  I could grab some source
# rpm somewhere and rpm2tgz that, but I don't know which one is the "best"
# to use, so I'll pass on that for now.

# If you don't feel like dealing with the source, and you use Slackware,
# you'll find newt packages here:
# If you use an RPM-based distribution, try here:

# gnewt (a newt compatible library) is available from the mondorescue site
# (and used to be at
# I tried it once a while back and couldn't get it to compile.

# Prerequisites:
# rpm2targz from Slackware's "bin" package (and rpm, tar, ...)
# grep
# gpm (if you pass --with-gpm-support to configure)
# slang
# Python (if you want Python bindings)

# If you had previously installed newt from my mondorescue howto:
test -f installed/mondorescue/newt-0.51.6.tar.gz &&
 mv installed/mondorescue/newt-0.51.6.tar.gz .
rm -f installed/mondorescue/newt-*.tgz

# Re-use the tarball if you've got it, otherwise download the
# newt source rpm from Fedora Core 4 and convert it into a gzipped
# tarball.
test -f installed/newt-0.51.6.tar.gz &&
 mv installed/newt-0.51.6.tar.gz .
test ! -f newt-0.51.6.tar.gz &&
 ( test ! -f newt-0.51.6-7.src.rpm &&
    test -s ./newt-0.51.6-7.src.rpm && rpm2targz newt-0.51.6-7.src.rpm &&
     rm -f newt-0.51.6-7.src.rpm
    test -s ./newt-0.51.6-7.src.tar.gz && tar xzvf newt-0.51.6-7.src.tar.gz
    test -d ./newt-0.51.6-7 &&
     ( rm -f newt-0.51.6-7/newt.spec
       mv -f newt-0.51.6-7/* .
       rm -f newt-0.51.6-7.src.tar.gz
       rm -r ./newt-0.51.6-7 ) )

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "newt-*" -exec rm -r {} \;
tar xzvf ~/newt-0.51.6.tar.gz
cd newt-0.51.6
test $UID = 0 && chown -R root:root .

# Apply a patch that came with it:
test -f ~/newt-0.51.6-if1close.patch && mv ~/newt-0.51.6-if1close.patch .
patch -p1 < ./newt-0.51.6-if1close.patch

# If you want to build it with gpm support, pass --with-gpm to configure

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var

# Become root to install it

test -x /sbin/removepkg && /sbin/removepkg newt
rm -f /usr/lib/*
make install

# Become yourself again

rm -f installed/newt-*.tar.*
mv newt-0.51.6.tar.gz installed/

# If you ever want to uninstall newt, this should do it:
rm -f /usr/bin/whiptail /usr/include/newt.h /usr/lib/libnewt.*
( cd /usr/lib/python-2.4/site-packages ; rm -f )
find ~/src -maxdepth 1 -type d -name "newt-*" -exec rm -r {} \;
rm -f ~/installed/newt-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>