After creating some more extensions today I wondered if I could manage to make the process of creating an extension from source easier and more feasible.
I created a makefile based approach which I want to share with you.
I attached an Makefile to include - and an example file to see it's use (sox.mk).
All you have to do, to get an extension is write down 5 lines of configuration like this (from sox.mk):
EXT=sox
VERSION=14.3.1
SITE=http://sourceforge.net/projects/sox/files/sox/$(VERSION)/
CONFIG=--prefix=/usr/local --with-distro="Tiny Core Linux" --with-dyn-default
TCEs=libid3tag libid3tag-dev libvorbis-dev libao-dev libsndfile-dev flac-dev wavpack wavpack-dev libtool-dev libltdl alsa-dev
include make_tc_extension.mk
Here I configure the name of the extension, the current version, an url to download from, configure options and extensions needed to compile. On the last line I include the helper makefile, where all the magic happens.
When I run
make -f sox.mk
it will download and load the needed extensions, download, extract and configure the source in a folder named after the extension to create (here sox), make, make install into sox/package and download the current sox.tcz.info file and update version and size in it.
Then I can update the changelog in the info file and the dep file and then issue
make -f sox.mk crypt
which will create an archive containing *.tcz* and crypt it afterwards.
If I'll do this for a package new to tc, I'll get a stub info file, will fill in the information, create the dep file and I'm done too.
In depth documentation is in the make_tc_extension.mk file which is pretty straight forward I think.
It is possible to run single steps seperated, e.g. configure to get the right options by
make -f sox.mk configure
I wondered whether it would be usefull to create such files for every extension when it's created or updated. That way build dependencies and source locations would not only be documented but also runnable. In most cases an update would only need a change in the VERSION and a rebuild, which is easy to do.
Try it and let me here your criticism
Maybe this idea can be further enhanced?
Edit:
- 2010/12/31 Fixed small error in creating an infofile when none existed which didn't work
- 2011/01/01 Added an alternative install option for packages not supporting DESTDIR, removed quiet from make
- 2011/01/01 Corrected bad else block
Feature ideas:
- Automatic sepration of locale and documentation data into separate extensions
- Automatic inclusion of icon and menu entry (how to get them from existent extensions? Maybe save the source images in the repository?)