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