2023-10-12 09:15:14 +00:00
YYYYMMDD = $( shell date +%Y%m%d)
OUTDIR = $( shell pwd ) /out
SPEC = llvm.spec
BUILDDIR = $( shell pwd ) /BUILD
BUILDROOTDIR = $( shell pwd ) /BUILD
SOURCEDIR = $( shell pwd )
2024-07-03 07:47:34 +00:00
FEDORA_RELEASE = f40
2023-10-12 09:15:14 +00:00
.PHONY : setup
setup :
mkdir -pv $( OUTDIR)
mkdir -pv $( BUILDDIR)
mkdir -pv $( BUILDROOTDIR)
mkdir -pv $( SOURCEDIR)
YYYYMMDD = $( YYYYMMDD) ./.copr/snapshot-info.sh > $( SOURCEDIR) /version.spec.inc
2024-07-03 07:47:34 +00:00
spectool -g --define " _sourcedir $( SOURCEDIR) " llvm.spec
2023-10-12 09:15:14 +00:00
.PHONY : local -srpm
local-srpm : setup
rpmbuild \
--define " yyyymmdd $( YYYYMMDD) " \
--define " _srcrpmdir $( OUTDIR) " \
--define " _sourcedir $( SOURCEDIR) " \
-bs $( SPEC)
.PHONY : local -rpm
local-rpm : setup
fedpkg --release $( FEDORA_RELEASE) -v \
local \
--builddir $( BUILDDIR) \
--buildrootdir $( BUILDROOTDIR) \
--define " yyyymmdd $( YYYYMMDD) " \
2024-07-02 16:07:43 +00:00
-- $( SPEC) --noclean
2023-10-12 09:15:14 +00:00
.PHONY : local -clean
local-clean :
-rm -rf $( BUILDDIR)
-rm -rf $( BUILDROOTDIR)
-rm -rf $( OUTDIR)
-rm -f *.txt
-rm -f *.tar.xz
-rm -f *.tar.xz.sig
-rm -rf x86_64
-rm -rf noarch
-rm -rf *.src.rpm
2024-05-16 13:57:59 +00:00
-rm -rf /tmp/lto-llvm-*.o
2023-10-12 09:15:14 +00:00
.PHONY : local -list -check
local-list-check : setup
fedpkg --release $( FEDORA_RELEASE) -v \
local \
--builddir $( BUILDDIR) \
--buildrootdir $( BUILDROOTDIR) \
--define " yyyymmdd $( YYYYMMDD) " \
-- $( SPEC) -bl
2024-05-22 07:53:23 +00:00
.PHONY : local -prep
2023-10-12 09:15:14 +00:00
local-prep : setup
fedpkg --release $( FEDORA_RELEASE) -v \
prep \
--builddir $( BUILDDIR) \
--buildrootdir $( BUILDROOTDIR) \
--define " yyyymmdd $( YYYYMMDD) " \
-- $( SPEC)
.PHONY : local -tmt -vm
local-tmt-vm :
# This is to ensure the required packages are installed
rpm -q tmt tmt+provision-virtual
# This is to check if you've started libvirt
# If this fails, run: sudo systemctl start libvirtd
# systemctl status libvirtd --no-pager
# In case of: Failed to boot testcloud instance (authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage')
# Add yourself to libvirt group: sudo usermod -a -G libvirt $USER
cat /etc/group | grep libvirt | grep $( USER)
tmt \
-c distro = fedora-rawhide \
-c arch = x86_64 \
-c snapshot = 20240124
run \
-avv \
provision \
-h virtual.testcloud \
-c system \
-i fedora-rawhide \
prepare \
-h install \
-c fedora-llvm-team/llvm-snapshots-big-merge-20240124 \
test \
report