Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize debian packaging #7

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

jwt27
Copy link
Contributor

@jwt27 jwt27 commented Sep 21, 2022

Here is an attempt to upgrade the Debian package scripts.

Instead of writing the dh_* invocation sequence manually, we can define a
single target that invokes dh, and let it run the dh_* subprograms in the
order that it wants. Then we can define override_dh_* targets whenever we
want it do something different than usual.

Alternatively one could make files such as rhtvision2.2.3.install,
rhtvision2.2.3.docs, etc. I think the existing dh_* commands in the rules
script are adequate, no need to reinvent the wheel. Those files would also
have to be generated at build time to contain the current version number. I
see an attempt has previously been made to do that with control.in. Or maybe
you still use this to generate the control file?

Some notes:

  • I picked compat level 11, this is available on Ubuntu 'bionic'. Debian
    'oldstable' has level 12.
  • Native-format packages may not contain hyphens in their version numbers. I
    changed it to a plus sign.
  • For cleanup before building the source package, I used git clean. Of course
    this won't do anything when compiling from a tarball. I hope that's okay.
  • Packages are compiled in parallel by default, so doing make -j is not
    necessary.
  • Calling ldconfig in postinst/postrm scripts is no longer necessary. Or,
    that is what I assumed, since lintian complains about it.
  • I removed some remaining dh_make example files, they just add clutter.
  • The rules script generated a debianbackup.tar file. I removed this since
    it seems unnecessary now that we have git.

@jwt27 jwt27 force-pushed the debian-rewrite branch 2 times, most recently from 4d9a88b to b3f16da Compare September 21, 2022 21:27
@set-soft
Copy link
Owner

Hi @jwt27 !

Native-format packages may not contain hyphens in their version numbers. I
changed it to a plus sign.

I don't understand it, the -N is the package iteration number, so 2.2.3-1 is version 2.2.3, first .deb iteration. If something changes in the package, not the source, we'll get 2.2.3-2, etc.

For cleanup before building the source package, I used git clean. Of course
this won't do anything when compiling from a tarball. I hope that's okay.

This will force me to always use a fresh cloned repo to create a package. Is true that I don't currently generate packages often, but this seems really annoying, and quite dangerous.

The rules script generated a debianbackup.tar file. I removed this since
it seems unnecessary now that we have git.

Ivan added it to make the process simpler. So we can generate a package and continue working, without needing to reconfigure the sources. I think this isn't a big problem, but I must check the consequences.

@jwt27
Copy link
Contributor Author

jwt27 commented Sep 23, 2022

Hi @jwt27 !

Native-format packages may not contain hyphens in their version numbers. I
changed it to a plus sign.

I don't understand it, the -N is the package iteration number, so 2.2.3-1 is version 2.2.3, first .deb iteration. If something changes in the package, not the source, we'll get 2.2.3-2, etc.

That version format is meant for packages generated from an upstream tarball, where the Debian packaging is done separately ("quilt" format). In a "native" package, the debian directory is part of the repository itself, and in this case it now refuses to build if there are hyphens in the version number.

For cleanup before building the source package, I used git clean. Of course
this won't do anything when compiling from a tarball. I hope that's okay.

This will force me to always use a fresh cloned repo to create a package. Is true that I don't currently generate packages often, but this seems really annoying, and quite dangerous.

With -X it only deletes files covered by .gitignore. I assumed that only contains build outputs. If you do have important files in listed .gitignore, then it would be dangerous, true.

The rules script generated a debianbackup.tar file. I removed this since
it seems unnecessary now that we have git.

Ivan added it to make the process simpler. So we can generate a package and continue working, without needing to reconfigure the sources. I think this isn't a big problem, but I must check the consequences.

If you want to keep the backups, I'll add it back. It only backed up one file though (linux/libtvfintl.a), which is produced again immediately by building the binary package (but in makes/libtvfintl.a).

@jwt27
Copy link
Contributor Author

jwt27 commented Sep 23, 2022

Maybe another idea: you could back up everything removed by git clean, so the source tree will be left exactly as it was before building the Debian package, including build outputs. In that case you could even use git clean -dx to also remove untracked files and directories.

@set-soft
Copy link
Owner

Hi @jwt27 !

Native-format packages may not contain hyphens in their version numbers. I
changed it to a plus sign.

I don't understand it, the -N is the package iteration number, so 2.2.3-1 is version 2.2.3, first .deb iteration. If something changes in the package, not the source, we'll get 2.2.3-2, etc.

That version format is meant for packages generated from an upstream tarball, where the Debian packaging is done separately ("quilt" format). In a "native" package, the debian directory is part of the repository itself, and in this case it now refuses to build if there are hyphens in the version number.

This doesn't make any sense to me. Changes in the packaging can't be reflected in the version itself, this is why Debian packages have "VERSION-PACKAGE_ITERATION". You must find a way to setup the process to keep it this way.
How does the tools know if the debian dir is part of the upstream or is just a patch?

For cleanup before building the source package, I used git clean. Of course
this won't do anything when compiling from a tarball. I hope that's okay.

This will force me to always use a fresh cloned repo to create a package. Is true that I don't currently generate packages often, but this seems really annoying, and quite dangerous.

With -X it only deletes files covered by .gitignore. I assumed that only contains build outputs. If you do have important files in listed .gitignore, then it would be dangerous, true.

Some times I add things like project files in local formats, or caches. So this isn't a good idea.

The rules script generated a debianbackup.tar file. I removed this since
it seems unnecessary now that we have git.

Ivan added it to make the process simpler. So we can generate a package and continue working, without needing to reconfigure the sources. I think this isn't a big problem, but I must check the consequences.

If you want to keep the backups, I'll add it back. It only backed up one file though (linux/libtvfintl.a), which is produced again immediately by building the binary package (but in makes/libtvfintl.a).

The .a isn't really important, but we must avoid removing files that aren't regenerated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants