mirror-cockpit-project-cockpit/autogen.sh
Allison Karlitskaya 10de075181 build: write a bare minimal PEP 517 build backend
Drop our dependency on setuptools and write our own PEP 517 build
backend.  This turns out to be relatively straightforward — only ~100
lines, and avoids the workarounds we had to do to prevent setuptools
from trying to write to the source tree.  It's also dramatically
faster.

While we're at it, we can now fix a long-standing nag: we now have a
proper place to make sure that `modules/checkout` gets called before
building an sdist or a wheel.  That means that you can run `tox` or `pip
install .` in a freshly checked-out tree and expect correct results.

We have to add a command-line interface to support wheel creation on
RHEL8, where pip is not yet PEP517-aware.

We don't implement any optional features of PEP 517 and we also don't
support editable installs.
2023-05-12 11:01:02 +02:00

23 lines
495 B
Bash
Executable file

#!/bin/sh
set -eu
srcdir="${0%/*}"
(
cd "${srcdir}"
echo "m4_define(VERSION_NUMBER, [$(git describe --tags --abbrev=0)+git])" > version.m4
autoreconf -i --warnings obsolete
)
[ -n "${NOCONFIGURE:-}" ] && exit
case "${1:-}" in
rpm)
# configure with the same flags as when building an RPM
exec rpmbuild -D '_topdir tmp/rpmbuild' -D 'make_build #' \
--build-in-place -bc tools/cockpit.spec ;;
*)
exec "${srcdir}/configure" "$@" ;;
esac