-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (28 loc) · 826 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CURRENT_DIR=$(shell pwd)
DIST_DIR=${CURRENT_DIR}/dist
NAME=hello
ARCH=x86_64
VERSION=0.1.0
RELEASE=SNAPSHOT.1
prepare: build
mkdir -p rpmbuild/SOURCES
mkdir -p ${DIST_DIR}/$(NAME)-$(VERSION)
cp -r pkg/* ${DIST_DIR}/$(NAME)-$(VERSION)
tar -czvf rpmbuild/SOURCES/$(NAME)-$(VERSION).tar.gz -C ${DIST_DIR} $(NAME)-$(VERSION)
rpm-build: prepare
rpmbuild -bb $(NAME).spec \
--define "_topdir ${CURRENT_DIR}/rpmbuild" \
--define "SRC ${CURRENT_DIR}" \
--define "VERSION_NUMBER $(VERSION)" \
--define "RELEASE_NUMBER $(RELEASE)"
mv rpmbuild/RPMS/$(ARCH)/$(NAME)-$(VERSION)-$(RELEASE).$(ARCH).rpm $(DIST_DIR)
build:
mkdir -p pkg
gcc -g -o pkg/hello hello.c
clean:
rm -rf ${DIST_DIR}
rm -rf rpmbuild
rm -rf pkg
rm -f $(NAME)-$(VERSION)-$(RELEASE).$(ARCH).rpm
rpm-lint:
rpmlint -c .rpmlintrc.toml $(NAME).spec