4 # Docs: https://packit.dev/docs/
6 specfile_path: .packit_rpm/util-linux.spec
9 - src: .packit_rpm/util-linux.spec
11 upstream_package_name: util-linux
12 downstream_package_name: util-linux
13 # `git describe` returns in util-linux's case 'v2.37.2-xxx' which breaks RPM version
14 # # detection (that expects 2.37.2-xxx'). Let's tweak the version string accordingly
15 upstream_tag_template: "v{version}"
20 # Use a spec file from Fedora Rawhide
21 - "git clone https://src.fedoraproject.org/rpms/util-linux.git .packit_rpm --depth=1"
22 # Drop the "sources" file so rebase-helper doesn't think we're a dist-git
23 - "rm -fv .packit_rpm/sources"
24 # Drop all patches, since they're already included in the tarball
25 - "sed -ri '/^Patch[0-9]+:/d' .packit_rpm/util-linux.spec"
26 # Install additional dependencies we need for the build/tests
27 - "sed -i '/^### Dependencies/aBuildRequires: autoconf automake bc bison flex iproute libtool procps-ng socat' .packit_rpm/util-linux.spec"
28 # We need to call autogen, since we use a custom tarball
29 - "sed -i '/^unset LINGUAS/a./autogen.sh' .packit_rpm/util-linux.spec"
30 # Enable tests after build
31 - "sed -i '/^### Macros/a%define _with_check 1' .packit_rpm/util-linux.spec"
32 # Ignore unpackaged files
33 - "sed -i '1 i%define _unpackaged_files_terminate_build 0' .packit_rpm/util-linux.spec"
35 - "sed -i 's/^%configure /%configure --enable-werror /' .packit_rpm/util-linux.spec"
37 # We need to override the default create-archive action, since we need to tweak
38 # the resulting tarball and add a .tarball-version file to it, otherwise
39 # util-linux fails to detect its version during build
40 - "bash -c 'echo $PACKIT_PROJECT_VERSION >.tarball-version'"
41 - "bash -c 'git archive --prefix ${PACKIT_PROJECT_NAME_VERSION}/ --add-file .tarball-version --output .packit_rpm/${PACKIT_PROJECT_NAME_VERSION}.tar.gz HEAD'"
42 - "bash -c 'echo .packit_rpm/${PACKIT_PROJECT_NAME_VERSION}.tar.gz'"
44 # Available targets can be listed via `copr-cli list-chroots`
51 - fedora-rawhide-aarch64
53 - fedora-rawhide-ppc64le
54 - fedora-rawhide-s390x
55 - fedora-rawhide-x86_64