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

Re: Marking program-generated packaging files

On Tue, 16 Mar 2004, A.M. Kuchling wrote:

> bdist_rpm generates an RPM .spec file from various information and
> uses it to build the final package.  For dpkg, I need to generate
> control, copyright, changelog, postinst, prerm, and rules files.
> A person packaging Python software for Debian might want to provide
> their own versions of these files.  I don't want bdist_dpkg to
> overwrite such user-provided files, so it needs to recognize whether
> these files were written by bdist_dpkg or not.

How do you recognize if the .spec file has been modified?

> For the shell scripts and makefiles, it's easy; put a comment
> containing a marker such as 'GENERATED BY BDIST_DPKG' in the file, and
> look for the marker.
> This isn't possible with copyright, control, and changelog, which
> don't support comments.  For copyright, I can just put in the marker
> as a line appended to the copyright text; this is user-visible and
> annoying, but certainly workable.

You only need control and changelog.  rules can just be a wrapper to a python
program, that moves files around into the deb tree structure.  copyright can
be called anything, and doesn't even have to exist, as your python program can
copy it from the upstream location.

I added comment support to paragraphs after the first(ie, non-source) in
debian/control in the later 1.10 releases.  You'd need to add the proper
build-depends in that case, tho.

However, why not just create a separate file in debian/ that lists which files
were auto-generated?

> debian/changelog has a specified format, and I don't see how to insert
> extra information in it; any suggestions?  I could simply insert the
> marker in the first changelog entry, and that's probably what I'll do.

Use a different changelog format.  Read the docs on how to make use of it.

> More generally, does this seem like a good approach for automatically
> building .debs of Python software?  These .debs may not be suitable
> for inclusion in Debian proper, but they'll certainly ease the life of
> sysadmins maintaining large Python installations on Debian.

Check out how kernel-package creates debian/.

Reply to: