Contents

I have been using leafpad for over 10 years but don't know how much longer I will be able to continue.

I created a manpage for leafpad. I created a html static version on my blog of the man page rendered by the man.gci-pl script on my sites.

I started using leafpad when it was the default text editor on PCLinuxOS 2010. I liked that it was lightweight and started up quickly. At that time I was working at Arctic Region Supercomputing Center (ARSC) and the Department of Defense (DoD) High Performance Computing Modernization Program (HPCMP). By the next year I had installed it in my ~/bin on machines all over the country. The program worked with just the executable as long as gtk2 was installed. It was a graphical text editor I could use over the internet on machines thousands of miles away.

Today I use in on my AWS instances, I am usually at my home and the AWS instances are in the Oregon region but have also used it while on vacation in Cabo San Lucas over the resort wireless.

The leafpad page on wikipedia still says the latest stable release in 0.8.18.1 released December 23, 2010, 11 years ago in 2022. I found a GitHub repo where the old 0.8.18.1 version was brought in 3 years ago and a couple of patches were applied. GTK 2 is a requirement for building and running leafpad. GTK (formerly GIMP ToolKit) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs).

As of the summer of 2022 GTK 2 is still available on most machines but in general they have GTK 3 installed by default and GTK 4 is the current development version. Besides GTK there are autoconf and make warnings from the use of depreciated features but the program still compiles.

Install leafpad from git repo

RD # Set the remote directory - create if necessary

Install prerequisites for the build

This is the process I used in 2022 to compile leafpad on an AWS instance. I currently launch either the latest Ubuntu Server or Amazon Linux 2 instance type. The newest Ubuntu Server is 22.04 and I have previously built on the 20.04 and 16.04 versions. The Amazon Linux 2 OS is like CentOS in that it is based on RHEL but does not include the RHEL service support license (or associated costs).

Linux Mint is based on Ubuntu so the tar archive for installation on Ubuntu can also be used on Linux Mint.

Install on Ubuntu Server 22.04

sudo apt-get -y install gcc intltool libgtk2.0-dev 2>&1 \
| tee ${RD}/${HOST}-install-gcc-intltool-gtk2-devel-$(date +'%H%M').txt

The libgtk2.0-0 package is required at runtime by leafpad compiled for Ubuntu Server 22.04.

dist='Ubuntu-22-04'
sudo chown ubuntu:ubuntu /usr/local/src

Install on Amazon Linux 2

sudo yum -y install gcc intltool gtk2-devel 2>&1 \
| tee ${RD}/${HOST}-install-gcc-intltool-gtk2-devel-$(date +'%H%M').txt

The gtk2 package is required at runtime by leafpad compiled for Amazon Linux 2.

dist='Amazon-Linux-2'
sudo chown ec2-user:ec2-user /usr/local/src

Clone the leafpad git repository

cd /usr/local/src
git clone git@github.com:tarot231/leafpad 2>&1 \
| tee ${RD}/${HOST}-leafpad-clone-$(date +'%H%M').txt
cd /usr/local/src/leafpad

We must build the .configure file when we install from the git repository.

autoreconf --install 2>&1 \
| tee ${RD}/${HOST}-leafpad-autoreconf-install-$(date +'%H%M').txt

modified INSTALL or README instructions

Add a temporary library prefix so we can build a tar archive that can be used to install the program and associated files.

./configure --prefix=/tmp/leafpad 2>&1 \
| tee ${RD}/${HOST}-leafpad-configure-$(date +'%H%M').txt
make 2>&1 \
| tee ${RD}/${HOST}-leafpad-make-$(date +'%H%M').txt
make install 2>&1 \
| tee ${RD}/${HOST}-leafpad-make-install-$(date +'%H%M').txt

Create a tar archive for install on instance launch

cd /tmp/leafpad

Add the manpage not included in the build

mkdir -p share/man/man1
cp /var/www/aws/leafpad.1 /tmp/leafpad/share/man/man1/
gzip /tmp/leafpad/share/man/man1/leafpad.1
tar -cvzf /mnt/efs/aws-lam1-ubuntu/leafpad-${dist}.tgz *

Install the application and help page from the tar archive

The application can be installed in /usr/local to be available to all users or in ~/bin for use by that user.

target=/usr/local
target=${HOME}
sudo tar -xzf /mnt/efs/aws-lam1-ubuntu/leafpad-${dist}.tgz \
--directory ${target}

The archive can be used to list the installed files:

cd ${target}
tar -tzf /mnt/efs/aws-lam1-ubuntu/leafpad-${dist}.tgz \
| xargs ls -ldF --time-style=long-iso

The tar archive built with these instructions is used in the following CloudInit user data files:

Log

  • Friday, July 22, 2022 Add Ubuntu 22.04 install section
    • Include the man page in the tar archive.
  • On Wednesday, July 20, 2022 I compiled a new version for use on Amazon Linux 2.
  • 6/27/2020 When I upgraded ak17 and ak16 I saw leafpad remains and still works.
    • Based on that I decided I need to compile leafpad from source on Ubuntu 20.04 for use on Linux Mint 20 and Ubuntu 20.04 instances. I launched a fresh lam1 instance which is now on Ubuntu 20.04 to do the compile.
    • From my previous notes I knew I need the GNU C Compiler suite, intltool and gtk2 development. I had to search to find the appropriate package for gtk2 development.
    • apt-cache search gtk2 | grep dev
  • 6/20/2020 Ubuntu 20.04 and Linux Mint 20 no longer include Leafpad in the default repositories.
    • The Wikipedia Leafpad page says FeatherPad replaced Leafpad after 18.04 of Lubuntu. I also says Stable release: 0.8.18.1 / December 23, 2010; 9 years ago
    • I decided I did not want to even try to compile this and installed FeatherPad. I then decided xed works as well.
  • 10/16/2011 I was able to install leafpad from source on lam-ak-8, CentOS Linux release 6.0 (Final), after installing some prerequisites.
  • 2/14/2011 I have distributed the binary compiled on pacman to my ~/bin on DoD HPC machines.
    • I note the response time from akutil in Vicksberg is noticeably slow.
  • 12/13/2010 I compile make and install on moose a new Arctic Region Supercomputing Center academic machine.
  • 5/29/2010 leafpad is the default text editor on PCLinuxOS 2010
    • I had in knoppix before this.


up Top of this document up Page updated Saturday, July 23, 2022 @ 3:42:24 PM (Alaska Time)