Uploading an autotools-based distribution onto CPANBackground
It is a pain to create binary packages. But installing a program from source tarball is a tedious task. You need to run ./configure & make && make install. Sometimes you need to resolve the dependencies by hand as well. That's where source-code-based package distribution systems come in, and the largest system is, IMHO, CPAN. If you could upload a autotools-based distribution onto CPAN, then the users of the software can install them with the cpan command (or cpanp or cpanf or whatever), with the dependencies automatically resolved.
And for my case, it was considered especially benefitial, since the program I am now working on (it's called incline, a replicator for RDB shards using MySQL or PostgreSQL), uses perl scripts for running tests. By distributing incline through CPAN, the perl modules required for running the test suite could be installed automatically. Besides that, the expected users of the software outside my company are mostly perl users.
So I adjusted the files of incline so that it can be uploaded to CPAN (it continues to work as a normal autotools-based distribution as well). The steps were as follows (for a working example, please see incline - search.cpan.org).
Step 1. write META.yml generator
CPAN packages should contain a file call META.yml which describes the metainformation of the package like dependencies, etc. Since it would be a good idea to fill-in some fields of the file by reading other files of the distribution, I wrote a script file (META.yml.pl) that generates META.yml. As you can see, it is pretty straightforward. O
View Comments (0)
Post a comment