Creating aspell dictionary packages for Ubuntu

There are many aspell dictionary packages available for Ubuntu, but not all of them. If you’re a somewhat esoteric project like Distributed Proofreaders, you may discover that you need things like the Latin aspell dictionary (aspell-la) which I can’t seem to find packaged anywhere.

Installing from source

It’s super easy and perfectly possible to install any of the aspell dictionaries directly. Just fetch the file, configure, make, and make install and you’re golden:

wget https://ftp.gnu.org/gnu/aspell/dict/la/aspell6-la-20020503-0.tar.bz2
tar xvfj aspell6-la-20020503-0.tar.bz2
cd aspell6-la-20020503-0
./configure
make
make install

The quick and dirty works but for systems maintained by multiple people it’s a recipe for disaster without a lot of documentation. How will someone remember that this needs to be done again for the next server upgrade or server migration? In these cases it’s usually best to create a system package and install the package.

Building & installing a package

Building a package for Ubuntu / Debian can be mind-boggling complicated when all you want to do is package up a few files to lay down on the filesystem. Luckily for aspell dictionaries we can easily borrow the template used by the aspell-en package.

Start by finding and downloading the aspell dictionary that you want to install from the list available and extracting it.

wget https://ftp.gnu.org/gnu/aspell/dict/la/aspell6-la-20020503-0.tar.bz2
tar xvfj aspell6-la-20020503-0.tar.bz2

Configure and build it to create the .rws file:

cd aspell6-la-20020503-0
./configure
make

Now head over to the aspell-en package on LaunchPad, to find and download the aspell-en_*.debian.tar.xz file from the Ubuntu version that most closely matches your own, then extract it into the the dictionary directory. This is the source file for the debian/ control directory used to build the aspell-en package, which we’ll use as a template for our own.

# from within aspell6-la-20020503-0/
wget https://launchpad.net/ubuntu/+archive/primary/+files/aspell-en_2017.08.24-0-0.1.debian.tar.xz
tar xvfJ aspell-en_2017.08.24-0-0.1.debian.tar.xz

This contains several files that we don’t need for our simple dictionary, so we can clean things up a bit. Keep in mind that we’re not creating a dictionary for distribution, just for ourselves, so this doesn’t have to be perfect.

cd debian
rm aspell-en.info-aspell changelog copyright extrawords.txt
cp ../COPYING copyright

You’ll need to update some of the files to reference your language, most of these are fairly straightforward:

  • control – Update references to aspell-en to your aspell dictionary; also update Maintainer and Description. You might need to change the debhelper version to whatever is installed on your system (Ubuntu 16.04 uses v9 not v10). If you change this, you should change it in compat too.
  • watch – Update the last line to point to where you got your aspell dictionary from — you probably just need to change the two instances of ‘en’ to your language’s code.

Three files require a little more finessing: installrules, and source/format.

The install file specifies which files should be copied into the package for installation. For reasons that I, frankly, just don’t understand, we need to specify that the .rws file needs to be installed. Your install file should look like this:

*.multi         usr/lib/aspell
*.alias         usr/lib/aspell
*.dat           usr/lib/aspell
*.rws           var/lib/aspell

The rules files is a makefile that does all of the heavy lifting for building the package. The version for aspell-en includes bits that we don’t care about, namely everything related to docs and extrawords, we can remove those and update the DICT_LANG which leaves us with:

#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk

DICT_LANG := la

DEB_DH_MD5SUMS_ARGS += -Xvar/lib/aspell

install/aspell-$(DICT_LANG)::
        for f in `LC_ALL=C ls *.cwl`; do \
            gzip -9 -n -c "$$f" > "$(DEB_DESTDIR)/usr/share/aspell/"$$f".gz"; \
            WL=`echo $$f | sed 's/\.cwl$$//'`; \
            touch "$(DEB_DESTDIR)/var/lib/aspell/$$WL.rws"; \
            dh_link "var/lib/aspell/$$WL.rws" "usr/lib/aspell/$$WL.rws"; \
            echo "$$WL" >> "$(DEB_DESTDIR)/usr/share/aspell/$(DICT_LANG).contents"; \
        done

        touch $(DEB_DESTDIR)/var/lib/aspell/$(DICT_LANG).compat

        installdeb-aspell

Note that the 8-space indents above should be tabs in your version — this is a makefile!

The final thing to do is change source/format to say we want to use the 1.0 version:

1.0

The last thing to do is to create the changelog file using dch. This file is used by the packager to determine the name and version of the package file. To keep things simple, I recommend sticking with the version from the source file itself, even if that differs from the normal Debian version format.

# from within aspell6-la-20020503-0/
dch --create -v 20020503-0 --package aspell-la

Now all that’s left is building the package:

# from within aspell6-la-20020503-0/
debuild -us -uc

If successful, this will put a aspell-la_20020503-0_all.deb file in the parent directory.

$ ls -1
aspell-la_20020503-0.dsc
aspell-la_20020503-0.tar.gz
aspell-la_20020503-0_all.deb
aspell-la_20020503-0_amd64.build
aspell-la_20020503-0_amd64.changes
aspell6-la-20020503-0
aspell6-la-20020503-0.tar.bz2

You can now install this via:

sudo apt install ./aspell-la_20020503-0_all.deb

Note, the ./ is required, otherwise it will look in the package catalog instead of on disk for the package.

You can test that your new dictionary works via:

$ echo hello | aspell list --lang=la

If that returns with “hello” as misspelled word, it worked. If you have problems, you can remove the package (sudo apt remove aspell-la), futz with some of the files, and try rebuilding it again. Things to watch out for are ensuring you’ve configured and make’d the package and that your changes to the install and rules files are correct.

Role models

“Who are my role models?” popped into my head about a week ago, for some reason only my subconscious understands, and it’s been an interesting question to ponder for the past several days. To the best of my memory I’ve never had explicit role models. No one that if asked I could readily respond with.

The more I thought about it, however, the more I realized that I have two implicit role models and I’d wager a pretty penny that until they read this they won’t have realized it either. Those people are John Martin and Jonobie Ford.

 

John Martin and I met while working at IBM on a remote assignment in Irvine, CA over 15 years ago. He’s about 20 years older than I am and yet we are more alike than different. We’re both gay, enjoy country western dancing, are frugal but not cheap, like reading and blogging, and more. We’re so alike in some ways that we affectionately refer to each other as BigMe and MiniMe.

In the gay community we often talk about living our authentic life, being who we are and not who others want us to be. John has always exemplified that. It was John that taught me that it really is OK to be out at work and that bringing your whole self to work is how you do your best work. Good employers recognize this. For me IBM sure did, as did Isilon/EMC, as does Spaceflight Industries. John inspired me to be very visibly out at work, to leverage my privilege to make it a safe place for others to be out as well.

I’ve learned other lessons from John too, like it’s OK to make big changes in your career, that it’s absolutely OK to have not just friendly but loving relationships with your ex-spouse, that living well below your means now opens up many doors in the future, that there’s no shame in trying something bold and changing paths when it wasn’t the right decision. But the one word that I keep coming back to with John, and what makes him a role model to me, is his authenticity.

 

I’ve known Jonobie Ford for almost 18 years now. We met at Tivoli, our first jobs after college. She was one of the very first people I came out to at work. One Friday afternoon, before the weekly beer bash, I asked her to take a stroll around the pond with me. I was a nervous wreck, terrified of being rejected. Jonobie accepted me with open arms and an hour later was ready to punch a guy on my behalf after he said some homophobic comment at the beer bash.

It isn’t her fierce friendship that makes her a role model to me, although she is my best friend, it’s her creativity and refusal to fit into anyone’s box.

I can’t even keep track of all the different kinds of creative endeavors Jonobie has done in her life so far. Drawing, pottery, dancing, brewing, aerial silks, knitting, and bartending just to name a few off the top of my head. At her encouragement I took my first pottery class 15 years ago and have been hooked ever since. We’ve brewed ginger beer and even taken a bellydance class together (yup, I’ve done bellydancing). Her stories of sketching encouraged me to take a chance on being a model myself. I might never have tried partner acrobatics and glassblowing were it not for catching a part of her adventurous spirit a decade ago. Being creative is just who Jonobie is, it isn’t something that gets tacked onto her life. She’s shown me that it’s more than OK to try some new creative endeavor, it’s part and parcel of living.

Jonobie doesn’t fit into any one, or anyone’s, box. She’s a woman in tech with bright pink hair. She’s insanely creative (see above) and runs races (we ran a marathon together!). She loves to travel internationally and quiet board game afternoons. She’s a feminist and very vocal LGBTQ+ ally. She’s done rock climbing, drawn models, done bow-and-arrow and gun target practice. She’s gone to Burning Man and a yoga retreat in Mexico. I’ve never known her to let anyone or anything dictate what she could and couldn’t do based on some stupid societal norm — and that’s inspiring.

So who cares if I want to present as a masculine gay man and also take bellydancing classes? Nothing’s going to stop me from helping the receptionist empty and reload the dishwasher at work even though some may see it as “beneath me”. Why should anyone care that I don’t drink alcohol or coffee because I can’t stand the taste? I workout 6 days a week, have 14.75″ biceps, and yet ugly cry while watching Moulin Rouge every. single. time. I don’t have to fit into anyone’s box either.

 

I suspect that neither John or Jonobie realize that I view them as role models, so clearly it’s possible to be a role model and not know it. That leads to the extremely scary possibility that I may be a role model for someone. If so, heaven help us all.

On being drawn

Earlier this week I modeled for a portrait artist almost, but not quite, in the buff.

S. Pettit is the artist behind the beefcake superheroes of Tumbled Heroes1. I connected with him on Instagram a couple of weeks ago and he asked if I was interested in being a model for some figure study sketches. I’d never been a model before although I have friends who have (Scott) and friends who have drawn models before (Jonobie) so this wasn’t completely foreign to me.

Much like my photoshoot a year and change ago, this was a chance for me to push outside my comfort zone and try something new. Since the photoshoot though, I’ve become much more comfortable in my own skin and how I look.

So one evening he came over for two hours and sketched me on his iPad while I stood and sat and reclined. We had a running conversation about all kinds of random things as I held still. After each pose he would show me the results and we’d move on to the next one. He sketched 5 poses total in a bit under 2 hours.

The next day I had an awesome sketch in my inbox. A couple of hours after that a portrait drawing appeared too. I was floored with the results! Wait — that’s me? It was an incredibly fun experience and I can easily see myself doing it again in the future.

It has become very clear to me over the past two years that we often see ourselves very differently than others do. It is fascinating to see yourself through someone else’s eyes.


1 That’s his Instagram account. His Tumblr account is semi-NSFW.