[maemo-developers] [maemo-developers] Notes/Text editor

From: Eero Tamminen eero.tamminen at movial.fi
Date: Tue Aug 29 15:44:12 EEST 2006

There have been some mails about the Notes text editor so I thought
to mention that my own preferred "Notepad" clone is Leafpad.  I don't
need HTML subset (neither in my mails nor) when editing the text files
on the device, so Leafpad is just fine.  Especially as it's 100% Open
Source, quite lightweight and its Debian package builds just fine for

Attached are instructions on "porting" Leafpad to Maemo.

	- Eero

-------------- next part --------------

Clueful developer test

This test determines the competance level of a maemo-developer list
participant.  During the test you "port", build and install Leafpad
text editor to the N770 device.

The participant may ask questions from the other developers on the Maemo
mailing-list during the test.  If the mails trigger "non-social moron"
detector, the participant fails the test.  If the developers list / Maemo
SDK people are not able to help the participant to install the package
succesfully to the device, the developers-list fails the test.

The test ends with honours when the Leafpad package is succesfully
installed to the device, user can run (multiple instances of) it and
switch between the editor and the Desktop.

Before the test:
- Install ARMEL Scratchbox development environment as described
  in the Maemo 2.0 documentation

	Good luck!

The test:

# download the source packages for Leafpad from a Debian repo to some dir
# inside Sbox (the sources were found through packages.debian.org site):
mkdir test; cd test
wget http://ftp.debian.org/debian/pool/main/l/leafpad/leafpad_0.8.9-2.dsc
wget http://ftp.debian.org/debian/pool/main/l/leafpad/leafpad_0.8.9.orig.tar.gz
wget http://ftp.debian.org/debian/pool/main/l/leafpad/leafpad_0.8.9-2.diff.gz

# extract the sources:
dpkg-source -x leafpad_0.8.9-2.dsc
cd leafpad-0.8.9

# install leafpad build deps (you can see these from the debian/control file)
apt-get update
fakeroot apt-get install cdbs debhelper pkg-config libgtk2.0-dev gnome-pkg-tools

# resize icon to be suitable for Task Navigator, needs ImageMagick
# (you can install & use ImageMagick outside the Sbox):
convert -geometry '26x26!' leafpad.png tmp.png
mv tmp.png leafpad.png

# Modify the package so that it integrates with Task Navigator
# and Application Installer:
# 1) leafpad.desktop.in:
#   - add /usr/bin/ path to the Exec field leafpad binary name and
#     remove any args to it (Exec=/usr/bin/leafpad)
#   - remove the ".png" from the Icon field icon name (Icon=leafpad)
# 2) Makefile.am:
#   - change the desktopdir to $(datadir)/applications/hildon
#   - change the pixmapsdir to $(datadir)/icons/hicolor/26x26/hildon
# 3) debian/control:
#   - set "Section" field to value accepted by application manager
#     (Section=user/editors)
# (feel free to file bugs about above incompatibilities)

# Re-generate the Makefiles from the updated Makefile.am
aclocal && automake

# After install, make sure that the icon cache is updated
# (the same should also be in the postrm file).  If the package
# would already have a postinst file, just add the cache update
# line to it:
echo "#!/bin/sh" > debian/leafpad.postinst
echo gtk-update-icon-cache /usr/share/icons/hicolor >> debian/leafpad.postinst
echo "#DEBHELPER#" >> debian/leafpad.postinst

# Build the package:
fakeroot debian/rules binary

# copy the package to the device:
cp ../leafpad_0.8.9-2_armel.deb <mounted device MMC>

# Use the Application Installer to install Leafpad package
# and test it

Advanced topics

* Modify the sources so that:
  - The menubar is removed and menus open from the titlebar to save some
    screen space
  - Application acts as a D-BUS service and is launched by Task Navigator
    as such
    - Application is installed as the default mime-viewer for *.txt files
  For more info, see the maemo.org documentation
* Update the original Debian package so that it's diff contains your
  modifications and updated changelog (hints: use "dch -i" to update
  the changelog and note that "dpkg-buildpackage -rfakeroot" which
  normally generates a new diff, doesn't like about changes to binary
  files like icons).  For more info, see the Debian information


* Maemo/SDK 2.0:

* Debian New Maintainers' Guide:

* Debian Developer's Reference, Chapter 6 - Best Packaging Practices:

* (Old) documentation on GNU Autotools:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: leafpad-shot.png
Type: image/png
Size: 8622 bytes
Desc: not available
Url : http://lists.maemo.org/pipermail/maemo-developers/attachments/20060829/4d6d8ba6/attachment.png 
More information about the maemo-developers mailing list