packaging: Add a makefile to directly build RPM packages.
This commit is contained in:
parent
5911c7a69a
commit
5d80716550
2 changed files with 41 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
||||||
.debbuild
|
.debbuild
|
||||||
.deps
|
.deps
|
||||||
|
.rpmbuild
|
||||||
.version
|
.version
|
||||||
.version.date
|
.version.date
|
||||||
Makefile
|
Makefile
|
||||||
|
|
40
packaging/rpm.mk
Normal file
40
packaging/rpm.mk
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
RPMBUILD = .rpmbuild
|
||||||
|
|
||||||
|
CORE_VERSION = $(shell cat .version 2> /dev/null)
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: clean .version build
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm -rf $(RPMBUILD)
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build: dist
|
||||||
|
for d in SOURCES SPECS; do mkdir -p $(RPMBUILD)/$$d; done
|
||||||
|
cp -afv core-$(CORE_VERSION).tar.gz $(RPMBUILD)/SOURCES
|
||||||
|
cp -afv packaging/rpm/core.spec $(RPMBUILD)/SPECS
|
||||||
|
rpmbuild -bb --clean $(RPMBUILD)/SPECS/core.spec \
|
||||||
|
--define "_topdir $$PWD/.rpmbuild"
|
||||||
|
@printf "\nRPM packages saved in $(RPMBUILD)/RPMS\n\n"
|
||||||
|
|
||||||
|
.PHONY: dist
|
||||||
|
dist: Makefile
|
||||||
|
$(MAKE) dist
|
||||||
|
|
||||||
|
Makefile: configure
|
||||||
|
./configure --prefix=/usr --exec-prefix=/usr
|
||||||
|
|
||||||
|
configure: bootstrap.sh
|
||||||
|
./bootstrap.sh
|
||||||
|
|
||||||
|
bootstrap.sh:
|
||||||
|
@printf "\nERROR: make must be called from the top-level directory:\n"
|
||||||
|
@printf " make -f packaging/$(lastword $(MAKEFILE_LIST))\n\n"
|
||||||
|
@false
|
||||||
|
|
||||||
|
.version: Makefile
|
||||||
|
$(MAKE) $@
|
||||||
|
|
||||||
|
$(RPMBUILD):
|
||||||
|
mkdir -p $@
|
Loading…
Reference in a new issue