Commit graph

2,200 commits

Author SHA1 Message Date
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
26cf7f7823 project.conf: Use Group Development/Tools/Building
Change package group from System/Libraries to
Development/Tools/Building because that expresses the purpose of the
package better.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 09:59:24 +01:00
ef52a2810a defs.mk: Add $(wildcard *.timer) to LOCAL_SYSTEMD
By default, install sytemd timer definitions found in a config
directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 09:58:30 +01:00
67e56146f8 lo.mk: Fix warning that targets were not remade
make complains for plugins that soandso.dll has not been remade. The
problem is that it tries to remake all targets of a multi-target.
Split that up into two rules.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 09:57:59 +01:00
741a3b6db2 make: Install cache-projects.mk
.cache-projects.mk is not installed / packaged, which makes builds
against an installed jw-pkg considerably slower. Change that, at the
risk of making the installed jw-pkg-devel less versatile. This commit
installs a cache file cache-projects.mk, renamed from
.cache-projects.mk, because there's no justification for hiding an
installed makefile. At least I can't think of one.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-01 09:50:52 +01:00
845e7a3577 projects-dir.mk: Fix typo JW_PKG_PY_PRJECTS
Fix misspelled variable JW_PKG_PY_PRJECTS.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-29 13:29:50 +01:00
4ff29ba255 projects-dir.mk: Add target pkg-manager-dup
There's pkg-manager-refresh already, so by adding pkg-manager-dup the
distribution can be upgraded by distribution agnostic targets only
through the Makefile. This might come in handy for CI, so add it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-29 12:53:06 +01:00
2bbf5bd8e7 jw.pkg.cmds.projects.CmdRequiredOsPkg: Support --quote
--quote puts double quotation marks around the listed dependencies,
protecting version requirements (>= 1.0) and parenthesis "perl(GD)"
from the shell.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-29 11:28:17 +01:00
b8e8ecf2f1 pkg-manager.sh: Replace by jw-pkg.py distro
Retire pkg-manager.sh and replace it by the cleaner "jw-pkg.sh
distro" command, essentially providing the same functionality and
nearly the same command-line interface.

Not-so-fun-fact:

  jw-pkg > git diff --stat jw-devops/master
  ...
  71 files changed, 732 insertions(+), 340 deletions(-)

400 LOC more. That's what the move from a shell script to the more
maintainable Python versions costs. Still a good idea, and the
enhanced extensibility might pay off in terms of LOC with other shell
scripts in the future.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
132dce8b3f jw-projects.py: Rename it to jw-pkg.py
jw-projects.py is now a multi-call executable, with "projects" being
just one of its subcommands. Rename it to jw-pkg.py to reflect that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 15:24:16 +01:00
1154cb984c ldlibpath.mk: Replace ifndef by ifeq ($(origin, ...))
As per info make, it turns out that ifndef SOME_VAR is true for
SOME_VAR defined to an empty value. This is unusable for caching, so
replace it with ifeq ($(origin SOME_VAR),undefined).

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 15:24:13 +01:00
aefe983920 jw.pkg.App: Support --topdir-format
Add support for --topdir-format. The option supports several
different values, affecting the console output of App wherever it
knows that the output contains a reference to the projects' toplevel
directory.

  - "unaltered" will have it print the toplevel directory in the same
    format as passed to the commandline

  - "absolute" will try to resolve it to an absolute path before
    printing

  - make:XXX will return the make-varible $(XXX) instead

To implement this, the proj_dir() member function is turned into the
private member function __proj_dir(), and a new member function
find_dir() is supplied, with two additional parameters:
search_subdirs and search_absdirs, which will try to find an existing
directory relative to the toplevel directory of the given module, or
in the search_absdirs list, respectively.

Command modules in cmds.projects have been updated to use the new
function.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
0b83c863a2 jw.build.cmds: Move build.cmds -> cmds.projects
Reorganize the Python module structure. Placing the command classes
under jw.cmds.projects instead of jw.build.cmds will allow to add a
nested command structure, with the current commands, being mostly
related to building software, found below a "projects" toplevel
command.

Other conceivable commands could be "package" for packaging, or
"distro" for commands wrapping the distribution's package manager.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
f869b5aaca defs.mk: Define Q and use it in *.mk
Define Q ?= @, and replace @<command> in recipes by $(Q)<command>.
Meant to be overridden from the environment for debugging as in

  Q= make

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
6ba9b2079d projects.mk: PROJECTS_PY_EXTRA_(ARGS->OPTS)
Rename the variable PROJECTS_PY_EXTRA_ARGS to PROJECTS_PY_EXTRA_OPTS
to be consistent with projects-dir.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
58ae1b68ca py-defs.mk: Remove PY_PREREQ_BUILD[_DIRS]
Remove PY_PREREQ_BUILD and PY_PREREQ_BUILD_DIRS from py-defs.mk:
Apparently they're not used anywhere, and are costly in terms of
directory startup time.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
f05e1ee0e3 make/[Makefile|*.mk): Improve variable caching
This commit aims at improving speed by using better caching.

  - Makefile, cache.mk: Split .cache.mk up

    To allow caching of runtime path variables which are
    project-specific, split .cache.mk up in .cache-project.mk and
    .cache-projects.mk

  - ldlibpath.mk: Cache ldlibpath, exepath and pythonpath

    Place the output of $(call proj_query ldlibpath), $(call
    proj_query, exepath) and $(call proj_query pythonpath) in
    JW_PKG_LD_LIBRARY_PATH, JW_PKG_EXE_PATH, and JW_PKG_PYTHON_PATH
    respectively, and cache the variables in make/.project-cache.mk.

  - cache.mk: Use = instead of :=

    Recursively expanded variables are nearly as fast as := variables
    if the assigned value is a fixed string. And sometimes it's not,
    rightly so, because variables get assigned below, as with
    JW_PKG_XXX for instance.

  - cache.mk: Use $(TOPDIR) as variable values

    Replace absolute references to project's topdir by $(TOPDIR) with
    sed. As soon as the project queries produce absolute paths, they
    will be transformed into relative paths which allow the code base
    to be moved to a different location and still remain functional
    without a rebuild.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
19d0397b34 make/Makefile: Remove cruft + CACHED_VARS
Remove unused code, and code which actually does something:
CACHED_VARS looks as if it's sufficently and more centrally defined
in make.mk, don't override that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
494d5d29d6 std-targets.mk: Add file
Add std-targets.mk, meant to be included mostly to make sure all
mandatory targets are there. On clean and distclean, it also removes
stuff that should not be there anymore after clean.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
bb44ee11c8 projects-dir.mk: clean-dirs: Remove trailing slashes
clean-dirs passes project names with trailing slashes to projects.py,
remove them.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
18f6d583b4 rpmdist.mk: make check_scm_sync pull from maintainer
Change $(check_scm_sync) from "make git pull" to "make
git-pull-maintainer", which most notably should delegate devops
builds to the maintainer defined in project.conf.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-20 15:14:34 +01:00
4b4b43193c topdir.mk: Add pkg-install-testbuild-deps
There's little system in the pkg-install-xxx targets, add one more to
increase the confusion. It's needed to install all packages needed to
do a standalone build against the packages installed into the system
via package manager. That said, the respective jw-projects.sh
commands need broader refactoring, as well as the pkg-install-xxx
target naming.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-20 14:56:08 +01:00
49086708e4 build.cmds.CmdListRepos: Support local repos
Make jw-projects.py list-repos support a local directory as base URL
of all git repositories, notably used by PROJECTS_DIR_REMOTE_BASE,
which can now point to a local directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-15 15:05:23 +00:00
50a19954b4 projects-dir-minimal.mk: Make included targets once
Targets defined by projects-dir.mk are not available before it is
included, but make makes up its mind about what targets are available
after parsing the included makefiles, so remove that redundancy.

On the other hand, a dependency alone is not enough for make to
understand that an included makefile has been remade, it needs a
rule, so add a dummy-rule body. In this case only echoing that the
include file has been provided.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-14 13:05:15 +01:00
1759266dd6 defs-dist.mk: HTMLDIROWNER wwwrun -> root
Change HTMLDIROWNER from wwwrun to root for the same reason as with
HTMLOWNER: Better security.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-13 15:41:46 +01:00
47efb08088 projects-dir.mk: Cope with missing /usr/bin/time
Kali Linux' default installation doesn't have /usr/bin/time which
brings out a but: $(TIME) doesn't expand to nothing but to -p, which
fails miserably, of course. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-07 09:38:50 +01:00
a294c4ec34 projects-dir.mk: Fix pgit.sh lacking --remote-base
PGIT_SH gets added --remote-base, but too late to make it into the
non-recursive variable PGIT_SH_CLONE. This leads to --remote-base
lacking from the clone invocation, and anonymous Git over HTTP
failing because it tries to clone via SSH. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-07 09:35:11 +01:00
f090015b48 projects-dir.mk: Fix git-show-pushable-master-branches
make git-show-pushable-master-branches output too litte for two
reasons: 1. grep -q returns zero also if no matches are found, and 2.
PROJECTS doesn't contain all relevant projects. BUILD_PROJECTS is
more meaningful.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-06 10:38:33 +01:00
6c315f027e defs-dist.mk: HTMLOWNER wwwrun -> root
HTMLOWNER wwwrun is not a good idea with file mode 0644. The web
server process should not be allowed to write its own executable
files.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-23 20:59:47 +01:00
5bdd917abc rpmdist.mk: pkg-release ignores PACKAGE_VCS_FILES
PACKAGE_VCS_FILES is only considered by pkg-rebuild and ignored by
pkg-release. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-23 13:17:38 +01:00
ced42938e1 projects.mk / jw-projects.py: Support tmpl_dir && tmpls-dir
For a project to supply templates, it needs to advertise their
location. For this, the tmpl_dir make variable is added to
projects.mk. If other-project wants to get hold of some-project's
templates, it can do, e.g.:

  TEMPLATES = $(wilcard $(call tmpl_dir,some-project)/*.tmpl)

To achieve this, support for the tmpls-dir command is added to
jw-projects.py.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-23 11:07:37 +01:00
ca5910d423 tmpl.mk: Re-add because it's useful
Templates (i.e. text files ending as .tmpl) are not part of jw-pkg
anylonger, but controlling the way they are installed is beneficial
to other packages, so add tmpl.mk back.

That said, the variable names will need some tweaking to avoid
collisions. Postponed.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-23 11:07:37 +01:00
b350a8f3f0 Rename svg.mk to svg-to-pixmap.mk
To avoid name collisions, rename svg.mk to the more specialized
svg-to-pixmap.mk, because that's what it does. To the same end, rename $(SVG)
to $(PIXMAP_TO_SVG_SRC_SVG).

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-21 20:24:56 +01:00
82b875cde9 projects-dir.mk: Disable --create-remote-user-repos
--create-remote-user-repos had been disabled in
4053451bfd on the grounds that it's
hard to test and possibly superflous. It actually is not superfluous,
as devops builds show, and that's a valid test-case, so re-enable it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-13 09:05:14 +01:00
31108fc608 defs.mk: Allow INSTALL = $(SUDO) install
Running "make install" from an arbitrary source directory currently
by default either installs to a user-accessible ENV_PREFIX, or, if
DEVELOPMENT is set to false, tries to install into the system's root
filesystem, but fails over permission errors. This was by design: To
now, I considered trying the latter ill-conceived, because installing
without package manager control bears the risk of leaving unversioned
files in the system.

Actually, thinking again, during development this looks like a valid
use case: Having run pkg-rebuild-reinstall before, installing from a
source directory will leave a trace in the package manager's hash
check output, will be handled during the next clean install, and
might be a useful shortcut for trying things in the root file system.

So make this possible by:

  $ DEVELOPMENT=false make install

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-12 10:20:31 +01:00
fc017b624b js.mk: Don't minify without minifier
JS_MINIFY_FILTER_IN can be defined to nothing, in which case
minifying breaks, so don't minify if there's no filter. As an
additional benifit, defining it to the empty string in local.mk
allows to use Vim's quickfix window for syntax errors, because
there's no intermediate file created.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-11 17:23:22 +01:00
51658528f0 tailwind.mk: Add file
tailwind.mk is meant to generate a CSS file with tailwind classes
from configuration files named *.css.tw or *.css.tw.tmpl. The latter
flavour understands some make-style variables, as of now only
$(TOPDIR).

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-06 15:12:35 +01:00
5ffaf8c680 defs-[dev|dist].mk: Add DATA_DIR, JSON_DIR
Define DATA_DIR, the directory where read-only, non-executable and
non-configurable resources should be stored. And define JSON_DIR as
$(DATA_DIR)/json.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-03 20:48:32 +01:00
cfaf466487 rpmdist.mk: Support PACKAGE_VCS_FILES = true / false
PACKAGE_VCS_FILES defaults to false. Defining it to true before
including rpmdist.mk includes the version-control metadata files in
the source packages.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-01 11:35:15 +01:00
c3c6cdc446 purge-stale-projects.sh: Support --vcs
Support option --vcs. CVS is retired, but worked well as a test case
for mixing multiple version-control systems in one tree.

purge-stale-projects.sh is still pretty ugly and will have to go, but
its API might still serve as a working template.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-29 13:28:51 +01:00
f90f5aeebe Everywhere: Replace "JW_BUILD" by "JW_PKG"
Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-28 13:35:56 +01:00
9217d38964 Everywhere: Rename package "jw-build" to "jw-pkg"
jw-build doesn't stop at building software, packaging it afterwards
is also a core feature, so this commit gives the package a better
name.

The commit replaces strings s/jw-build/jw-pkg/ in text files and file
names. Fallout to the functionality is fixed, variable names are left
as they are, though. To be adjusted by later commits.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-28 13:35:56 +01:00
ca95a9d6b2 projects-dir-minimal.mk: $(info) -> $(warning)
Use $(warning) instead of $(info), in order to avoid cluttering
stdout for targets which output machine-readable content, e.g.
list-text-files-0.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-28 13:34:02 +01:00
7152a811e9 topdir.mk: Add target git-pull-official
git-pull-official is currently an alias to git-pull-devops.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-24 11:34:03 +01:00
bf86f6c625 topdir.mk: Add targets git-pull-% and git-pull-maintainer
git-pull-% pulls whatever $(GIT_MAIN_BRANCH) happens to be
from the remote jw-% into the current branch, with --rebase and
--autostash.

git-pull-maintainer does the same with <maintainer>.  <maintainer> is
figured out from the configuration in projects.conf. If it's the
invoking user, origin is used.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-24 11:22:56 +01:00
f9f0041790 pgit.sh: Support --login
In the move away from environment variables, replace JANWARE_USER
support in pgit.sh by the --login option.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-24 10:35:07 +01:00
d047ad650c pgit.sh: Support --refspec
In the attempt to move away from communicating options via
environment variables from one part of jw-build software to another,
replace PGIT_CLONE_FROM_USER with the clearer --refspec option. Which
is also more versatile.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-24 10:04:47 +01:00