forked from aciah-linux-os/ppa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (46 loc) · 1.43 KB
/
Makefile
File metadata and controls
56 lines (46 loc) · 1.43 KB
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
50
51
52
53
54
55
56
PACKAGE=aciah
VERSION=$(shell cat VERSION)
prefix = /usr/local
deb_files = ppa/$(PACKAGE)_$(VERSION)-1_amd64.deb \
ppa/Packages \
ppa/Packages.gz \
ppa/Release \
ppa/Release.gpg \
ppa/InRelease
SCRIPTS := $(wildcard src/scripts/*.sh)
TARGETS := $(patsubst src/scripts/%.sh,$(DESTDIR)$(prefix)/bin/aciah_%,$(SCRIPTS))
install: $(TARGETS)
$(DESTDIR)$(prefix)/bin/aciah_%: src/scripts/%.sh
install -D $< $@
uninstall:
-rm -f $(TARGETS)
archive: $(PACKAGE)-$(VERSION).tar.gz
$(PACKAGE)-$(VERSION).tar.gz: src/scripts/*.sh VERSION debian/* Makefile
# Create temporary directory
mkdir -p /tmp/$(PACKAGE)-$(VERSION)
cp -r ./* /tmp/$(PACKAGE)-$(VERSION)
mv /tmp/$(PACKAGE)-$(VERSION) .
# Create tarball
tar cfz $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
# Remove temporary directory
rm -r $(PACKAGE)-$(VERSION)
package: $(deb_files)
$(deb_files): $(PACKAGE)-$(VERSION).tar.gz
# Build docker image
docker build -t aciah_ppa -f docker/Dockerfile .
# Package in a container
mkdir -p ./ppa
docker run --rm \
-v "./$(PACKAGE)-$(VERSION).tar.gz:/orig/$(PACKAGE)-$(VERSION).tar.gz" \
-v ./ppa:/ppa \
-v ./key.asc:/key.asc \
-e PACKAGE="$(PACKAGE)" \
-e VERSION="$(VERSION)" \
aciah_ppa
clean:
rm -f $(PACKAGE)-$(VERSION).tar.gz
rm -f $(deb_files)
decrypt-key: key.asc
key.asc: key.asc.gpg
gpg --decrypt key.asc.gpg > key.asc
.PHONY: install uninstall archive package clean decrypt-key