# SPDX-License-Identifier: LGPL-2.1-or-later
set -ex
-if [ ! -f "pkg/$DISTRIBUTION/PKGBUILD" ]; then
- echo "PKGBUILD not found at pkg/$DISTRIBUTION/PKGBUILD, run mkosi once with -ff to make sure the PKGBUILD is cloned" >&2
+if [ ! -f "pkg/$PKG_SUBDIR/PKGBUILD" ]; then
+ echo "PKGBUILD not found at pkg/$PKG_SUBDIR/PKGBUILD, run mkosi once with -ff to make sure the PKGBUILD is cloned" >&2
exit 1
fi
# We can't configure the source or build directory so we use bind mounts instead to make sure they are in the
# expected locations.
-mount --mkdir --bind "$SRCDIR" "pkg/$DISTRIBUTION/systemd-stable/"
-mount --mkdir --bind "$BUILDDIR" "pkg/$DISTRIBUTION/build/"
+mount --mkdir --bind "$SRCDIR" "pkg/$PKG_SUBDIR/systemd-stable/"
+mount --mkdir --bind "$BUILDDIR" "pkg/$PKG_SUBDIR/build/"
# Because we run with --noextract we are responsible for making sure the source files appear in src/.
-mount --mkdir --rbind "$PWD/pkg/$DISTRIBUTION" "pkg/$DISTRIBUTION/src/"
+mount --mkdir --rbind "$PWD/pkg/$PKG_SUBDIR" "pkg/$PKG_SUBDIR/src/"
# shellcheck source=/dev/null
. /etc/makepkg.conf
# We get around makepkg's root check by setting EUID to something else.
# shellcheck disable=SC2046
-env --chdir="pkg/$DISTRIBUTION" \
+env --chdir="pkg/$PKG_SUBDIR" \
EUID=123 \
makepkg \
--noextract \
--force \
UPSTREAM=1 \
QUIET=1 \
- BUILDDIR="$PWD/pkg/$DISTRIBUTION" \
+ BUILDDIR="$PWD/pkg/$PKG_SUBDIR" \
PKGDEST="$PACKAGEDIR" \
PKGEXT=".pkg.tar" \
PKGVER="$(cat meson.version)" \
Environment=
PKG_URL="https://gitlab.archlinux.org/daandemeyer/systemd"
PKG_BRANCH="strip"
+ PKG_SUBDIR="arch"
SYSTEMD_PACKAGES="systemd systemd-ukify systemd-sysvcompat systemd-resolvconf"
Packages=
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
-if [ ! -f "pkg/$DISTRIBUTION/PKGBUILD" ]; then
- echo "PKGBUILD not found at pkg/$DISTRIBUTION/PKGBUILD, run mkosi once with -ff to make sure the PKGBUILD is cloned" >&2
+if [ ! -f "pkg/$PKG_SUBDIR/PKGBUILD" ]; then
+ echo "PKGBUILD not found at pkg/$PKG_SUBDIR/PKGBUILD, run mkosi once with -ff to make sure the PKGBUILD is cloned" >&2
exit 1
fi
if [ "$1" = "final" ]; then
# We get depends and optdepends from .SRCINFO as getting them from the PKGBUILD is rather complex.
- sed --expression 's/^[ \t]*//' "pkg/$DISTRIBUTION/.SRCINFO" |
+ sed --expression 's/^[ \t]*//' "pkg/$PKG_SUBDIR/.SRCINFO" |
grep --regexp '^depends =' --regexp '^optdepends =' |
sed --expression 's/^depends = //' --expression 's/^optdepends = //' --expression 's/:.*//' |
xargs --delimiter '\n' mkosi-install
# We get makedepends from the PKGBUILD as .SRCINFO can't encode conditional dependencies depending on
# whether some environment variable is set or not.
# shellcheck source=/dev/null
- UPSTREAM=1 . "pkg/$DISTRIBUTION/PKGBUILD"
+ UPSTREAM=1 . "pkg/$PKG_SUBDIR/PKGBUILD"
# shellcheck disable=SC2154
mkosi-install "${makedepends[@]}"
# SPDX-License-Identifier: LGPL-2.1-or-later
set -ex
-if [ ! -f "pkg/$DISTRIBUTION/systemd.spec" ]; then
- echo "spec not found at pkg/$DISTRIBUTION/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
+if [ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]; then
+ echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
exit 1
fi
--with upstream \
$( ((WITH_TESTS)) || echo --nocheck) \
--define "_topdir /var/tmp" \
- --define "_sourcedir pkg/$DISTRIBUTION" \
+ --define "_sourcedir pkg/$PKG_SUBDIR" \
--define "_rpmdir $PACKAGEDIR" \
${BUILDDIR:+--define} \
${BUILDDIR:+"_vpath_builddir $BUILDDIR"} \
--define "__elf_exclude_path ^/usr/lib/systemd/tests/unit-tests/.*$" \
--define "__script_requires %{nil}" \
--undefine _lto_cflags \
- "pkg/$DISTRIBUTION/systemd.spec"
+ "pkg/$PKG_SUBDIR/systemd.spec"
# SPDX-License-Identifier: LGPL-2.1-or-later
set -ex
-if [ ! -f "pkg/$DISTRIBUTION/systemd.spec" ]; then
- echo "spec not found at pkg/$DISTRIBUTION/systemd.spec, run mkosi with -ff to make sure the spec is cloned" >&2
+if [ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]; then
+ echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi with -ff to make sure the spec is cloned" >&2
exit 1
fi
--query \
"$DEPS" \
--define "_topdir /var/tmp" \
- --define "_sourcedir pkg/$DISTRIBUTION" \
- "pkg/$DISTRIBUTION/systemd.spec" |
+ --define "_sourcedir pkg/$PKG_SUBDIR" \
+ "pkg/$PKG_SUBDIR/systemd.spec" |
grep --invert-match --regexp systemd --regexp /bin/sh --regexp "rpmlib(" --regexp udev |
sort --unique |
tee /tmp/buildrequires |
# rpmbuild -br tries to build a source package which means all source files have to exist which isn't the
# case when using --build-in-place so we get rid of the source file that doesn't exist to make it happy.
# TODO: Use -bd instead of -br and get rid of this once we don't need to build on CentOS Stream 9 anymore.
-sed '/Source0/d' --in-place "pkg/$DISTRIBUTION/systemd.spec"
+sed '/Source0/d' --in-place "pkg/$PKG_SUBDIR/systemd.spec"
until mkosi-chroot \
rpmbuild \
--build-in-place \
--with upstream \
--define "_topdir /var/tmp" \
- --define "_sourcedir pkg/$DISTRIBUTION" \
+ --define "_sourcedir pkg/$PKG_SUBDIR" \
--define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
- "pkg/$DISTRIBUTION/systemd.spec"
+ "pkg/$PKG_SUBDIR/systemd.spec"
do
EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 11 ]; then
Environment=
PKG_URL="https://git.centos.org/rpms/systemd"
PKG_BRANCH="c9s-sig-hyperscale"
+ PKG_SUBDIR="centos"
Packages=
kernel-modules # For squashfs support
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
-if [ ! -d "pkg/$DISTRIBUTION/debian" ]; then
- echo "deb rules not found at pkg/$DISTRIBUTION/debian, run mkosi once with -ff to make sure the rules are cloned" >&2
+if [ ! -d "pkg/$PKG_SUBDIR/debian" ]; then
+ echo "deb rules not found at pkg/$PKG_SUBDIR/debian, run mkosi once with -ff to make sure the rules are cloned" >&2
exit 1
fi
# We transplant the debian/ folder from the deb package sources into the upstream sources.
-mount --mkdir --bind "$SRCDIR/pkg/$DISTRIBUTION/debian" "$SRCDIR"/debian
+mount --mkdir --bind "$SRCDIR/pkg/$PKG_SUBDIR/debian" "$SRCDIR"/debian
# We hide the patches/ directory by mounting an empty directory on top so they don't get applied.
TMP=$(mktemp -d)
Environment=
PKG_URL="https://salsa.debian.org/systemd-team/systemd"
PKG_BRANCH="debian/master"
+ PKG_SUBDIR="debian"
SYSTEMD_PACKAGES="systemd
systemd-userdbd
systemd-oomd
exit 0
fi
-if [ ! -d "pkg/$DISTRIBUTION/debian" ]; then
- echo "deb rules not found at pkg/$DISTRIBUTION/debian, run mkosi once with -ff to make sure the rules are cloned" >&2
+if [ ! -d "pkg/$PKG_SUBDIR/debian" ]; then
+ echo "deb rules not found at pkg/$PKG_SUBDIR/debian, run mkosi once with -ff to make sure the rules are cloned" >&2
exit 1
fi
-cd "pkg/$DISTRIBUTION"
+cd "pkg/$PKG_SUBDIR"
DEB_BUILD_PROFILES="pkg.systemd.upstream" apt-get build-dep .
Environment=
PKG_URL="https://src.fedoraproject.org/rpms/systemd"
PKG_BRANCH="rawhide"
+ PKG_SUBDIR="fedora"
Packages=
btrfs-progs
# SPDX-License-Identifier: LGPL-2.1-or-later
set -ex
-if [ ! -f "pkg/$DISTRIBUTION/systemd.spec" ]; then
- echo "spec not found at pkg/$DISTRIBUTION/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
+if [ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]; then
+ echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
exit 1
fi
# The openSUSE filelists hardcode the manpage compression extension. This causes rpmbuild errors since we
# disable manpage compression as the files cannot be found. Fix the issue by removing the compression
# extension.
-find "pkg/$DISTRIBUTION" -name "files.*" -exec sed --in-place 's/\.gz$//' {} \;
+find "pkg/$PKG_SUBDIR" -name "files.*" -exec sed --in-place 's/\.gz$//' {} \;
build() {
# TODO: Replace meson_build and meson_install overrides with "--undefine __meson_verbose" once
--with upstream \
$( ((WITH_TESTS)) || echo --nocheck) \
--define "_topdir /var/tmp" \
- --define "_sourcedir pkg/$DISTRIBUTION" \
+ --define "_sourcedir pkg/$PKG_SUBDIR" \
--define "_rpmdir $PACKAGEDIR" \
${BUILDDIR:+--define} \
${BUILDDIR:+"_vpath_builddir $BUILDDIR"} \
--define "__elf_exclude_path ^/usr/lib/systemd/tests/unit-tests/.*$" \
--define "__script_requires %{nil}" \
"$@" \
- "pkg/$DISTRIBUTION/systemd.spec"
+ "pkg/$PKG_SUBDIR/systemd.spec"
}
if ! build; then
# warnings.
rm systemd.lang
- cat /tmp/unpackaged-files >>"pkg/$DISTRIBUTION/files.systemd"
+ cat /tmp/unpackaged-files >>"pkg/$PKG_SUBDIR/files.systemd"
build --noprep --nocheck
fi
Environment=
PKG_URL="https://code.opensuse.org/package/systemd"
PKG_BRANCH="master"
+ PKG_SUBDIR="opensuse"
SYSTEMD_PACKAGES="systemd
udev
systemd-experimental
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
-if [ ! -f "pkg/$DISTRIBUTION/systemd.spec" ]; then
- echo "spec not found at pkg/$DISTRIBUTION/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
+if [ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]; then
+ echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
exit 1
fi
--query \
"$DEPS" \
--define "_topdir /var/tmp" \
- --define "_sourcedir pkg/$DISTRIBUTION" \
- "pkg/$DISTRIBUTION/systemd.spec" |
+ --define "_sourcedir pkg/$PKG_SUBDIR" \
+ "pkg/$PKG_SUBDIR/systemd.spec" |
grep --invert-match --regexp systemd --regexp /bin/sh --regexp "rpmlib(" --regexp udev |
sort --unique |
tee /tmp/buildrequires |
--build-in-place \
--with upstream \
--define "_topdir /var/tmp" \
- --define "_sourcedir pkg/$DISTRIBUTION" \
+ --define "_sourcedir pkg/$PKG_SUBDIR" \
--define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
- "pkg/$DISTRIBUTION/systemd.spec"
+ "pkg/$PKG_SUBDIR/systemd.spec"
do
EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 11 ]; then
exit 0
fi
-if [ -z "$(ls --almost-all "pkg/$DISTRIBUTION")" ]; then
- git clone "$PKG_URL" --branch "$PKG_BRANCH" "pkg/$DISTRIBUTION"
-elif [ -d "pkg/$DISTRIBUTION/.git" ] && [ "$(git -C "pkg/$DISTRIBUTION" rev-parse --abbrev-ref HEAD)" = "$PKG_BRANCH" ]; then
- git -C "pkg/$DISTRIBUTION" pull
+if [ -z "$(ls --almost-all "pkg/$PKG_SUBDIR")" ]; then
+ git clone "$PKG_URL" --branch "$PKG_BRANCH" "pkg/$PKG_SUBDIR"
+elif [ -d "pkg/$PKG_SUBDIR/.git" ] && [ "$(git -C "pkg/$PKG_SUBDIR" rev-parse --abbrev-ref HEAD)" = "$PKG_BRANCH" ]; then
+ git -C "pkg/$PKG_SUBDIR" pull
fi