Requirements

  • ruby1.8-dev
  • python2.4-dev
  • swig1.3 >= 1.3.24
  • libapt-pkg-dev
  • debtags >= 1.3.2

Compiling out of svn

Instructions for compiling a fresh subversion checkout.

If you use autotools:

autoreconf -i
./configure
make
make check

or alternatively:

autoreconf -i
fakeroot debian/rules build
make check

or, with all debugging enabled:

autoreconf -i
export DEB_BUILD_OPTIONS="noopt nostrip"
CXXFLAGS="-O0 -g -Wall" fakeroot debian/rules build
make check

Linking to libapt-front

Always use -dlpreopen <.la file> if linking to static libapt-front! We depend on static variable constructors to register init functions and things won't work if symbols are omitted by the linker!

Coding conventions

A quick summary:

  • no C style casts - ever
  • try to make testcases for your code if possible at all (important!)
  • generic stuff (not depending on rest of libapt-front, possibly useful elsewhere) goes to utils/
  • use namespaces liberally
  • don't put using clauses into .h files if avoidable at all
  • the code that goes in should make sense :-)
  • API should be well-thought out, don't be afraid to refactor if something doesn't "fit", we don't maintain source compat for now...
  • however, try to avoid doing excessive and unneccessary incompatible changes on the trunk, we don't want to upset everyone using the lib more than neccessary :-)
  • no copy and paste unless absolutely neccessary (in the latter case refactor as soon as possible)
  • don't copy code from apt without fixing it first
  • don't forget copyright attribution, no code stealing please;
  • if you can, avoid copying from (L)GPL code, but that's not prohibited; the rest of the lib remains BSD though, so the remaining code can be reused in GPL-incompatible software

That's about it, thanks for following the above and enjoy hacking on the lib!

Adding an information source

These are instructions on how to add support for a new information source, compiled when adding support for Debtags.

  • Create a new component in apt-front/cache/component. Take the Tags component (in debtags.h) as an example.
  • The new component needs to be instantiated and initialised in aptFront::cache::Cache (see cache/cache.h)
  • The API to query about packages goes into aptFront::cache::entity::Package or aptFront::cache::entity::Version.
  • New search functions can be added to aptFront::predicate (see filters.h)
  • Or alternatively, a generator can be provided to select packages from cache by certain criteria (this is yet to be implmented and details decided upon... probably consult the mailing list)

Extending the entities to access your data

First thing, you need to make your cache visible to the iterators. To do so, add a method like pkgCache() or debtagsCache() to entity::Implementation (in cache/entity/entity.h).

Now you're ready to extend entity::Package (cache/entity/package.h) with your methods: just add forwarder methods that make appropriate calls to your cache and return the results. Pay attention to excetpion conventions used in the entity classes.

Adding new search functions

(to be written)