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

debian packaging #10

Open
adrelanos opened this issue Jul 3, 2016 · 11 comments
Open

debian packaging #10

adrelanos opened this issue Jul 3, 2016 · 11 comments

Comments

@adrelanos
Copy link
Contributor

adrelanos commented Jul 3, 2016

Since @rustybird does not wish to merge distribution specific stuff of distributions he does not use (#2 (comment)), I am only opening this as an issue, not as a pull request.

Work in progress:

EDIT:


There is one issue that Debian will complain about.

W: corridor: executable-not-elf-or-script usr/sbin/corridor-load-config

That script if not executable does not belong there.

  • Can we move it to a more appropriate location?
  • Alternatively, can we make it executable and useful instead? When manually executed it could work as a config file sanity tester, i.e. just sourcing the config files in verbose -x mode and then exit with an "success" if that did not result in an error.

Would you like to ship a man folder with manuals in ruby-ronn format in rustybird/corridor master?

I guess I could contribute the original, basic man pages.

(The Debian packaging that I am using would convert them during package build to proper man pages compatible with gnu man. Much better than learning and writing the roff format.)

That would help Debian lintian (package checker) no longer complain about missing man pages. The man pages shipped at upstream rustybird/corridor seems more useful than in downstream adrelanos/corridor.

rustybird pushed a commit that referenced this issue Jul 4, 2016
Works as a config file sanity tester now. #10
@rustybird
Copy link
Owner

Alternatively, can we make it executable and useful instead? When manually executed it could work as a config file sanity tester, i.e. just sourcing the config files in verbose -x mode and then exit with an "success" if that did not result in an error.

Sounds good, done.

@adrelanos
Copy link
Contributor Author

What about the man pages? I think I could also write them in markdown, then convert them roff and eventually send a pull request here.

They are looking quite okay, I think. You can see one created that way in action in Whonix. Example:

man tor-ctrl

@rustybird
Copy link
Owner

What about the man pages?

What do you think about a combined manpage (i.e. man corridor, symlinked to the individual command names)? It could show how everything fits together, and would probably avoid some redundancy.

I think I could also write them in markdown, then convert them roff and eventually send a pull request here.

Either way would be fine, I'd check in both your source and the generated output anyway. Like it's often done for configure.ac and configure.

They are looking quite okay, I think.

Yeah, even the generated roff code doesn't look terrible. I like it!

@adrelanos
Copy link
Contributor Author

I don't know if a combined man page would be acceptable by Debian policy or otherwise. I will ask.


Debian request for packaging feature request:
RFP: corridor - a Tor traffic whitelisting gateway


Perhaps for getting this into official Debian, I would have to become upstream. I'd be maintaining a Debian friendly fork of corridor. This is because for getting this packages, I patched the makefile and added an additional dependency, genmkfile. Let's see what pkg-privacy-maintainers say and how supportive they are.

@adrelanos
Copy link
Contributor Author

I am not wiser about the combined manpage yet. Will ask in another place.

What however would work would be having just one corridor binary in /usr/sbin/corridor which would just be a stub calling the others scripts from /usr/share/corridor/{forwarding-init,...}. Then a combined manpage would certainly be possible. Whether this is a good idea is another question.

@adrelanos
Copy link
Contributor Author

W: corridor: executable-not-elf-or-script usr/sbin/corridor-load-config

Fixed:

I am not wiser about the combined manpage yet. Will ask in another place.

Asked:
https://lists.debian.org/debian-mentors/2016/07/threads.html

@adrelanos
Copy link
Contributor Author

A combined manpage is permissible.

adrelanos pushed a commit to adrelanos/corridor that referenced this issue Jul 11, 2016
adrelanos pushed a commit to adrelanos/corridor that referenced this issue Jul 11, 2016
adrelanos pushed a commit to adrelanos/corridor that referenced this issue Jul 18, 2016
rustybird#18

rustybird#10

Merge branch 'orig_makefile'
adrelanos pushed a commit to adrelanos/corridor that referenced this issue Jul 18, 2016
adrelanos pushed a commit to adrelanos/corridor that referenced this issue Jul 18, 2016
@adrelanos
Copy link
Contributor Author

As of adrelanos@e9907c9:

git diff --stat rustybird/master 
 Makefile                        |  43 ++------
 Makefile_orig                   |  37 +++++++
 README.debian                   |   5 +
 changelog.upstream              | 844 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 debian/changelog                |  12 ++
 debian/compat                   |   1 +
 debian/control                  |  37 +++++++
 debian/copyright                |  31 ++++++
 debian/corridor.links           |  10 ++
 debian/corridor.postinst        |  43 ++++++++
 debian/corridor.postrm          |  36 ++++++                                                                                                                                       
 debian/gain-root-command        |   7 ++                                                                                                                                           
 debian/rules                    |  17 +++                                                                                                                                          
 debian/source/format            |   1 +                                                                                                                                            
 debian/source/lintian-overrides |   2 +                                                                                                                                            
 debian/watch                    |   7 ++                                                                                                                                           
 make-helper-overrides.bsh       |  25 +++++                                                                                                                                        
 17 files changed, 1127 insertions(+), 31 deletions(-)

@rustybird
Copy link
Owner

Nice! Some things I've noticed:

  • README.debian can be deleted now
  • From my cursory understanding of git-based Debian packaging, it sounds like all Debian specific files should go into debian/ and the top level directory be unchanged
  • Is the custom Makefile and the genmkfile dependency still needed?
  • Seems strange to ship almost a thousand lines of upstream.changelog in the same git repository it is generated from. Maybe it could be a line in debian/rules.
  • The ruby-ronn dependency might be unnecessary, installation uses the precompiled version

adrelanos pushed a commit to adrelanos/corridor that referenced this issue Jul 21, 2016
@adrelanos
Copy link
Contributor Author

Rusty Bird:

Nice! Some things I've noticed:

  • README.debian can be deleted now

Done.

  • From my cursory understanding of git-based Debian packaging, it sounds like all Debian specific files should go into debian/ and the top level directory be unchanged

Usually yes.

  • Is the custom Makefile and the genmkfile dependency still needed?

Yes.

  • Seems strange to ship almost a thousand lines of upstream.changelog in the same git repository it is generated from. Maybe it could be a line in debian/rules.

If is required for Debian packaging. Not strictly required, but then the
package is free of any lintian --pedantic warnings.

Used in debian/rules:

override_dh_installchangelogs:
        dh_installchangelogs changelog.upstream upstream

If upstream does not provide an upstream changelog, this is a legitimate
way to generate one.

It could be automatically created during package build in theory, but
Debian source packages are spare out the '.git' folder. So the Debian
source package already has to include the upstream tarball.

This situation will likely improve when debian/source/format 3.0 (git)
GitSrc is ready. Good that I am reminded.

asked on debian-mentors mailing list:
What is the status of debian/source/format 3.0 (git) GitSrc?

  • The ruby-ronn dependency might be unnecessary, installation uses the precompiled version

Done.

@adrelanos
Copy link
Contributor Author

If you are wondering, why I am using genmkfile... genmkfile's make help.

make help
   Show this help.
make dist
   Create package-version.tar.gz from source files in $DISTDIR (default "..").
make undist
   Delete package-version.tar.gz from source files in $DISTDIR (default "..").
make debdist
   Create debian.tar.gz from source files in $DISTDIR (default "..").
make undebdist
   Delete debian.tar.(gz|xz) from source files in $DISTDIR (default "..").
make manpages
   Create man page from man source folder, which will be stored in debian/tmp-man folder.
make uch
   Store upstream changelog from git log in changelog.upstream.
make install
   Copying the files from the source tree to system-wide directories.
make installsim
   Simulate copying the files from the source tree to system-wide directories.
make deb-build-dep
   Install build dependencies listed in debian/control under Build-Depends using apt-get.
   Various environment variables supported.
make deb-pkg
   Create a deb, which will be stored in parent folder.
make deb-pkg-install
   Create a deb, which will be stored in parent folder, and install it.
make deb-install
   Install deb from parent folder.
make deb-icup
   Combination of make deb-pkg, make deb-pkg-install and make deb-pkg-cleanup.
make deb-remove
   apt-get remove make_source_package_name
make deb-purge
   apt-get purge make_source_package_name
make deb-clean
   Delete temporary debhelper files.
make deb-cleanup
   Same as make deb-clean and deletes debuild artifacts from parent folder.
make dput-ubuntu-ppa
   Upload to Ubuntu ppa. Requires functional .dput.cf.
make clean
   Currently same as make deb-clean.
make distclean
   Currently same as make clean.
make checkout
   Fetch from git.
make installcheck
   Check if source files match installed files.
make uninstallcheck
   Check if make uninstall removed all files.
make uninstall
   Delete all installed files.
make uninstallsim
   Simulate what make uninstall would do.
make deb-chl-bumpup-manual
   Manual upstream version number in debian/changelog.
make deb-uachl-bumpup-manual
   Combination of make uch and make deb-chl-bumpup.
make deb-chl-bumpup-major
   Major bump upstream version number in debian/changelog.
make deb-uachl-bumpup-major
   Combination of make uch and make deb-chl-bumpup.
make git-tag-sign
   git tag (-s) sign latest pkg_version_with_revision from debian/changelog. Only a repository sanity check. Not for security purposes!
make git-tag-verify
   git tag (-v) verify latest pkg_version_with_revision from debian/changelog. Only a repository sanity check. Not for security purposes!
make git-tag-check
   Check if current git head is a signed git tag. Only a repository sanity check. Not for security purposes!
make git-commit-verify
   Check if current git head is a signed git commit. Only a repository sanity check. Not for security purposes!
make git-verify
   Combination of tag-check and commit-verify. Only a repository sanity check. Not for security purposes!
make git-tag-push
   git push latest pkg_version_with_revision from debian/changelog. (Environment variable make_git_tag_push_targets, that defaults to 'origin'.)
make git-tag-push-latest
   git push most recent git tag. (Environment variable make_git_tag_push_targets, that defaults to 'origin'.)
make reprepro-add
   Add main deb package using reprepro wrapper (Environment variable make_reprepro_wrapper, that default to 'reprepro'.)
   to repository (Environment variable make_reprepro_codename, that defaults to 'developers'.).

(Some of that is broken for corridor.)

It somewhat standardizes packaging trivially packageable stuff. (I am not saying corridor is trivial! Just sh/bash/scripts that do not require compilation are intrinsically easy to package.) It helps me with questions such as:

  • "What was the command to generate a deterministic upstream tarball again?" I could make this a local shell alias, but I find that intransparent. I prefer having this command public. It could be implemented per project, I could write a feature request "please provide a make dist" target
  • Among other handy stuff that I need for packaging, builds, repository generation.
  • This allows me to maintain a big number of packages with more ease / time efficient since these are all very similar.

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

No branches or pull requests

2 participants