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>
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>
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>
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>
Make all backend package manager prototypes have the same arguments:
yum(self, args: list[str], verbose: bool=True, sudo: bool=True)
This also implies having them behave equally verbose, unless
otherwise specified by the caller. This changes the default for
Debian.
Signed-off-by: Jan Lindemann <jan@janware.com>
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>
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>
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>
pkg_relations_list() has an intricate case distinction around
expand_semver_revision_range, clean that up.
Signed-off-by: Jan Lindemann <jan@janware.com>
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>
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>
To support the pkg-install-testbuild-deps target, a selector is
needed listing all prerequisites to be installed except the project
under test. --hide-self should be useful for that.
Signed-off-by: Jan Lindemann <jan@janware.com>
In a push to eventually merge class CmdRequiredOsPkg into this class,
add the --skip-excluded option required by it.
Signed-off-by: Jan Lindemann <jan@janware.com>
In a push to eventually merge class CmdRequiredOsPkg into this class,
add the --quote option required by it.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add a function pkg_relations_list(), doing pretty much the same as
pkg_relations(), but taking individual arguments instead of an
argparse.Namespace args argument, in order to provide the
functionality to derived classes.
Signed-off-by: Jan Lindemann <jan@janware.com>
In commands taking lists of packages, namely install, delete and
pkg_files, don't bother asking the backend. Uniformly log a warning
and return successfully.
Signed-off-by: Jan Lindemann <jan@janware.com>
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>
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>
Add support for --expand-semver-revision-range to
cmds.projects.BaseCmdPkgRelations.pkg_relations(). The options turns
a dependency in projects.conf
pkg.requires.os.devel = jw-pkg-devel = VERSION
into
jw-pkg-devel >= 1.2.3, jw-pkg-devel < 1.2.4
Note that this will break as soon as a real range is specified in
projects.conf. To be fixed later, this commit is at least less
breakage than before.
Signed-off-by: Jan Lindemann <jan@janware.com>
"getting value xxx for project" is a prominent debug log message but
ugly. Beautify to e.g.:
Lookup jw-fail2ban -> jw-pkg / version
Meaning project "jw-fail2ban" looks up the value for key "version" in
project "jw-pkg".
Signed-off-by: Jan Lindemann <jan@janware.com>
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>
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>
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>
Maintainer scripts often mess with systemd services via systemctl. In
Docker containers, chroot environments or other environments not
governed by Systemd, systemctl will not exist or complain. This is a
frequent use case, worthy of providing a wrapper to catch and ignore
these cases conveniently.
Signed-off-by: Jan Lindemann <jan@janware.com>
The output of
jw.pkg.py projects required-os-pkg --flavours release
should include all packages required by flavour devel, because during
the release process, -devel and -run packages are both installed, and
installing the -devel package is only possible if its dependencies
are installed.
Signed-off-by: Jan Lindemann <jan@janware.com>
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>
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>