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

Add a .deb package and a script to auto-build .deb #469

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

CicadaSeventeen
Copy link

Now only Fedora and Arch have x11docker in their repos, and Fedora's one is kind of out-of-date.
Today I was just using podman on Debian, so I made it by the way. Nothing important since x11docker is just a bash script and have little dependency problem.
It does not matter whether you want to accept it. Now it is almost useless but unless for those who want to install all packages by apt, but maybe I will add it to some unofficial repos in future.

@mviereck
Copy link
Owner

Thank you for your contribution!
It is interesting and I am considering it.

I would like to make it a deb package fulfilling the criteria of Debian.
Once I had a look at the guidelines, but I was confused.
One point I remember: A man page is mandatory. I would need to create and maintain one.
Another thing, x11docker in the package should not have options --update*, --install and --remove because they would break the packing concept.

Are you familiar with the details of Debian's deb packaging guidelines?

@CicadaSeventeen
Copy link
Author

I am not familiar with Debian's rule but I have friends do so. Blocking --install --remove and --update is easy, but man page does need some effort because yo cannot just use --help files.
Now I do not pack any man files here. This is not necessary unless we want to submit it to Debian Sid.
I can ask it for you.

@CicadaSeventeen
Copy link
Author

CicadaSeventeen commented Oct 17, 2022

Note:

  1. I mistakenly use docker in Suggestion. It should be docker.io. docker has been used to a different packages due to historical reason.
  2. I make podman and docker in Suggestion because I do not want system to install them all. However I learn that it is possible to write dependency like podman |docker.io. If you prefer docker as default which is x11docker's behavior, I will make docker at the front.
  3. I put weston and xwayland in Suggestion rather than Recommends. For deb that means it will not be installed even you use --install-recommends tag. That can make users who do not want to use wayland not install this two package. You know for x11-only system installing wayland support can be kind of heavy. However, it will make users cannot use wayland functions out of box. A better way is that maybe we make another package like x11docker-wayland. I may try to find out how fedora and arch due with it.
  4. For Debian's rule, I have asked my friends. Actually man is suggested by not necessary. He suggests that we can use help2man to make a copy of help into it, while another choice is to put github readme into it (Which do you like? ). Only mandatory is to be free. Debian does not accept blob. This problem does not affect x11docker

@CicadaSeventeen
Copy link
Author

CicadaSeventeen commented Oct 17, 2022

Update 2022.10.17 :

  1. now --install --update* --remove and --launcher can be use without detecting the backend
  2. add a variable Installermode_Disabled to disable --install --update* --remove for packaging
  3. add a man by help2man
  4. add a script to auto-packaging .deb (I do not know if an auto rpm packager is possible, for openSUSE, Fedora... can have deference package name for dependency )
  5. add a .deb. Depends is corrected as 'docker.io | podman', x11 dependency is in Recommends ,wayland dependency is in Suggests. I do not know if I should make it depend on xorg

The changes from main are listed in change-of-fork.md in my fork.

@mviereck
Copy link
Owner

Overall the dependency should be kept as low as possible.
A hard dependency is bash only. I assume packages like coreutils don't need to be declared.
Most soft dependencies can be fulfilled with image x11docker/xserver, however, an image cannot be a package dependency.

I mistakenly use docker in Suggestion. It should be docker.io. docker has been used to a different packages due to historical reason.

Maybe docker-ce could be in suggestions, too. However, it is not part of the official debian repo, so maybe docker.io is the only right/allowed suggestion.

I make podman and docker in Suggestion because I do not want system to install them all. However I learn that it is possible to write dependency like podman |docker.io. If you prefer docker as default which is x11docker's behavior, I will make docker at the front.

Neither docker nor podman should be a hard dependency. A suggestions like docker.io|podman is correct, maybe even a recommend.
x11docker can be used as a wraper for X servers only without docker or podman at all.

I put weston and xwayland in Suggestion rather than Recommends. For deb that means it will not be installed even you use --install-recommends tag. That can make users who do not want to use wayland not install this two package. You know for x11-only system installing wayland support can be kind of heavy.
You are right, they should only be a suggestion.

However, it will make users cannot use wayland functions out of box.

I wouldn't worry about that. Almost no one uses pure Wayland.
x11docker uses weston+Xwayland for some GPU support. If they are missing if one specifies --gpu, x11docker is verbose enough to give the right hints.

A better way is that maybe we make another package like x11docker-wayland.

An additional x11docker-wayland package would only cause confusion.

For Debian's rule, I have asked my friends. Actually man is suggested by not necessary. He suggests that we can use help2man to make a copy of help into it, while another choice is to put github readme into it (Which do you like? ). Only mandatory is to be free. Debian does not accept blob. This problem does not affect x11docker

If we don't need a man page at all, I would drop it.
In case we need it, I would prefer the output of x11docker --help to be converted and adjusted.

@mviereck
Copy link
Owner

Yet I am looking how to merge your changes of x11docker script; after your fork some changes has been commited, some are already on github, some are local on my system.
I think the easiest way is if I add them manually in my local copy and commit them.

Overall it makes sense if I make the code changes in x11docker myself, happily accepting suggestions from you. That's the easiest way for me to check for possible issues.

@CicadaSeventeen
Copy link
Author

CicadaSeventeen commented Oct 19, 2022

If we don't need a man page at all, I would drop it.
In case we need it, I would prefer the output of x11docker --help to be converted and adjusted.

I have made x11docker --help into man.

An additional x11docker-wayland package would only cause confusion.

So I can put xwayland and weston in Suggests ( meaning that will not install normally ),other packages excepting bash, like podman | docker.io and those x* into Recommends ( this is 'harder' than Suggests) and only bash in Depends?
Or you think just to put all wayland and x11 related packages into Recommends? This will make many users to insall weston and xwayland even if thay are not interested in wayland functions.
Which one do you prefer?

@mviereck
Copy link
Owner

So I can put xwayland and weston in Suggests ( meaning that will not install normally ),other packages excepting bash, like podman | docker.io and those x* into Recommends ( this is 'harder' than Suggests) and only bash in Depends?

Yes, I agree.

I would put these in Recommends:
nxagent xinit xauth xclip x11-xserver-utils x11-utils catatonit
docker.io|podman

However, if one has installed e.g. docker-ce, than docker.io should not be installed.
Maybe it could be declared as:
docker.io|podman|docker-ce
(docker-ce at last because it is not in debian repo. I don't now the package name of the commercial version of docker, it should be added to the list, too.)

I've added catatonit, it is useful as a container init system. I've added it in the wiki yet, too.

I would put these in Suggests:
weston xwayland xdotool xpra
Maybe also:
xserver-xorg

Hard dependency only:
bash

@mviereck
Copy link
Owner

mviereck commented Oct 19, 2022

I have uploaded a commit that allows to disable installation options and also does not show them in --help.
I've also adjusted the check_backend function call.
After Version=... there is a line:

Packagedversion="no" # Set to "yes" if you want to package x11docker. This disables installation options.

The auto-generated man page looks interesting.
I'll try out help2man, too. I might be able to adjust the output of --help in a way that it fixes some misformated results of help2man.
I have created and uploaded a man page for x11docker. As a start I've used the result of help2man and fixed it manually.

It seems that a man page is mandatory: (https://www.debian.org/doc/debian-policy/ch-docs.html)

Each program, utility, and function should have an associated manual page included in the same package or a dependency. It is suggested that all configuration files also have a manual page included as well. Manual pages for protocols and other auxiliary things are optional.
If no manual page is available, this is considered as a bug and should be reported to the Debian Bug Tracking System

mviereck added a commit that referenced this pull request Oct 20, 2022
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.

None yet

2 participants