[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building my own packages



Victor Sudakov writes:

songbird wrote:

[...]

> > Where can I learn to do a similar thing for Debian? I'd like to have my
> > own package repository which:
> >
> > 1. Keeps my local patches and configure/build options.
> > 2. Gets updated and recompiled when the main Debian repository gets > > updated. > > 3. Can have a higher preference for my Debian systems than the default > > Debian repositories.
> >
> > I know this can be done because I use some vendor repositories (zabbix,
> > consul etc) but I need the tools and knowledge.
> >
> > What would you advise me to read?
>
>   there is a ton of information under:
>
>   https://www.debian.org/devel/

The problem is I don't need a ton of information :-) I need to hear from
someone who has already done that for themselves: "I use such and such
tools, and publish my repo this way..."

[...]

> in the place and set up a watch on the repository to
> see when changes happen.

I have no doubt there are many such tricky things, that's why I'm
looking for a tutorial.

[...]

Hello,

I am among those who have done something similar, although with slightly different focus:

* For me, it is mostly not to change options of existing packages but rather
  to add some packages that are not there yet (at all)
* Additionally, I store a lot of configuration
* I only upgrade from upstream on rare occasions, thus I have not automated
  that part thoroughly. The commits from "Oct 27, 2020" here show
  how I did an upgrade: https://github.com/m7a/lp-cone/commits/master

For my use case, I combine the following tools:

* debuild   (Debian package building)
* reprepro  (Custom repository)
* ant       (generic build tool)
* Docker¹   (chroot-like environment)
* git       (for storing metadata and my own source code)
* Perl      (to tie it all together)

My idea is to have one git repository per package and inside that, the package's metadata is "wholly" described by a single `build.xml` file for `ant`.

Working on package is mostly done by modifying the files in the git repository and then tiggering automatic builds by committing the current state of work (no need to upload anything to a server, the system uses the local file system).

I am really unsure whether my approach is anywhere near what you need, but I have automated almost all of the actual packaging stuff including the creation of a repository, the invocation of Debian build tools, the synchronization with the repository, the creation of a clean build environment... so maybe it can serve as a "formal tutorial" i.e. some code to look at, that does all the necessary steps.

Beware that it is a simplified version of the story though -- the packages created by my system are not suited for inclusion in Debian as-is (still pondering how to achieve that one day...).

Here is the documentation of all components:

* https://masysma.lima-city.de/32/masysmaci_main.xhtml
* https://masysma.lima-city.de/32/masysmaci_build.xhtml
* https://masysma.lima-city.de/32/masysmaci_pkgsync.xhtml
* https://masysma.lima-city.de/11/maartifact.xhtml

This marks my second approach to automate the packaging. Before that, I used a script called `mdpc` (1.0) which I posted to this mailing list at the time it was written. Afterwards, it did not really change anymore... and it works until today “mostly” -- for instance, it is highly dependent on the host system and some of its functions have not been used for at least a year...: https://lists.debian.org/debian-user/2013/08/msg00042.html

¹) Debian package `docker.io`. Note: Docker is a good substitute for most chroot uses (and many VM uses, too), but it loses much of their lightweightness and running Docker as regular user is still experimental (I did not try it yet...). Additionally, it is one of the more complicated tools out there...

HTH
Linux-Fan

öö

Attachment: pgprja9a3GCtV.pgp
Description: PGP signature


Reply to: