Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.java > #12806

Re: Debian package examples for Java software

Path csiph.com!fu-berlin.de!bofh.it!news.nic.it!robomod
From "Michael K. Edwards" <m.k.edwards@gmail.com>
Newsgroups linux.debian.maint.java
Subject Re: Debian package examples for Java software
Date Sat, 14 Sep 2024 23:30:01 +0200
Message-ID <JmIv7-chGx-1@gated-at.bofh.it> (permalink)
References <JmxT3-cbl3-15@gated-at.bofh.it> <JmB0B-cd7M-9@gated-at.bofh.it> <JmDvr-ceGV-5@gated-at.bofh.it> <JmErw-cff8-7@gated-at.bofh.it> <JmGCZ-cgt1-5@gated-at.bofh.it>
X-Mailbox-Line From debian-java-request@lists.debian.org Sat Sep 14 21:26:02 2024
Old-Return-Path <m.k.edwards@gmail.com>
X-Amavis-Spam-Status No, score=-2.089 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FOURLA=0.1, FREEMAIL_FROM=0.001, FVGT_m_MULTI_ODD=0.02, RCVD_IN_DNSWL_NONE=-0.0001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=no autolearn_force=no
X-Policyd-Weight using cached result; rate: -5.5
X-Gm-Message-State AOJu0YyGb22HPrKc8B94uj1xtonZAdifYcCwkwg+tUD4F4pIzPWnSmOv jCaKoLip1KRXNnHX6e5JO2ZFW7wNz680AZVyE6vNi23qa/+VU7eutsBTn+2/pz0fysNQ8pIeAfU jynufwRdbX5uy+JXuZY1QyRA2I9lCTiD4YC0=
X-Google-SMTP-Source AGHT+IFMUCEXDG+bVjx1r9dgLFukZC8TQ/bHqNoSY4gYtK4iKUBsb/fDoZiDervcdaE7MstzTAaEVeCWqqpqZvQvB4I=
X-Received by 2002:a05:690c:f86:b0:6ae:1e27:c994 with SMTP id 00721157ae682-6dbb6ad2e54mr105712107b3.3.1726349141565; Sat, 14 Sep 2024 14:25:41 -0700 (PDT)
MIME-Version 1.0
Reply-To M.K.Edwards@gmail.com
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
X-Mailing-List <debian-java@lists.debian.org> archive/latest/23504
List-ID <debian-java.lists.debian.org>
List-URL <https://lists.debian.org/debian-java/>
List-Archive https://lists.debian.org/msgid-search/CAJ0nH1hKM9gmqwLOCdSoW9sBYSY5sXtzQMOygwOyZOE2txZqrw@mail.gmail.com
Approved robomod@news.nic.it
Lines 111
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Cc debian-java@lists.debian.org
X-Original-Date Sat, 14 Sep 2024 14:25:27 -0700
X-Original-Message-ID <CAJ0nH1hKM9gmqwLOCdSoW9sBYSY5sXtzQMOygwOyZOE2txZqrw@mail.gmail.com>
X-Original-References <CAHywH5B97Z0CuGLUdCVB0tR4-pTyyRQTUHs1C2gxws1FAwMgmg@mail.gmail.com> <ebe1483a-915d-4fe6-8725-356722c4dfb7@debian.org> <CAHywH5BF2OByp9SqawOXzx9s2dCOVSYxdX6=EAYZucJarh2y3A@mail.gmail.com> <8b94e20f-2d6d-4297-814b-9e4e18febb69@debian.org> <CAHywH5D4wA4u47jDH6qwMvnMhnF+c3Tb+_2G5b7NXnsEnoZ4tw@mail.gmail.com>
Xref csiph.com linux.debian.maint.java:12806

Show key headers only | View raw


Peter —

I'm not a debian java maintainer (or DD at all), I'm just someone who
has used Debian and derivatives for 25 years.  So take this with a
grain of salt.

The reason you're getting resistance to your request — apart from
social stuff, on which I won't comment — is that the technical
obstacles are not really anything to do with Java.  Debian binary
packaging (nevermind source) isn't just binaries and scripts, it's
also mutations to a system-wide dpkg database that doesn't have a
concept of user-specific content.  The function of the --root= flag
isn't to support a user-specific database, it's to allow manipulation
of a whole separate root filesystem mounted at that location, and
without having a full userland there and chrooting into it, you're not
going to be running anything with significant system dependencies (i.
e., anything).

What I would recommend in 2024 is that you package your software as a
private .deb — which is fairly straightforward, even if you have
binary blobs that aren't built during the package build — and then
install that inside a suitable base debian container image.  Docker is
one way to do that (and the docker engine is free-as-in-beer and
root-optional if you don't need complicated networking); there are
others.  One reasonable choice, based on minideb, is the Bitnami image
found at https://hub.docker.com/r/bitnami/java .

I greatly prefer maintaining a debian packaging setup, developing
locally, and installing via dpkg inside a container with controlled
dependencies over open-coding stuff in a Dockerfile.  And I'd use the
same base image for Java and non-Java applications (packaged
separately), for ease of maintenance; go ahead and add a real Python
on top of the base Java container image (if you choose bitnami, see
https://github.com/bitnami/containers/blob/main/bitnami/python/3.12/debian-12/Dockerfile
for how to do this).  Be aware that this is not a Debian-packaged
python — you can do that instead, but it's a different path — but
you're using virtualenv and `python -m pip install -r
requirements.txt` (as a user that is not the runtime user) for all
your version-locked library dependencies anyway, right?  If not, well,
YMMV.  (The needs of a Python application packager are not the needs
of the debian-python team either.  There is some merit in maintaining
your own debian repo with custom-built version-locked system-Python
library packages too — I've done it, for good and sufficient reason,
along with the Java analogue — but you're going to have to learn a lot
about Debian if you go down that road.)

I lurk but rarely post on any of the Debian lists.  Email me directly
if I can be of further assistance.

Cheers,
- Michael

On Sat, Sep 14, 2024 at 12:26 PM Peter Bittner <peter.bittner@gmx.net> wrote:
>
> > If you tell us what you want to package, we can tell you a good example
> > out of more than 50.000 packages
>
> I'm really looking for generic examples. My motivation is using a
> standard, widespread convention or otherwise popular tooling for
> deploying software (which - at work - is not open source). So that new
> developers don't need to learn "the process". When you see a "debian"
> folder in a repository you probably already guess that the project
> will build a .deb package. When you see a .deb package you can easily
> guess how it will be installed.
>
> One of the softwares is a Java Web application (delivered to us as a
> .jar and some accompanying files) that is deployed into a JBoss
> application server preinstalled on the host. The other is actually not
> even Java software, it's a bunch of shell scripts and two Python CLI
> applications that are installed from an internal PyPI index. So, it's
> all about copying files somewhere and performing installation
> activities that are encapsulated in the .deb file.
>
> > > location where it has write access. The scenario is, I have users that
> > > must install the software on a managed machine. The system
> > > administrators manage the operating system as such, the users install
> > > and run their software in user space.
> >
> > As far as I know NO WAY to do so.
>
> Let me mention that for my use case it's sufficient that we assume
> there are no dependencies, or that if we have unresolved dependencies
> (e.g. most notably a JRE) the installation process aborts brutally.
>
> Doing some research I found a few interesting discussions:
> - https://askubuntu.com/questions/339/how-can-i-install-a-package-without-root-access
> - https://askubuntu.com/questions/193695/installing-packages-into-local-directory
>
> The two suggested solutions are using `--force-not-root` or simply
> unpacking the .deb archive file:
>
>     dpkg -i --force-not-root --root=$HOME package.deb
>     ar p package.deb data.tar.xz | tar xJv --strip-components=2 -f -
>
> The latter will certainly not run pre- or post-install scripts, which
> is one of the reasons I want to do the packaging, though. (Encapsulate
> the installation logic in the installation package itself!)
>
> Now I would need a simple packaging setup to verify that those
> commands actually work for my use case.
>
> Peter
>

Back to linux.debian.maint.java | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Debian package examples for Java software Peter Bittner <peter.bittner@gmx.net> - 2024-09-14 12:10 +0200
  Re: Debian package examples for Java software Mechtilde Stehmann <mechtilde@debian.org> - 2024-09-14 15:30 +0200
    Re: Debian package examples for Java software Peter Bittner <peter.bittner@gmx.net> - 2024-09-14 18:10 +0200
      Re: Debian package examples for Java software Mechtilde Stehmann <mechtilde@debian.org> - 2024-09-14 19:10 +0200
        Re: Debian package examples for Java software Peter Bittner <peter.bittner@gmx.net> - 2024-09-14 21:30 +0200
          Re: Debian package examples for Java software Mechtilde Stehmann <mechtilde@debian.org> - 2024-09-14 22:00 +0200
            Re: Debian package examples for Java software Geert Stappers <stappers@stappers.nl> - 2024-09-14 22:50 +0200
          Re: Debian package examples for Java software "Michael K. Edwards" <m.k.edwards@gmail.com> - 2024-09-14 23:30 +0200
            Re: Debian package examples for Java software "Michael K. Edwards" <m.k.edwards@gmail.com> - 2024-09-15 00:00 +0200
            Re: Debian package examples for Java software Peter Bittner <peter.bittner@gmx.net> - 2024-09-15 17:10 +0200
              Re: Debian package examples for Java software "Michael K. Edwards" <m.k.edwards@gmail.com> - 2024-09-15 18:10 +0200
  Re: Debian package examples for Java software Emmanuel Bourg <ebourg@apache.org> - 2024-09-17 01:30 +0200

csiph-web