-
Notifications
You must be signed in to change notification settings - Fork 1
/
git-octopus.spec
104 lines (77 loc) · 3.13 KB
/
git-octopus.spec
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Build project from bundled dependencies
%global with_bundled 0
%global debug_package %{nil}
%if ! 0%{?gobuild:1}
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
%endif
%global provider github
%global provider_tld com
%global project lesfurets
%global repo git-octopus
# https://github.com/lesfurets/git-octopus
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
%global commit 05ad486a5bb5d46d2d1127a860d425a2ec184e9e
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: git-octopus
Version: 2.0
Release: 0.3.beta3%{?dist}
Summary: Git commands for continuous delivery
License: LGPLv3
URL: https://%{provider_prefix}
Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
Requires: git
Requires: %{_bindir}/shasum
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires: asciidoc
%description
The continuous merge workflow is meant for continuous integration/delivery and
is based on feature branching. git-octopus provides git commands to implement
it.
%prep
%setup -q -n %{repo}-%{commit}
%build
mkdir -p src/%{provider}.%{provider_tld}/%{project}
ln -s ../../../ src/%{import_path}
export GOPATH=$(pwd):%{gopath}
make %{?_smp_mflags} build-docs
%gobuild -o bin/git-octopus %{import_path}/
%install
install -d -p %{buildroot}%{_bindir}
install -p -v -m 0755 bin/git-octopus %{buildroot}%{_bindir}
make prefix="%{buildroot}%{_prefix}" \
docdir="%{buildroot}%{_docdir}/%{name}%{?rhel:-%{version}}" install-docs
%check
%if ! 0%{?with_bundled}
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
%else
# Since we aren't packaging up the vendor directory we need to link
# back to it somehow. Hack it up so that we can add the vendor
# directory from BUILD dir as a gopath to be searched when executing
# tests from the BUILDROOT dir.
ln -s ./ ./vendor/src # ./vendor/src -> ./vendor
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
%endif
%files
%doc README.md doc/*.html
%license LICENSE
%{_bindir}/git-*
%{_mandir}/man1/git-*.1*
%changelog
* Tue Jul 11 2017 Andrea Baita <[email protected]> - 2.0-0.3.beta3
- package go beta version 3
* Fri Jun 30 2017 Andrea Baita <[email protected]> - 2.0-0.2.beta2
- package go beta version 2
* Mon Apr 10 2017 Jabouille Jean Charles <[email protected]> - 2.0-0.1.beta1
- package go beta version
* Mon Jan 30 2017 Andrea Baita <[email protected]> - 1.4-3
- added ?_smp_mflags
* Tue Dec 06 2016 Andrea Baita <[email protected]> - 1.4-2
- added documentation build, updated build requires
* Wed Nov 30 2016 Andrea Baita <[email protected]> - 1.4-1
- Packaging of version 1.4.
* Thu Nov 17 2016 Xavier Bachelot <[email protected]> - 1.3-1
- Initial package.