Commit graph

2,125 commits

Author SHA1 Message Date
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
c6444a4a72 projects-dir-minimal.mk: Improve on link-makefile.done
- Make PROJECTS_MAKEFILE_NAME point to first in $(MAKEFILE_LIST)

  - Allow to include projects-dir-minimal.mk in hand-written Makefile
    without fear that its going to be overwritten with a link

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-23 20:00:50 +01:00
4053451bfd projects-dir.mk: Disable --create-remote-user-repos
Creating user repositories is hard to test. Not sure if the concept
will survive the current workflow changes, disable it for now.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 18:10:55 +01:00
9283479489 make, scripts: Don't unconditionally clone with proactiveAuth=basic
Don't unconditionally add proactiveAuth=basic to Git's config during
clone, but only if cloning happens after authentication.

This saves unauthenticated users funny password prompts. On the other
hand, this makes a server setting persistent which could be changed
on the server.

  URL =~ /api/  (or so) => 401, followed by Basic Auth
  URL !=~ /api/ (or so) => Redirect or free access, depending on resource

Currently all resources, including API, are accessible by either
basic auth or a Cookie, but basic auth needs to be present in the
first request, which throws off some clients (notably Git without
proactiveAuth=basic).

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 17:32:04 +01:00
fc02dad92c projects-dir-minimal.mk: Default PROJECTS_DIR_REMOTE_BASE to jw-build's remote
If jw-build is already cloned, infect all other repositories with its
remote via PROJECTS_DIR_REMOTE_BASE.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 16:54:04 +01:00
561905bab7 projects-dir.mk: Fix empty JANWARE_USER error
JW_BUILD_SSH_EXTRA_OPTS contains a -l $(JANWARE_USER), which make ssh
break if $(JANWARE_USER) is empty. Fix that case.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 16:33:18 +01:00
99dca58e1d projects-dir.mk: Make GIT_ASKPASS absolute
The GIT_ASKPASS environment variable can point to a relative path,
and since pgit.sh currently does a chdir, it needs to be made an
absolute path.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 15:28:05 +01:00
7d436f1c76 projects-dir[-minimal].mk: Go from PROJECTS_DIR_REMOTE_BASE
Currently, the primary discriminating criterion on how to handle a
set of remote repositories is whether or not JANWARE_USER is defined.
The canonical way to do that is PROJECTS_DIR_REMOTE_BASE, though, so
go from that definition.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 13:52:41 +01:00
f9fe1dbe51 projects-dir-minimal.mk: Add PROJECTS_DIR_REMOTE_USER_SUBPATH = /proj
PROJECTS_DIR_REMOTE_USER_SUBPATH is a janware.com specialty somewhat.
Having subpaths is a Forgejo feature request on Codeberg, though, so
it might also be here to stay.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 12:40:41 +01:00
41cc712dee projects-dir-minimal.mk: Clone jw-build with proactiveAuth=basic
Pass -c http.proactiveAuth=basic to the initial "git clone jw-build"
invocation. This is necessary while jw-build is still behind
authentication. The restriction will likely be lifted (for jw-build),
but for testing now it's fine, and it doesn't do any harm, either.
With the way janware.com currently operates, it will also necessary
for push over HTTP, so  make it persistent in jw-build's
configuration.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 09:38:24 +01:00
4c35ceb27a projects-dir-minimal.mk: Support JW_BUILD_BRANCH
Pass --branch $(JW_BUILD_BRANCH) to git clone invocations during the
initial cloning of jw-build. Used for testing.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 09:46:47 +01:00
6d7d18d9bd projects-dir-minimal.mk: Fix get-user-info infocation
jw-python is invoked with -t (topdir) instead of -p (prefix) for
JANWARE_USER detection, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 09:16:24 +01:00
e1a4746ad5 projects-dir-minimal.mk: Use get-auth-info for JANWARE_USER
Default JANWARE_USER to the user retrieved by jw-projects.py get-auth-info.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:37:07 +01:00
8de4a90796 projects-dir-minimal.mk: Fix linking after package build
Linking the projects-dir Makefile fails if make pkg-rebuild has been
run on jw-build, because it leaves another projects-dir-minimal.mk
below the dist directory. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:24:58 +01:00
d740f30226 projects-dir[-minimal.mk]: Group PGIT_SH-related variables
Group variables related with pgit.sh (PGIT_SH and PGIT_SH_CLONE)
closer together. Define CLONE_FROM_USER early on.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 21:14:19 +01:00
aac261d782 projects-dir[-minimal].mk: Change usage comment
The usage comments heading projects-dir-minimal.mk and
projects-dir.mk state that for cloning all repositories, JANWARE_USER
needs to be defined. That restriction is now gone, so reflect that in
the comment.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:56:21 +01:00
69132d9246 projects-dir[-minimal].mk: Support PROJECTS_DIR_REMOTE_BASE
Add the variable PROJECTS_DIR_REMOTE_BASE, defaulting to
ssh://git.janware.com/srv/git if REMOTE_USER is defined, and to
https://janware.com/code in case it isn't.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:55:20 +01:00
7d1ff5c6e6 projects-dir.mk: Default PGIT_CLONE_FROM_USER to janware
Clone from user janware if JANWARE_USER is not defined.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:56:02 +01:00
fe81bd209e projects-dir[-minimal].mk: Don't default JANWARE_USER
Do not set JANWARE_USER to $(id -un) in case it's undefined. Instead,
rely on it being set explicitly in the environment if so desired.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:44:57 +01:00
370c7e499e projects-dir.mk: Conditionally pass --create-remote-user-repos
Pass --create-remote-user-repos to pgit.sh clone in case JANWARE_USER
is defined, restoring the original behaviour.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 16:39:52 +01:00
b7d88a6e22 py-defs.mk: Default PY_UPDATE_INIT_PY ?= true
Set PY_UPDATE_INIT_PY to true to match jw-build's default behaviour
before the variable was introduced.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:04:29 +01:00
0c9fd98009 projects-dir.mk, scripts/Makefile, jw-pkg: Move jw-pkg from jw-build to jw-base
jw-pkg is related to, but strictly speaking not indispensible for building and
packaging software. So, in the attempt have a minimal jw-build, move jw-pkg to
jw-base, and fix all packages that use it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 13:05:43 +01:00
36092d6b1b projects-dir.mk: Make list-files ignore errors
Make list-files target ignore errors. This catches errors from
git ls-files | xargs realpath if git ls-files lists dead symbolic
links, as in my-project/blah/dev/fd -> ./proc/self/fd.

Implemented by passing -q (quiet) to realpath, not sure what else
this suppresses.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 12:34:14 +01:00
9018eb7c30 projects-dir-minimal.mk: Run make after cloning jw-build
After initially cloning jw-build and including
projects-dir-minimal.mk, new targets are not considered, so run make
again.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 11:53:28 +01:00
b82d4249f9 pgit.sh: Remove CVS support
Don't identify projects directory by a the presence of a correct CVS
subdirectory any longer.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 11:30:59 +01:00
67fb954f3e projects-dir.mk: Remove CVS support
Now that CVS is finally retired for building multiple projects from
VCS, remove support.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 10:22:35 +01:00