diff --git a/Makefile b/Makefile index f2d420d..34cc1ec 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,22 @@ VERSION := $(shell grep Version: $(NAME).spec | tr -s " "| cut -d " " -f 2) CC = gcc GCCVERSION_480 := $(shell expr `gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40800) +GCCVERSION_700 := $(shell expr `gcc --version | sed -n 1P | tr -s " "| cut -d " " -f 3 | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 70000) PYVERSION_270 := $(shell expr `python --version 2>&1 |cut -c 8- | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 20700) rpm: -ifeq "$(GCCVERSION_480)" "1" ifeq "$(PYVERSION_270)" "1" +ifeq "$(GCCVERSION_480)" "1" + spectool -g $(NAME).spec + mkdir -p dist/{BUILD,RPMS,SPECS,SOURCES,SRPMS,install} + mv $(BASE)-v*.tar.gz dist/SOURCES/ + cp -pf *.patch dist/SOURCES/ + rpmbuild -ba \ + --define "_topdir $(PWD)/dist" \ + --define "buildroot $(PWD)/dist/install" \ + --clean \ + $(NAME).spec +else ifeq "$(GCCVERSION_700)" "1" spectool -g $(NAME).spec mkdir -p dist/{BUILD,RPMS,SPECS,SOURCES,SRPMS,install} mv $(BASE)-v*.tar.gz dist/SOURCES/ @@ -19,8 +30,8 @@ ifeq "$(PYVERSION_270)" "1" --clean \ $(NAME).spec else - @echo "Python too old..." + @echo "C++ compiler too old..." endif else - @echo "C++ compiler too old..." + @echo "Python too old..." endif