elegant ways to build a package two times - Debian

This is a discussion on elegant ways to build a package two times - Debian ; The inn2 packages is not as useful as it should be, since it does not support LFS which is mandatory for large servers. I cannot just enable LFS support since there is no transition path for some classes of users, ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: elegant ways to build a package two times

  1. elegant ways to build a package two times

    The inn2 packages is not as useful as it should be, since it does not
    support LFS which is mandatory for large servers. I cannot just enable
    LFS support since there is no transition path for some classes of users,
    so we need both inn2 and inn2-lfs packages.

    I am looking for *elegant* ways to build both packages from the same
    source with the least possible duplication of the code in debian/rules
    and of the debian/ debhelper files (the package is complex and needs
    much work before and after make install).
    Please let me know if you know about packages which solved similar
    issues.

    INN uses autoconf but not automake, so mkdir bin && ./configure does
    not generate working makefiles.

    --
    ciao,
    Marco


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  2. Re: elegant ways to build a package two times

    On Sun, Apr 13, 2008 at 05:50:39PM +0200, Marco d'Itri wrote:

    > I am looking for *elegant* ways to build both packages from the same
    > source with the least possible duplication of the code in debian/rules
    > and of the debian/ debhelper files (the package is complex and needs
    > much work before and after make install).
    > Please let me know if you know about packages which solved similar
    > issues.


    I maintain celestia, which comes with three front-ends, GLUT, GNOME and
    KDE. Unfortunately, upstreams build system only allows you to build for
    one specific front-end at a time. In celestia's debian/rules, the source
    is copied three times to separate build directories. Then it is compiled
    three times, each time with different options to ./configure. I have
    taken care that the makefile rules in debian/rules are such that
    repeated builds work fine, and that if you interrupt the build you can
    resume it, without the need for the build system to start over again.
    Also, I recently made it so that the build directory copies are made
    with cp -l, to speed up the process and to prevent disk space from being
    consumed unnecessarily.

    --
    Met vriendelijke groet / with kind regards,
    Guus Sliepen

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFIAm09AxLow12M2nsRAmN4AJsERyzoT1iqugWxui/6NXpVoaw7sQCggr7B
    YNg+scj0GvJ9DMWJ1Eca91A=
    =UuNp
    -----END PGP SIGNATURE-----


  3. Re: elegant ways to build a package two times

    Le dimanche 13 avril 2008 * 17:50 +0200, Marco d'Itri a écrit :
    > INN uses autoconf but not automake, so mkdir bin && ./configure does
    > not generate working makefiles.


    (I suppose you mean ../configure)

    You don’t need automake for this to work, it’s just that automake does
    things right by default. Fixing the package to get out-of-tree builds to
    work using VPATH should be feasible.

    Otherwise, the least inelegant way is probably, as already suggested, to
    copy the full sources in a subdirectory.

    --
    .''`.
    : :' : We are debian.org. Lower your prices, surrender your code.
    `. `' We will add your hardware and software distinctiveness to
    `- our own. Resistance is futile.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQBIBMyHrSla4ddfhTMRAtgVAKDxva+JFu6rW8/xy9kAwVhttrZClwCbB0kC
    4xT2ozXdHRy+pR3XjKEeBxk=
    =lll0
    -----END PGP SIGNATURE-----


  4. Re: elegant ways to build a package two times

    On Apr 15, Josselin Mouette wrote:

    > You don???t need automake for this to work, it???s just that automake does
    > things right by default. Fixing the package to get out-of-tree builds to
    > work using VPATH should be feasible.

    Can you point me to a good example of a package using VPATH?

    > Otherwise, the least inelegant way is probably, as already suggested, to
    > copy the full sources in a subdirectory.

    Actually both ways share the same problem: a lot of code will have to be
    duplicated in debian/rules (maybe I should try using "define" to create
    macros).

    --
    ciao,
    Marco

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFIDM1XFGfw2OHuP7ERAmMVAKCPPcGvztlYV0hNYW4nMI nrH1ZTRgCgijhc
    VFMFcbP0iCXUsVEOKKtZ8e0=
    =B58O
    -----END PGP SIGNATURE-----


  5. Re: elegant ways to build a package two times

    Le lundi 21 avril 2008 19:22 +0200, Marco d'Itri a crit :
    > On Apr 15, Josselin Mouette wrote:
    > > You don???t need automake for this to work, it???s just that automake does
    > > things right by default. Fixing the package to get out-of-tree builds to
    > > work using VPATH should be feasible.

    > Can you point me to a good example of a package using VPATH?


    You can have a look at mpb; the upstream version uses autoconf without
    automake and doesn't support out-of-tree builds. The Debian package has
    a patch to make it work using VPATH.

    > Actually both ways share the same problem: a lot of code will have to be
    > duplicated in debian/rules (maybe I should try using "define" to create
    > macros).


    Not necessarily:

    FLAVORS := foo bar

    common_configure_flags = --prefix=/usr
    foo_configure_flags = $(common_configure_flags) --with-foo
    bar_configure_flags = $(common_configure_flags) --with-bar

    STAMP_DIR=debian/stamp
    BUILD_DIR=debian/build
    builddir = $(BUILD_DIR)/$*

    configure: $(addprefix $(STAMP_DIR)/configure-stamp-, $(FLAVORS))
    $(STAMP_DIR)/configure-stamp-%:
    dh_testdir
    mkdir -p $(builddir)
    cd $(builddir) && \
    CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
    $(CURDIR)/configure $($*_configure_flags)
    touch $@

    build: $(addprefix $(STAMP_DIR)/build-stamp-, $(FLAVORS))
    $(STAMP_DIR)/build-stamp-%: $(STAMP_DIR)/configure-stamp-%
    dh_testdir
    $(MAKE) -C $(builddir)
    touch $@

    --
    .''`.
    : :' : We are debian.org. Lower your prices, surrender your code.
    `. `' We will add your hardware and software distinctiveness to
    `- our own. Resistance is futile.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQBIDdSnrSla4ddfhTMRAsodAJ9+Y1GQ9VZovTMf6dRnZP PgvuEH6QCdHYbi
    eoXqpdYnqEKXGLJoK9SJPpE=
    =4zhk
    -----END PGP SIGNATURE-----


+ Reply to Thread