Task: create a debian package for the CPAN perl module ACME-QuoteDB.
From the Docs:
ACME::QuoteDB − API implements CRUD for a Collection of Quotes (adages/proverbs/sayings/epigrams, etc)
This module provides an easy to use programmitic interface to a database (sqlite3 or mysql) of ’quotes’. (any content really, that can fit into our "defined format")
For simplicty you can think of it as a modern fancy perl version of fortune (with a management interface, remote database connection support, plus additional features and some not (yet) supported)
Supported actions include: (CRUD)
> Create
* Adding quote(s)
* ’Batch’ Loading quotes from a file (stream, other database, etc)
> Read
* Displaying a single quote, random or based on some criteria
* Displaying multiple quotes, based on some criteria
* Displaying a specific number of quotes, based on some search criteria
> Update
* Update an existing quote
> Delete
* Remove an existing quote
yeah, ok, whatever, that may be useful,...
so, let's get on with it.
$ wget http://search.cpan.org/CPAN/authors/id/D/DV/DVWRIGHT/ACME-QuoteDB-0.1.0.tar.gz
$ tar zxvf ACME-QuoteDB-0.1.0.tar.gz
$ tar zcvf libacme-quotedb-perl_0.1.0.orig.tar.gz ACME-QuoteDB
$ mv ACME-QuoteDB libacme-quotedb-perl-0.1.0
$ cd libacme-quotedb-perl-0.1.0
$ dh-make-perl
[ this failed first time becuase it could not find a Makefile.PL
the perl module author used Module::Build, which uses a Build.PL,
in place of a Makefile.PL and they did not include a Makefile.PL.
You can get around this by running:
$ perl Build.PL
$./Build dist (creates a Makefile.PL)
]
$ dh-make-perl (ran successfully now)
now edit files:
debian/changelog
debian/control
debian/copyright
$ debuild -us -uc
dpkg-buildpackage -rfakeroot -D -us -uc
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value:
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package libacme-quotedb-perl
dpkg-buildpackage: source version 0.1.0-1
dpkg-buildpackage: source changed by david wright
dpkg-buildpackage: host architecture i386
fakeroot debian/rules clean
dh_testdir
dh_testroot
dh_clean build-stamp install-stamp
# Add commands to clean up after the build process here
[ ! -f Build ] || /usr/bin/perl Build --allow_mb_mismatch 1 distclean
No such file: lib/ACME/QuoteDB/DB/quotes.db
Not in MANIFEST: debian/changelog
Not in MANIFEST: debian/compat
Not in MANIFEST: debian/control
Not in MANIFEST: debian/copyright
Not in MANIFEST: debian/rules
Not in MANIFEST: debian/watch
Not in MANIFEST: lib/ACME/QuoteDB/DB/quotes.db-ok
Not in MANIFEST: Makefile.PL
Not in MANIFEST: t/data/simpsons_quotes.tsv.csv-with-rating
MANIFEST appears to be out of sync with the distribution
Deleting blib
Deleting _build
Deleting Build
dpkg-source -b libacme-quotedb-perl-0.1.0
dpkg-source: info: using source format `1.0'
dpkg-source: info: building libacme-quotedb-perl using existing libacme-quotedb-perl_0.1.0.orig.tar.gz
dpkg-source: info: building libacme-quotedb-perl in libacme-quotedb-perl_0.1.0-1.diff.gz
dpkg-source: warning: ignoring deletion of file ACME-QuoteDB.pidaproject
dpkg-source: warning: ignoring deletion of file lib/ACME/QuoteDB/DB/quotes.db
dpkg-source: info: building libacme-quotedb-perl in libacme-quotedb-perl_0.1.0-1.dsc
debian/rules build
dh_testdir
# Add commands to compile the package here
/usr/bin/perl Build.PL installdirs=vendor
Creating custom builder _build/lib/MyModuleBuilder.pm in _build/lib
WARNING: the following files are missing in your kit:
lib/ACME/QuoteDB/DB/quotes.db
Please inform the author.
Checking whether your kit is complete...
Checking prerequisites...
Looks good
Creating new 'Build' script for 'ACME-QuoteDB' version '0.1.0'
/usr/bin/perl Build
Copying lib/ACME/QuoteDB.pm -> blib/lib/ACME/QuoteDB.pm
Copying lib/ACME/QuoteDB/LoadDB.pm -> blib/lib/ACME/QuoteDB/LoadDB.pm
Copying lib/ACME/QuoteDB/DB/Category.pm -> blib/lib/ACME/QuoteDB/DB/Category.pm
Copying lib/ACME/QuoteDB/DB/Attribution.pm -> blib/lib/ACME/QuoteDB/DB/Attribution.pm
Copying lib/ACME/QuoteDB/DB/QuoteCatg.pm -> blib/lib/ACME/QuoteDB/DB/QuoteCatg.pm
Copying lib/ACME/QuoteDB/DB/DBI.pm -> blib/lib/ACME/QuoteDB/DB/DBI.pm
Copying lib/ACME/QuoteDB/DB/Quote.pm -> blib/lib/ACME/QuoteDB/DB/Quote.pm
Manifying blib/lib/ACME/QuoteDB/LoadDB.pm -> blib/libdoc/ACME::QuoteDB::LoadDB.3pm
Manifying blib/lib/ACME/QuoteDB/DB/QuoteCatg.pm -> blib/libdoc/ACME::QuoteDB::DB::QuoteCatg.3pm
Manifying blib/lib/ACME/QuoteDB.pm -> blib/libdoc/ACME::QuoteDB.3pm
Manifying blib/lib/ACME/QuoteDB/DB/Attribution.pm -> blib/libdoc/ACME::QuoteDB::DB::Attribution.3pm
Manifying blib/lib/ACME/QuoteDB/DB/Category.pm -> blib/libdoc/ACME::QuoteDB::DB::Category.3pm
Manifying blib/lib/ACME/QuoteDB/DB/Quote.pm -> blib/libdoc/ACME::QuoteDB::DB::Quote.3pm
Manifying blib/lib/ACME/QuoteDB/DB/DBI.pm -> blib/libdoc/ACME::QuoteDB::DB::DBI.3pm
/usr/bin/perl Build test
t/00-load...................# Testing ACME::QuoteDB 0.1.0, Perl 5.010000, /usr/bin/perl
ok
t/01-load_quotes............ok
t/02-get_quotes.............ok
t/03-load_quotes_env........ok
t/04-get_quotes_more........ok
t/04-load_get_quote_utf8....ok
t/05-load_quotes_remote.....ok
t/boilerplate...............ok
t/pod-coverage..............ok
t/pod.......................ok
All tests successful.
Files=10, Tests=128, 22 wallclock secs ( 9.49 cusr + 0.76 csys = 10.25 CPU)
touch build-stamp
fakeroot debian/rules binary
dh_testdir
dh_testroot
dh_clean -k
# Add commands to install the package into /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl here
/usr/bin/perl Build install destdir=/tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl create_packlist=0
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/perl5/ACME/QuoteDB.pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/perl5/ACME/QuoteDB/LoadDB.pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/perl5/ACME/QuoteDB/DB/Quote.pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/perl5/ACME/QuoteDB/DB/Category.pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/perl5/ACME/QuoteDB/DB/DBI.pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/perl5/ACME/QuoteDB/DB/QuoteCatg.pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/perl5/ACME/QuoteDB/DB/Attribution.pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/perl5/ACME/QuoteDB/DB/quotes.db
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/man/man3/ACME::QuoteDB::DB::Category.3pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/man/man3/ACME::QuoteDB::LoadDB.3pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/man/man3/ACME::QuoteDB::DB::QuoteCatg.3pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/man/man3/ACME::QuoteDB::DB::Attribution.3pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/man/man3/ACME::QuoteDB::DB::DBI.3pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/man/man3/ACME::QuoteDB::DB::Quote.3pm
Installing /tmp/t/libacme-quotedb-perl-0.1.0/debian/libacme-quotedb-perl/usr/share/man/man3/ACME::QuoteDB.3pm
touch install-stamp
dh_testdir
dh_testroot
dh_installdocs README
dh_installchangelogs Changes
dh_perl
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dpkg-gencontrol: warning: unknown substitution variable ${misc:Depends}
dh_md5sums
dh_builddeb
dpkg-deb: building package `libacme-quotedb-perl' in `../libacme-quotedb-perl_0.1.0-1_all.deb'.
dpkg-genchanges >../libacme-quotedb-perl_0.1.0-1_i386.changes
dpkg-genchanges: including full source code in upload
dpkg-buildpackage: full upload (original source is included)
Now running lintian...
W: libacme-quotedb-perl: manpage-has-errors-from-man usr/share/man/man3/ACME::QuoteDB.3pm.gz 950: warning [p 12, 5.7i]: can't break line
W: libacme-quotedb-perl: old-fsf-address-in-copyright-file
W: libacme-quotedb-perl: copyright-contains-dh-make-perl-boilerplate
E: libacme-quotedb-perl: description-too-long
W: libacme-quotedb-perl: spelling-error-in-description mysql MySQL
W: libacme-quotedb-perl: new-package-should-close-itp-bug
Finished running lintian.
Ok, now let's clean up those 'lintian' errors.
we are mainly concerned with fixing the lintian error 'E'
but we'll clear up all we can.
1. manpage-has-errors-from-man
skiping, cant control manpage now.
2.old-fsf-address-in-copyright-file
http://lintian.debian.org/tags/old-fsf-address-in-copyright-file.html
3. copyright-contains-dh-make-perl-boilerplate
self explanitory.
4. description-too-long
http://lintian.debian.org/tags/description-too-long.html
The first line of the "Description:" must not exceed 80 characters.
5. spelling-error-in-description mysql MySQL
self explanitory.
6. new-package-should-close-itp-bug
http://lintian.debian.org/tags/new-package-should-close-itp-bug.html
isn't relavent in this situation becuase there is no bug request for this package.
ok, cleared what we could up, re-run
$ debuild -us -uc
Now running lintian...
W: libacme-quotedb-perl: manpage-has-errors-from-man usr/share/man/man3/ACME::QuoteDB.3pm.gz 950: warning [p 12, 5.7i]: can't break line
W: libacme-quotedb-perl: new-package-should-close-itp-bug
Finished running lintian.
ok, better
built on
debian stable - lenny
cat /etc/debian_version
5.0.3
$ tar zcvf libacme-quotedb-perl-0.1.0.tar.gz libacme-quotedb-perl_0.1.0-1*
libacme-quotedb-perl_0.1.0-1_all.deb
libacme-quotedb-perl_0.1.0-1.diff.gz
libacme-quotedb-perl_0.1.0-1.dsc
libacme-quotedb-perl_0.1.0-1_i386.build
libacme-quotedb-perl_0.1.0-1_i386.changes
which you can find for download here:
http://www.dwright.us/misc/libacme-quotedb-perl-0.1.0.tar.gz
$ sudo dpkg -i libacme-quotedb-perl_0.1.0-1_all.deb
update Sat Sep 26 01:04:23 PDT 2009: the libacme-quotedb-perl_0.1.0-1_all.deb package was not properly created, when installed, one could not write to the database, that is corrected now with this version: (libacme-quotedb-perl_0.1.2)
http://www.dwright.us/misc/libacme-quotedb-perl-0.1.2.tar.gz
$ sudo dpkg -i libacme-quotedb-perl_0.1.2-1_all.deb
proof of the test db installed by default:
$ perl -MACME::QuoteDB -le 'print quote()'
나는 유리를 먹을 수 있어요. 그래도 아프지 않아요
-- I can eat grass (Korean)
this version is signed and was built on debian: squeeze/sid (which is currently testing; lenny is stable)
references:
http://www.debian-administration.org/articles/78
http://www.debian-administration.org/articles/78#comment_9
http://www.debian.org/doc/packaging-manuals/perl-policy/
http://www.debian.org/doc/maint-guide/