-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
74 lines (60 loc) · 1.9 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#@maintainer [email protected]
#@update 2017-03-28
# Required RPM packaes:
# fpm
# rpm-build
# mono-devel
# nodejs
#If you change the PKGVER ensure the module list in npm_modules.sha256sum is accurate
#This is the ad-ldap-connector version
PKGVER:= 3.9.1-mozilla
#This is the packaging sub-release version
PKGREL:= 1
PKGNAME:=ad-ldap-connector
PKGPATH:=https://github.com/mozilla-iam/ad-ldap-connector/archive/
PKGSHA256:=8480a272813330fe49a0e60d17601a783ceb3660bdd195a8937160e32d400ce8
NPMS=npm_modules.sha256sum
PKGTARBALL:=v$(PKGVER).tar.gz
PKGDIRNAME:=$(PKGNAME)-$(PKGVER)
#Required for the fancy checksumming
#with GNU Make we'd reach foreach's and patterns limits
SHELL:=/bin/bash
all: fpm
fpm: extract npm_verify
#Creating package
mkdir -p target/opt
cp -vr $(PKGDIRNAME) target/opt/$(PKGNAME)
mkdir -p target/usr/lib/systemd/system
cp -v $(PKGNAME).service target/usr/lib/systemd/system
cp -v environ target/opt/$(PKGNAME)/
fpm -s dir -t rpm \
--rpm-user $(PKGNAME) --rpm-group $(PKGNAME) \
--rpm-digest sha256 \
--before-install pre-install.sh \
--config-files opt/$(PKGNAME)/environ \
--iteration $(PKGREL) \
--exclude opt/$(PKGNAME)/$(PKGNAME)-$(PKGVER) \
-n $(PKGNAME) -v $(PKGVER) -C target
npm_download: extract
@cd $(PKGDIRNAME) && npm i --production
npm_verify: npm_download
cat $(NPMS) | sha256sum -c
regenerate_sums: $(PKGTARBALL)
@echo Generating NEW checksums...
find $(PKGDIRNAME)/node_modules/ -type f -exec sha256sum {} \; > npm_modules.sha256sum
extract: $(PKGDIRNAME)
$(PKGDIRNAME): verify
tar xvzf $(PKGTARBALL)
download: $(PKGTARBALL)
$(PKGTARBALL):
@echo Getting package release $(PKGVER)...
curl -# -L -O $(PKGPATH)$(PKGTARBALL)
verify: $(PKGTARBALL)
@echo Verifying tarball checksum...
echo "$(PKGSHA256) $(PKGTARBALL)" | sha256sum -c
.PHONY: clean verify download extract npm_verify npm_download
clean:
-rm $(PKGTARBALL)
-rm -r $(PKGDIRNAME)
-rm -r target
-rm *.rpm