]> pd.if.org Git - zpackage/commitdiff
derive zpm package version from git tag
authorNathan Wagner <nw@hydaspes.if.org>
Sun, 16 Sep 2018 01:54:03 +0000 (01:54 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Mon, 17 Sep 2018 12:16:13 +0000 (12:16 +0000)
Fix package target to use updated newpackage syntax.

Makefile

index 51cd85afebb63a8bf6a7dbe8b5d93421a6bfc4ea..e55a72db61f7094e77d505b5d1e5cbeff9af1943 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,6 @@
 CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api
 
-ZPMVER:=$(shell git tag --list 'v[0-9]*' | sed -e 's/^v//' | sort -nr | head -1)
-ifeq ($(strip $(ZPMVER)),)
-       ZPMVER:=0.1.3
-endif
+ZPMVER:=$(shell git describe --tags --match 'v[0-9]*' | sed -e 's/^v//' | sed -e 's/-g.\+//' | sed -e 's/-/./g')
 
 LZMAFLAGS=-Ilzma/api -Ilzma/tuklib -Ilzma/lzma -Ilzma/common -Ilzma/check -Ilzma/lz -Ilzma/rangecoder -Ilzma/simple -Ilzma/delta -DHAVE_CHECK_CRC64 -DHAVE_CHECK_CRC32 -DHAVE_ENCODER_LZMA2 -DHAVE_DECODER_LZMA2 -DHAVE_MF_BT4
 
@@ -65,12 +62,12 @@ lib/liblzma.a: $(LZMAOBJ)
 lib/libjsw.a: $(JSWOBJ)
        ar rcuv $@ $?
 
-ZPM:= ./zpm -P scripts:bin:.
+ZPM:= ./zpm -P.
 
 zpm-$(ZPMVER)-1.zpm: programs
        rm -f $@
-       $(ZPM) newpackage -f $@ -v $(ZPMVER) zpm
-       $(ZPM) addtopackage -u root -g root -f $@ -P /sbin -v $(ZPMVER) zpm $(PROGRAMS)
+       $(ZPM) newpackage -C zpm-$(ZPMVER)-1
+       $(ZPM) add -u root -g root -f $@ -P /sbin zpm-$(ZPMVER)-1 $(sort $(PROGRAMS))
 
 tarball: zpm-$(ZPMVER)-1.tar.xz