-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
18 lines (13 loc) · 889 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
.PHONY: clean dist rpm srpm
clean:
cd $(ROOT_DIR) && find -name '*~' -print0 | xargs -0r rm -fv && rm -fr build dist *.tar.gz *.rpm
dist: clean
python -m build -s
srpm: dist
@which rpmbuild || { echo 'rpmbuild is not available. Please install the rpm-build package with the command `dnf install rpm-build` to continue, then rerun this step.' ; exit 1 ; }
cd $(ROOT_DIR) || exit $$? ; rpmbuild --define "_srcrpmdir ." --define "_sourcedir dist" -bs *spec
rpm: srpm
@which rpmbuild || { echo 'rpmbuild is not available. Please install the rpm-build package with the command `dnf install rpm-build` to continue, then rerun this step.' ; exit 1 ; }
cd $(ROOT_DIR) || exit $$? ; rpmbuild --define "_srcrpmdir ." --define "_rpmdir dist" --rebuild *.src.rpm
cd $(ROOT_DIR) ; mv -f dist/*/* . && rm -rf dist/*/*