2023-10-12 09:15:14 +00:00
YYYYMMDD = $( shell date +%Y%m%d)
SOURCEDIR = $( shell pwd )
2024-05-17 09:27:48 +00:00
SPEC = llvm.spec
2024-07-03 07:47:34 +00:00
FEDORA_RELEASE = f40
2023-10-12 09:15:14 +00:00
2024-05-17 09:27:48 +00:00
# Map deprecated targets to new targets
.PHONY : setup local -rpm local -srpm local -prep local -clean
setup local-rpm local-srpm local-prep local-clean :
$( eval mapped_target:= $( subst setup,snapshot-setup,$( MAKECMDGOALS) ) )
$( eval mapped_target:= $( subst local-clean,snapshot-clean,$( mapped_target) ) )
$( eval mapped_target:= $( subst local-,snapshot-,$( mapped_target) ) )
$( info WARNING: " $( MAKECMDGOALS) " is deprecated. Instead running " $( mapped_target) " )
$( MAKE) $( mapped_target)
.PHONY : snapshot -vars
snapshot-vars :
$( eval RESULTDIR:= $( shell pwd ) /snapshot-results)
.PHONY : release -vars
release-vars :
$( eval RESULTDIR:= $( shell pwd ) /release-results)
2023-10-12 09:15:14 +00:00
2024-05-17 09:27:48 +00:00
.PHONY : prep
prep :
mkdir -pv $( RESULTDIR)
.PHONY : snapshot -setup
snapshot-setup : snapshot -vars prep
2023-10-12 09:15:14 +00:00
YYYYMMDD = $( YYYYMMDD) ./.copr/snapshot-info.sh > $( SOURCEDIR) /version.spec.inc
2024-05-17 09:27:48 +00:00
spectool -g --define " _sourcedir $( SOURCEDIR) " --define "_with_snapshot_build 1" $( SPEC)
.PHONY : release -setup
release-setup : release -vars prep
spectool -g --define " _sourcedir $( SOURCEDIR) " $( SPEC)
2023-10-12 09:15:14 +00:00
2024-05-17 09:27:48 +00:00
.PHONY : snapshot -srpm
snapshot-srpm : snapshot -setup
2023-10-12 09:15:14 +00:00
rpmbuild \
2024-05-17 09:27:48 +00:00
--with= snapshot_build \
--define " _rpmdir $( RESULTDIR) " \
2023-10-12 09:15:14 +00:00
--define " _sourcedir $( SOURCEDIR) " \
2024-05-17 09:27:48 +00:00
--define " _specdir $( SOURCEDIR) " \
--define " _srcrpmdir $( RESULTDIR) " \
--define " _builddir $( RESULTDIR) " \
2023-10-12 09:15:14 +00:00
-bs $( SPEC)
2024-05-17 09:27:48 +00:00
.PHONY : release -srpm
release-srpm : release -setup
rpmbuild \
--define " _rpmdir $( RESULTDIR) " \
--define " _sourcedir $( SOURCEDIR) " \
--define " _specdir $( SOURCEDIR) " \
--define " _srcrpmdir $( RESULTDIR) " \
--define " _builddir $( RESULTDIR) " \
-bs $( SPEC)
.PHONY : snapshot -rpm
snapshot-rpm : snapshot -setup
rpmbuild \
--with= snapshot_build \
--define " _rpmdir $( RESULTDIR) " \
--define " _sourcedir $( SOURCEDIR) " \
--define " _specdir $( SOURCEDIR) " \
--define " _srcrpmdir $( RESULTDIR) " \
--define " _builddir $( RESULTDIR) " \
--noclean \
-bb $( SPEC)
.PHONY : release -rpm
release-rpm : release -setup
rpmbuild \
--define " _rpmdir $( RESULTDIR) " \
--define " _sourcedir $( SOURCEDIR) " \
--define " _specdir $( SOURCEDIR) " \
--define " _srcrpmdir $( RESULTDIR) " \
--define " _builddir $( RESULTDIR) " \
--noclean \
-bb $( SPEC)
.PHONY : snapshot -clean
snapshot-clean : snapshot -vars _clean
.PHONY : release -clean
release-clean : release -vars _clean
.PHONY : _clean
_clean :
-rm -rf $( RESULTDIR)
2023-10-12 09:15:14 +00:00
-rm -f *.txt
-rm -f *.tar.xz
-rm -f *.tar.xz.sig
2024-05-17 09:27:48 +00:00
-rm -rf $( shell uname -m)
2023-10-12 09:15:14 +00:00
-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
2024-05-17 09:27:48 +00:00
.PHONY : snapshot -prep
snapshot-prep : snapshot -setup
rpmbuild \
--with= snapshot_build \
--define " _rpmdir $( RESULTDIR) " \
--define " _sourcedir $( SOURCEDIR) " \
--define " _specdir $( SOURCEDIR) " \
--define " _srcrpmdir $( RESULTDIR) " \
--define " _builddir $( RESULTDIR) " \
--noclean \
-bp $( SPEC)
.PHONY : release -prep
release-prep : releae -setup
rpmbuild \
--define " _rpmdir $( RESULTDIR) " \
--define " _sourcedir $( SOURCEDIR) " \
--define " _specdir $( SOURCEDIR) " \
--define " _srcrpmdir $( RESULTDIR) " \
--define " _builddir $( RESULTDIR) " \
--noclean \
-bp $( SPEC)
# .PHONY: local-list-check
# local-list-check: setup
# fedpkg --release $(FEDORA_RELEASE) -v \
# local \
# --builddir $(BUILDDIR) \
# --buildrootdir $(BUILDROOTDIR) \
#
# --with=snapshot_build \
# -- $(SPEC) -bl
# .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 \
2024-10-17 15:17:24 +00:00
# report