Commit graph

2,196 commits

Author SHA1 Message Date
ed17aaa6c9 make: Align equal signs in *.mk to column 30
Chore: Format equal signs uniformly. They should all be at column 30
but aren't. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:57:50 +01:00
d8db1e77dc rpmbuild.mk: Remove cruft
Remove stuff from rpmbuild.mk which is either unused, unusable or
not aligned with non-rpm-centric packaging workflows:

  - Variable RPMBUILD

  - Targets pkgbuild.dist pkg-upload-local.dist

  - Variables used by these targets

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:57:43 +01:00
9cd5ef2b98 upload-defs-rpm.mk: Remove
upload-defs-rpm.mk doesn't contain anything useful, remove it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:53:53 +01:00
153652a832 rpmdist.mk: Add pkg-release-update-version
Currently, the the version file is updated in the context of

  pkg.sh release-reinstall -D "$(RPM_REQUIRES_DEVEL)"

RPM_REQUIRES_DEVEL is often filled from the current version, which in
turn is filled from the version file, so the order of events here is
unclear at best.

Add target pkg-release-update-version and make pkg-release-reinstall
depend on it to make the order explicit.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 07:20:52 +01:00
e66acbee70 rpmdist.mk: Remove dead code
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 06:12:01 +01:00
d7cd96bd4b rpmdist.mk: pkg-release-reinstall -> get-official
Make target pkg-release-reinstall depend on target get-official. It
already depends on get-maintainer, but that's not enough in
situations where devops built a target on platform A, pushed the new
release, then proceeds to build on platform B: It needs to pull its
own changes made during release of A.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 06:05:01 +01:00
02c4f9080b topdir.mk: Add target get-official
make get-official already works as a pattern rule, but this commit
adds it explicitly to make tab-completion work.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 06:05:01 +01:00
adb7fce0ab topdir.mk: pkg-install-release-deps: Improve selector
Use pkg-requires --hide-self to find all prerequisites that should be
installed for a test run against packages installed from the
repositories, including self-built and self-hosted packages.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 19:34:50 +01:00
5b3118319c cmds.projects.CmdRequiredOsPkg|BaseCmdPkgRelations: Align APIs
In a push to eventually merge the classes, somewhat align the
command-line API of CmdRequiredOsPkg to the one of
BaseCmdPkgRelations by using dependency flavours as mandatory, first
argument.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 18:33:51 +01:00
57f204ccaa cmds.projects.BaseCmdPkgRelations: Remove --no-version
Merge --no-version into the --syntax option as "--syntax names-only"
to remove redundancy.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 16:41:59 +01:00
84f1ad66f6 topdir.mk / projects-dir.mk: Remove BASE_PKGS
Move the dependencies listed in BASE_PKGS from projcts-dir.mk and
topdir.mk into project.conf.

Due to various hen-and-egg problems on a minimal system, in some
situations these packages can't be installed from project.conf. The
same is true with BASE_PKGS, however, so remove it, at least that
does away with some redundancy.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 14:58:54 +01:00
7046983d7c cmds.projects.BaseCmdPkgRelations: --syntax debian
Add support for --syntax to BaseCmdPkgRelations.pkg_relations(), and
default to 'semver', i.e. the current state of affairs. If that's
changed to 'debian', relations declared in project.conf as

  pkg.requires.os.devel = jw-pkg-devel > 1.2.3

will be output as

  jw-pkg-devel >> 1.2.3

which is what Debian expects.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:43:08 +01:00
e56befb1c3 projects-dir.mk: No time -p on JW_PKG_PY_PROJECTS
Don't prefix JW_PKG_PY_PROJECTS with time -p. A timing summary shows
up in too many places unexpectedly, e.g. in the context of the target
update-text-files. Add back later as more concrete demand comes up.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:40:30 +01:00
d652731624 projects-dir.mk: Fix list-files' recipe
Remove echo realpath PROJECTS_MAKEFILE_NAME from the list-files
recipe. Misguided on more than one level.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:40:05 +01:00
c159a11bbe topdir.mk: pkg-install-[testbuild|relase]-deps: Unify
Make pkg-install-testbuild-deps an alias for
pkg-install-release-deps. At this point, they do nearly the same
thing, and the distinction between what the implementations should do
are blurry at best. This commit removes redundancy but keeps the use
cases distinct. Different implementations can be reinstantiated
should requirements for different implementations become clearer
later on.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 14:30:28 +01:00
d97cf111da project.conf: pkg.requires.relase.os = build-essential:native
Fix the following package build error:

    $ dpkg-buildpackage -us -uc -ui
    dpkg-buildpackage: info: source package jw-pkg
    dpkg-buildpackage: info: source version 1.0.0-184
    dpkg-buildpackage: info: source distribution kali-rolling
    dpkg-buildpackage: info: source changed by janware GmbH <jan@janware.com>
     dpkg-source --before-build .
    dpkg-buildpackage: info: host architecture amd64
    dpkg-checkbuilddeps: error: unmet build dependencies: build-essential:native
    dpkg-buildpackage: error: build dependencies/conflicts unsatisfied; aborting
    dpkg-buildpackage: hint: satisfy build dependencies with your package manager frontend
    debuild: fatal error at line 1185:
    dpkg-buildpackage -us -uc -ui failed

This pulls in a lot of dependencies and should be made more specific
if possible.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 11:26:13 +01:00
d4aab54607 project.conf: Remove pkg.requires.ubuntu|raspbian
Remove the sections pkg.requires.ubuntu|raspbian from project.conf,
because their contents is present in pkg.requires.debian and is
already evaluated by Ubuntu and Raspbian builds.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 11:26:13 +01:00
cc058394d8 project.conf: pkg.requires.build.os: pkg-config -> devel
Don't build-depend on pkg-config, because it's unnecessary to build
jw-pkg.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 11:26:12 +01:00
b7b2e9d5f4 project.conf: pkg.requires.build.os: -inkscape, +cpio
Remove dependency inkscape: It's needed by svg-to-pixmap.mk, but not
for building jw-pkg. If anything, -devel should depend on it, but
that seems a little heavy handed and can be achieved by packages
which know that they include svg-to-pixmap.mk.

Add dependency cpio: Needed by pkg.sh to copy a the source file tree.
Will be removed again as soon as pkg.sh goes Python.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 11:25:46 +01:00
3e897f4df8 lib.Distro, ExecContext: Add classes, refactor lib.distro
The code below lib.distro, as left behind by the previous commit, is
geared towards being directly used as a command-line API. This commit
introduces the abstract base class Distro, a proxy for
distribution-specific interactions. The proxy abstracts distro
specifics into an API with proper method prototypes, not
argparse.Namespace contents, and can thus be more easily driven by
arbitrary code.

The Distro class is initialized with a member variable of type
ExecContext, another new class introduced by this commit. It is
designed to abstract the communication channel to the distribution
instance.  Currently only one specialization exists, Local, which
interacts with the distribution and root file system it is running
in, but is planned to be subclassed to support interaction via SSH,
serial, chroot, or chains thereof.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-06 14:56:46 +01:00
43464786dc project.conf: Remove nonsensical maintainer scripts
Remove maintainer scripts that are long since obsolete.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-06 12:06:28 +01:00
3457daa0fb platform.mk: Add HOST_DISTRO_INFO
HOST_TUPLE is bastardized to contain more info that just the GNU
Triplet. Add HOST_DISTRO_INFO to do the caching job, and leave
HOST_TUPLE alone.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-03 05:32:47 +01:00
e93338872f defs.mk: Move PKG_FORMAT definition into platform.mk
PKG_FORMAT is now more straightforward to get with from the revised
jw-pkg.py distro info --format '%{cascade}', so do that, and do it in
the context where all the other variables are set from the output of
that command.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-02 12:55:36 +00:00
0cf4b29cfb scripts/get-os.sh: Remove
Remove the now obsolete get-os.sh from jw-pkg. Use "jw-pkg.py distro
info" to get the information it used to provide.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-02 12:55:36 +00:00
c241634cf1 projects-dir.mk: Replace get-os.sh by jw-pkg.py distro info
To reduce redandancy, replace get-os.sh by jw-pkg.py distro info in
projects-dir.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-02 12:55:36 +00:00
fa65047d2f platform.mk: Replace get-os.sh by jw-pkg.py distro info
To reduce redundancy, replace get-os.py by jw-pkg-py distro info.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-02 12:55:36 +00:00
521600bc56 projects.mk -> platform.mk: Move definitions up
To remove redundancy, get-os.sh needs to be retired in favor of
pkg.py distro info. It's needed in platform.mk, but the only
definiton of JW_PKG_PY is in projects.mk, so move it, along with the
variables essential for the command:

  include $(JWBDIR)/make/py-version.mk (defining PYTHON)
  JW_PKG_PY
  DEVELOPMENT
  VERSION_FILE

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-02 12:55:36 +00:00
fbeefa2d9e projects-dir.mk: Add target get-official
Follow the pattern of get-maintainer, and add that target to
projects-dir.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-26 15:20:25 +01:00
9449840401 projects-dir.mk, topdir.mk: Alias get-% for git-get-%
Add a VCS-independent rule rule get-%, currently an alias for
git-get-%, with an empty recipe to keep GNU Make satisfied.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-26 15:18:09 +01:00
aa8d1cbfc6 projects-dir.mk: get-get-%: Merge into current branch
Don't use the master branch as target when getting code from
somebody, merge into the branch currently checked out.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-26 15:18:09 +01:00
9aba15cd88 topdir.mk: git-get-% -> current-branch
Currently git-get-% pulls into the master branch. Change that to pull
into the branch currently checked out in the workspace, because
that's the more likely use case if you want a quick update from
somewhere.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 15:54:53 +01:00
5a3299b1c6 projects-dir.mk: Add [git-]get-maintainer
Add targets to update all repositories from their respective
maintainers.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 15:53:27 +01:00
f86634a1d1 pgit.sh: Rename command "clone" to "get"
"clone"  in the Git sense means to copy a remote project over from
scratch. pgit.sh clone has come from that, but has since evolved into
something different, a mixture of clone, pull and fetch, so find a
different name. "get" seems generic enough and doesn't clash with a
Git meaning. Adapt variable names accordingly across the project.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 15:53:25 +01:00
8074abad5d projects-dir.mk: Fetch to current branch by default
To be explicit about what's happening during make fetch, default the
fetch refspec to $(CLONE_FROM_USER):current-branch:current-branch.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 04:21:34 +01:00
ada7e7572f topdir.mk: git-pull-%: Always use pgit.sh
git-pull-<username> doesn't use pgit.sh if username == login.
pgit.sh should handle that case fine now, so remove the distinction
from topdir.mk and make it in one place, i.e. pgit.sh. This has the
additional advantage that pull as done by pgit.sh conveniently uses
--autostash.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-19 19:38:16 +01:00
f1bb90423f projects-dir.mk: Keep HOME in reinstall's env
Add HOME back to environment for pkg-*install*-like targets.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-19 08:46:44 +01:00
0c0617d794 projects-dir.mk: Keep SSH_AUTH_SOCK in reinstall's env
Purging the environment of pkg-release-reinstall did a tad too much:
Add SSH_AUTH_SOCK back to allow SSH agent-based authentication to go
through.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-19 08:22:43 +01:00
fc80bde804 topdir.mk: git-init et al: Change commit message
Change commit message of first commit from "initial checkin" to
"First commit", because that's more to the point.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 19:21:14 +01:00
48664724ce project.conf: Remove sudo and gawk from run deps
sudo is certainly not needed for the run package (which in itself is
hardly useful at all), so move that dependency into the devel
package. Same for gawk. /opt/jw-pkg/bin/get-os.sh depends on it,
but I don't see where else but in a -devel context that would matter.
And if it breaks something, it is going to be an easy fix without
awk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 18:20:33 +01:00
3ad021f071 projects-dir.mk: reinstall with --source-profile=replace
--source-profile=replace should be passed to all

    jw-pkg.py projects build pkg-*install

invocations. Those invocations typically happen in the context of
pkg-%install, so add that target, specializing the pkg-% target.

The problem this solves is that /etc/profile is currently read only
once before bootstrapping all software on a pristine system is
started. This might lead to the situation that package A has
installed environment variable definitions into /etc/profile.d,
package B needs them for building, but never gets to read them.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 14:44:57 +01:00
c569b188a4 rpmdist.mk: Add target pull-maintainer
To complement git-pull-maintainer with something more generic, also
suitable for other SCMs, add the target pull-maintainer and make
pkg-release-reinstall depend on it. Currently only visible in the
context of pkg-% targets, scope might be expanded if need be.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
5e040f652e topdir.mk: Use pgit.sh for git-pull-%
Use pgit.sh to for the git-pull-% target. This should make
git-pull-maintainer work. To limit the blast radius for now, only use
it if the source user differs from the invoking user.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
7f85a5f2d6 projects+project.mk: Add file
Multiple variables are redundantly defined both for a project and for
the multiple-projects toplevel directory. Add a place to maintain
them centrally, and add PGIT_SH as a first variable.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
0e4ab928de projects-dir-minimal.mk: Add target init
Add an init target. Use it if you want to tell the Makefile: _Just_
initalize the build machinery and nothing else, don't pull and build
everything else you can. Not strictly necessary, most of the time
pulling everything is what's wanted, and that does the init anyway.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
2f50092e19 projects-dir.mk: Add target pkg-delete-ours
The target pkg-delete-ours, invoked from the projects directory,
should wipe all packages from the system which have been created and
installed via jw-pkg.

Currently they are selected via url =~ janware. This is a default
string which can be overridden by redefining JANWARE_PACKAGE_FILTER.
This might not be the most generic name, but is kind of consistent
and will be matched once all variables get renamed to a more generic
naming scheme.

This currently does not get all packages: Some are not labeled with
URLs matching "janware", because jw-pkg is only used as a convenient
way to package other people's open source projects.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
37b436c04f defs.mk: Pass -f $(PKG_FORMAT) to pkg.sh log-install
pkg.sh log-install needs to know what package format it should log
an install for, so specify it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-15 16:04:33 +00:00
152fa65f57 project.conf: pkg.requires.jw.devel = jw-pkg-run
jw-pkg-devel doesn't depend on jw-pkg-run, which is wrong, because it
needs jw-pkg.py.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-14 09:20:24 +01:00
f669bd0af5 project.conf: pkg.requires.os.devel = make
Add a package dependency on make for the -devel package. Installing
jw-pkg's Makefiles doesn't make much sense without it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-12 20:37:24 +01:00
ec093d3cc9 defs.mk: Add $(wildcard *.socket) to LOCAL_SYSTEMD
By default, install systemd socket definitions found in a config
directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-12 20:37:10 +01:00
4932c6816c projects.mk: ?= -assign VERSION_FILE
If VERSION_FILE is not found, trying to include makefile snippets
triggers the attempt to regenerate it. This happened for installed
Makefiles of jw-docker-images: It defines TOPDIR to
/opt/jw-docker-images, projects.mk looks there, but the version file
is installed under /usr/share/doc/packages/jw-docker-images/VERSION.

Allow VERSION_FILE to be overridden including code to keep that from
happening.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 10:00:17 +01:00