2 # Use make BRANCH=something to build specific branch
3 # Upstrimv version is by default set to build date.
4 # Use make VERSION= something to override
7 VERSION := $(shell date +%Y%m%d)
8 PKGNAME=libengine-gost-openssl1.1
9 ARCH := $(shell dpkg --print-architecture)
10 all: $(PKGNAME)_$(VERSION)-1_$(ARCH).deb
12 tar: $(PKGNAME)_$(VERSION).orig.tar.bz2
15 # This rule updates GIT repository and creates tarball with
16 # original (upstream, i.e. distribution-agnostic) sources of engine
18 $(PKGNAME)_$(VERSION).orig.tar.bz2: engine/README.md
20 cd engine; git archive --format tar \
21 --prefix=$(PKGNAME)-$(VERSION)/ \
22 master |bzip2 > ../$(PKGNAME)_$(VERSION).orig.tar.bz2
24 # This rule does intital clone of engine git repository should it be
28 git clone https://github.com/gost-engine/engine.git
31 # This rule actually build source and binare package starting with
32 # unpacked debian source directory
35 $(PKGNAME)_$(VERSION)-1_$(ARCH).deb: $(PKGNAME)-$(VERSION)/debian/changelog
36 cd $(PKGNAME)-$(VERSION); debuild
38 # This rule creates unpacked Debian source by copiing debian
39 # subdirectory from this git module into unpacked distribution-agnostic
41 # Note - change debian subdirectory here and not inside
42 # $(PKGNAME)-$(VERSION) if you want you changes survive invocation of
45 $(PKGNAME)-$(VERSION)/debian/changelog: $(PKGNAME)_$(VERSION).orig.tar.bz2 $(wildcard debian/*)
46 rm -rf $(PKGNAME)-$(VERSION)
47 tar xf $(PKGNAME)_$(VERSION).orig.tar.bz2
48 cp -r debian $(PKGNAME)-$(VERSION)/debian
49 cd $(PKGNAME)-$(VERSION); dch -v $(VERSION)-1 "Build for $(ARCH)"