]> www.wagner.pp.ru Git - openssl-gost/debpkg.git/blob - Makefile
Wrote Makefile and create initial debian packaging file with dh_make
[openssl-gost/debpkg.git] / Makefile
1
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
5 #
6 BRANCH=master
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
11
12 tar: $(PKGNAME)_$(VERSION).orig.tar.bz2
13
14 #
15 # This rule updates GIT repository and creates tarball with
16 # original (upstream, i.e. distribution-agnostic) sources of engine
17 #
18 $(PKGNAME)_$(VERSION).orig.tar.bz2: engine/README.md
19         cd engine; git pull
20         cd engine; git archive --format tar \
21                 --prefix=$(PKGNAME)-$(VERSION)/ \
22                 master |bzip2 > ../$(PKGNAME)_$(VERSION).orig.tar.bz2
23 #
24 # This rule does intital clone of engine git repository should it be
25 # absent
26 #
27 engine/README.md:
28         git clone https://github.com/gost-engine/engine.git
29
30 #
31 # This rule actually build source and binare package starting with
32 # unpacked debian source directory
33 #
34
35 $(PKGNAME)_$(VERSION)-1_$(ARCH).deb: $(PKGNAME)-$(VERSION)/debian/changelog
36         cd $(PKGNAME)-$(VERSION)
37         debuild
38 #
39 # This rule creates unpacked Debian source by copiing debian
40 # subdirectory from this git module into unpacked distribution-agnostic
41 # source.
42 # Note - change debian subdirectory here and not inside
43 # $(PKGNAME)-$(VERSION) if you want you changes survive invocation of
44 # this rule
45 #
46 $(PKGNAME)_$(VERSION)/debian/changelog: $(PKGNAME)_$(VERSION).orig.tar.bz2 $(wildcard debian/*) 
47                 rm -f $(PKGNAME)-$(VERSION)
48                 tar xf $(PKGNAME)_$(VERSION).orig.tar.bz2
49                 cp -r debian $(PKGNAME)-$(VERSION)/debian
50                 cd $(PKGNAME)-$(VERSION); dch -v $(VERSION)-1 "Build for $(ARCH)"
51