From: Nathan Wagner Date: Tue, 10 Apr 2018 06:50:52 +0000 (-0500) Subject: add tarball and zpm package targets X-Git-Tag: v0.1.6~110 X-Git-Url: https://pd.if.org/git/?p=zpackage;a=commitdiff_plain;h=d4a843be76cd1f93f4b143e3df9516629b3b18fa add tarball and zpm package targets --- diff --git a/Makefile b/Makefile index 7595154..5420710 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ CFLAGS=-Wall -W -Wextra -Werror -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 +endif + 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 LDFLAGS=-L. -ldl @@ -11,13 +16,34 @@ LZMAOBJ=$(filter-out lzma/common/stream_encoder_mt.o, $(LZMASRC:%.c=%.o)) curdir=$(shell pwd) ZPKGBIN=zpm-addfile zpm-extract zpm-init zpm-vercmp zpm-stat zpm-hash \ - zpm-findpkg zpm-shell + zpm-findpkg zpm-shell zpm-soneed + +SCRIPTS=zpm zpm-install +COMPILED=$(ZPKGBIN) +PROGRAMS=$(SCRIPTS) $(COMPILED) def: programs d: printf '%s\n' $(LZMAOBJ) printf '%s\n' $(PATH) +package: zpm-0.1-1.zpm + +ZPM:= ./zpm -P scripts:bin:. + +zpm-0.1-1.zpm: programs scripts + rm -f $@ + ./zpm -P scripts:bin:. newpackage -f $@ -v 0.1 zpm + ./zpm -P scripts:bin:. addtopackage -f $@ -P /usr/libexec/zpm -v 0.1 zpm $(PROGRAMS) + +tarball: zpm-0.1-1.tar.xz + +zpm-0.1-1.tar.xz: programs scripts + rm -f $@ + tar -cJf $@ --transform='s|^|usr/libexec/zpm/|' \ + --transform='s|^usr/libexec/zpm/zpm$$|usr/bin/zpm|' \ + $(PROGRAMS) + lzma.c: mklzma sh mklzma