Makefile
1.26 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
NAME = prezento-spb
VERSION = 0.8.3.colab
TARBALL = $(NAME)-deps-$(VERSION).tar.gz
PREFIX = /usr
WGET = wget
BRANCH = v0.8.3.colab
BUNDLE_OPTS = --verbose --without='development test cucumber'
GEMFILE_URL=https://portal.softwarepublico.gov.br/gitlab/mezuro/prezento/raw/
all:
bundle install $(BUNDLE_OPTS) --local --deployment
grep -rl '/usr/local/bin/ruby' vendor/bundle/ruby/gems/*/ | \
xargs --no-run-if-empty sed -i -e '1,2 s|.*|#!/usr/bin/env ruby|'
dist: $(TARBALL)
$(TARBALL):
(git archive --prefix=$(NAME)-deps-$(VERSION)/ HEAD | \
gzip > $@) || ($(RM) $@; false)
install: all
mkdir -p $(DESTDIR)$(PREFIX)/lib/$(NAME)/vendor
install -m 0644 Gemfile $(DESTDIR)$(PREFIX)/lib/$(NAME)
install -m 0644 Gemfile.lock $(DESTDIR)$(PREFIX)/lib/$(NAME)
cp -r .bundle $(DESTDIR)$(PREFIX)/lib/$(NAME)/.bundle
cp -r vendor/bundle $(DESTDIR)$(PREFIX)/lib/$(NAME)/vendor/bundle
update: clean
$(RM) Gemfile*
$(WGET) -O Gemfile $(GEMFILE_URL)/$(BRANCH)/Gemfile --no-check-certificate
$(WGET) -O Gemfile.lock $(GEMFILE_URL)/$(BRANCH)/Gemfile.lock --no-check-certificate
$(MAKE) bundle
bundle:
bundle install $(BUNDLE_OPTS) --path vendor/bundle
bundle package
clean:
$(RM) -r .bundle/ vendor/bundle/ $(TARBALL)