forked from 99designs/smartling
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
62 lines (51 loc) · 1.46 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
MAINTAINER = Alex Koval <[email protected]>
DESCRIPTION = CLI for Smartling Platform
all: clean get build
@
build: darwin windows.exe linux
@
get:
go get
clean:
rm -rf bin pkg
mkdir bin
_PKG = pkg/build
_CONTROL = echo >> $(_PKG)/DEBIAN/control
deb: _pkg-init
mkdir -p $(_PKG)/usr/bin
cp bin/smartling.linux $(_PKG)/usr/bin/smartling
mkdir -p $(_PKG)/DEBIAN
$(_CONTROL) "Package: smartling"
$(_CONTROL) "Version: $(VERSION)"
$(_CONTROL) "Architecture: all"
$(_CONTROL) "Section: unknown"
$(_CONTROL) "Priority: extra"
$(_CONTROL) "Maintainer: $(MAINTAINER)"
$(_CONTROL) "Homepage: https://github.com/Smartling/smartling-cli"
$(_CONTROL) "Description: $(DESCRIPTION)"
dpkg -b $(_PKG) pkg/smartling-$(VERSION)_all.deb
rm -rf $(_PKG)
_SPEC = echo >> $(_PKG)/smartling.spec
rpm: _pkg-init
$(_SPEC) "Name: smartling"
$(_SPEC) "Version: $(VERSION)"
$(_SPEC) "Release: 1%{?dist}"
$(_SPEC) "Summary: $(DESCRIPTION)"
$(_SPEC) "License: MIT"
$(_SPEC) "%description"
$(_SPEC) "%install"
$(_SPEC) "mkdir -p %{buildroot}/%{_bindir}"
$(_SPEC) "cp $(PWD)/bin/smartling.linux %{buildroot}/%{_bindir}/smartling"
$(_SPEC) "%files"
$(_SPEC) "%{_bindir}/smartling"
$(_SPEC) "%define _rpmdir $(_PKG)"
rpmbuild -bb $(_PKG)/smartling.spec
cp $(_PKG)/*/*.rpm pkg/
rm -rf $(_PKG)
_pkg-init:
rm -rf $(_PKG)
mkdir -p $(_PKG)
$(eval VERSION ?= \
$(shell git rev-list --count HEAD).$(shell git rev-parse --short HEAD))
%:
GOOS=$(basename $@) go build -o bin/smartling.$@