Commit graph

2,225 commits

Author SHA1 Message Date
f21ff8e713
topdir.mk: Add dynamic file creation machinery

Add generic machinery to dynamically create files in $(TOPDIR). The need arises because version controlled configuration files for linters are going to be introduced.

For that, this commit introduces a variable $(TD_GENERATE_FILES), which target all depends on, and which topdir.clean removes.

It defaults to another variable also introduced by this commit, $(TD_COPY_FILES), which in turn defaults to $(TOPDIR)/conf/topdir.

This commit also adds support for JW_PKG_TOPDIR_COPY_PATH. It supports a PATH-style syntax, which allows pointing to multiple directories to be checked for source files. If they exist, they will be appended to the files found in $(TOPDIR)/conf/topdir after copying. Defining arbitray files to copy is not supported before security implications during CI runs are better understood.

Having the copy prerequisites work comes at the cost of having to add .SECONDEXPANSION. Since it's limited to the toplevel Makefile, I suppose that's acceptable.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-31 18:20:30 +02:00
fc6f2fbb65
python-tools.sh: Fix __init__.py linter complaints

The __init__.py files as gnerated by python-tools.sh contain multiple issues, fix them:

- Make the machinery fail if the same type name is imported from different modules
- Support relative imports from .Module import Module instead of having to use the entire module path as import source

- Import types explicitly re-exported with "as":

from .Module import Module as Module
Otherwise ruff will regard the type as "imported but not used"
- Add "# ruff: noqa: E501" near the top. The import lines can get long and are beyond manual control (except for renaming the modules themselves, that is). This can cause ruff to fail, so get it to accept long lines in __init__.py. The style violation doesn't make much of a difference in generated code, anyway, because nobody reads that. Plus what's happening in the code isn't rocket science, so good style wouldn't help much with understanding, either.

This promptly digs up two symbol name conflicts lib.pm.dpkg and lib.pm.rpm. Fix them along with this commit to keep it from breaking the build.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-31 17:51:51 +02:00
22d87143a3
topdir.mk: Cleanup, add static code check targets
- Apply some style fixup to topdir.mk. Notably beautify indentation and move the target area down below the area with the include statements.

- Add the following targets:

format: check-syntax: check-format: check: check-syntax check-format
These targets currently don't do anything and are meant as hooks for individual linters to add dependencies.

- Make .PHONY depend on all phony non-pattern targets

- Make all phony pattern-targets depend on FORCE

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-31 16:53:27 +02:00
fea4231b8e
pkg-dist.mk: Make pkg-release-reinstall: get-pub

Make pkg-release-reinstall depend on get-pub to do the obvious: Have the changes from Forgejo pull requests integrated by CI, too.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-14 16:09:25 +02:00
45f1105f34
topdir.mk: get-pub without JW_PKG_EXTRA_SSH_OPTS

Remove JW_PKG_EXTRA_SSH_OPTS before git pull in the context of get-pub / git-get-pub because it contains -l username, which collides with Forge-style git@<forge> remote URIs.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-14 13:56:28 +02:00
b038baf668
topdir.mk / projects-dir.mk: Add get-pub

Add get-pub for top directory / projects directory level. This is a janware specific target needed for CI. It integrates the current master branch from the new Forgejo-based Git repos.

That said, this will likely need to go along with other release machinery. Packaging is good, but releasing over a bunch of directories is an intricate process, as-is only usable by janware itself, and doesn't need to be part of jw-pkg.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-14 12:44:04 +02:00
ecbe9d20b3
defs.mk: Fix initial version 1.0.0-0-dev

If a project is not initialized via make pkg-init-%, it doesn't contain a VERSION file. When CI tries to build and package such a project, it auto-creates a VERSION file, but a broken one: The revision isn't properly seperated by a dash but by a dot, which makes CI give up while parsing it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-14 11:46:41 +02:00
f6f6e56943
make / scripts: git.janware.com -> devgit.janware.com

janware upstream development server moved from git.janware.com to devgit.janware.com. This commit follows the move with pretty much a simple

s/git.janware.com/devgit.janware.com/

over jw-pkg. It found 14 matches, that's pretty bad.

FIXME: Reduce the redundancy, or, better, replace the devgit.janware.com goodies by a more generally useful concept altogether.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-12 15:15:29 +02:00
ff29d1f863
projects-dir.mk: push --force-with-lease

To make it easier to force-push feature branches, allow that, albeit under --force-with-lease protection.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-05 17:37:53 +02:00
38f13e922a
projects-dir.mk: git-show-ahead-of-master: Add target

Add a new target git-show-ahead-of-master, which does what git-show-pushable did up to now: List all repos where the currently checked-out branch is ahead of origin/master.

git-show-pushable now shows repos that have their checked-out branch ahead of their respective upstream branches. Which is truer to what the target's name suggests.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-05 17:22:14 +02:00
262be57741
cache.mk: Don't overwrite defined variables

Check with ifndef if a variable is defined before hard defining it in cache.mk. This gives more flexibility when overriding variables with local.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-05 16:57:00 +02:00
38076c951b
cleandirs.mk: Fix: Descend into subdirectories

cleandirs.mk doesn't descend into subdirectories, because defs-dirs.mk is not included, and, hence FIND_SUBDIRS is undefined. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-05 16:55:44 +02:00
514d66dac1
cmds.distro.CmdInfo: Rename to cmds.platform.CmdInfo

Rename command "distro" to "pkg" together with "info", its last remaining subcommand. "distro" is often used in the sense of "Linux distribution", which would be too narrow for the targets jw-pkg could theoretically support.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-24 16:53:55 +02:00
5830984bfc
cmds.distro.CmdXxx: Rename to cmds.pkg.CmdXxx

With the exception of the "info" subcommand, nearly all of distro's subcommands deal with package managing, so push them into their own command category.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-24 16:53:55 +02:00
c1e76bdd81 projects-dir.mk: Get with --create-remote-user-repos

pgit.sh get is not invoked with --create-remote-user-repos by default. For the janware Git servers, this makes CI fail over new repos: Repos from the maintainers are pulled, but before pkg-rebuild-reinstall, repos that the devops user has no remote repo for are purged again and are subseqently missing during build.

Passing --create-remote-user-repos to all pgit.sh get invocations should fix the problem, so do that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-24 09:02:52 +00:00
281cdf4ec7 cmds.projects.CmdCanonicalizeRemotes: Add command

CmdCanonicalizeRemotes / canonicalize-remotes and the respective target in topdir.mk remove the /srv/git portion from all remotes' URLs pointing to git.janware.com.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-13 12:23:02 +02:00
d8653ac486 Remove /srv/git from janware Git URLs

git.janware.com has /srv/git removed from its Git URLs, follow suit.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-13 12:15:37 +02:00
41b0b8f023 defs.mk: Remove installation type SCRIPT

Installation type SCRIPT has beed disabled long ago because of its overlap with EXE. Remove the dead code around it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-11 14:51:11 +02:00
30c4d7101f projects-dir.mk: list-files: Don't use /usr/bin/file

/usr/bin/file <candidate> | grep text is used to detect if a file is a text file or not. Replace that with grep -I., because that adds some files left out by /usr/bin/file, notably systemd service files.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-11 14:50:44 +02:00
5af68a6541 projects-dir-minimal.mk: get-auth-info --interactive false

PROJECTS_DIR_REMOTE_BASE and JANWARE_USER is determined by jw-pkg.py get-auth-info. Interactivity hurts here, though, turn it off.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-07 15:34:52 +02:00
160cb993df projects-dir.mk: Add git-show-pushable

Rename git-show-pushable-master-branches to git-show-pushable, because, the target's recipe doesn't show pushable master branches, but all commits in the working directories current branch not present in origin/master.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-04 18:57:40 +02:00
fe5f343536 projects-dir.mk: Re-enable persistent SSH connections

This reverts commit 88e81 and effectively re-enables persistent SSH connections to speed up builds.

commit 88e8197ed7 Author: Jan Lindemann <jan@janware.com> Date: Thu Apr 20 20:00:46 2017 +0000
projects-dir.mk: Partly disable persistent SSH
Don't use persistent SSH-connections any more for "pkg-" targets, because, sadly, this hangs after uploading a package.

This commit puts some safeguards against hanging SSH into place, namely setting default SSH timeouts down, SSH keepalive, setting SSH BatchMode to yes.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-04 18:57:16 +02:00
1d17d16519 projects-dir.mk: Retire BUILD_PROJECTS

Use DEP_PROJECTS instead of BUILD_PROJECTS everywhere. DEP_PROJECTS considers more projects, and for all targets it is relevant to, it's desirable to have them operate on the maximum blast radius.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-04 16:15:38 +02:00
5916dca0c5 projects-dir.mk: Add variable DEP_PROJECTS

make git-show-pushable-master-branches misses projects which should better be pulled in as dependencies. It searches $(BUILLD_PROJECTS) for repositories with pushable commits, that variable leaves some out, and DEP_PROJECTS has them. It make use of the renovated pkg-requires command.

This move should be extended to other uses of BUILD_PROJECTS as well, after giving it some test runs. And the legacy and redundant command prereq should be removed.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-03 19:07:44 +02:00
27bf98f747 pgit.sh: Beautify logging

Log to stderr and add some ASCII-art around the output. Also, add a --porcelain option to allow more stable output parsing. Subsequently, use that option in make targets parsing the output, notably make diff and make git-show-xxx.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-27 09:16:14 +01:00
5a48143064 py-defs.mk: Move boolean vars to top

Move the PY_XXX = true|false variable definitions meant to be preset by including makefiles to the top of py-defs.mk to make the structure of the file clearer.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-17 16:22:17 +01:00
226a241e8a py-defs.mk: Add PY_INSTALL_INIT_PY

Add PY_INSTALL_INIT_PY ?= true to py-defs.mk. If set to false, a Python module will not try to attempt installing an existing / generated __init__.py. This is useful when installing into an exiting directory with an existing __init__.py.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-17 16:22:02 +01:00
eb216692eb defs.mk: Add *.yaml to LOCAL_CFG
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-17 13:38:18 +01:00
c893584e5e make: Replace RPM -> PKG

jw-pkg supports more than RPM-based package managers, but for historic reasons, lots of its Makefile variables still have "RPM" in their names. This is misleading. Replace "RPM" in variable names by the more generic "PKG" where appropriate.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:57:50 +01:00
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