-
Notifications
You must be signed in to change notification settings - Fork 13
/
apb.spec
237 lines (202 loc) · 7.98 KB
/
apb.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
%if 0%{?fedora} || 0%{?rhel} >= 6
%global with_devel 1
%global with_bundled 0
%global with_debug 0
%global with_check 0
%global with_unit_test 0
%else
%global with_devel 0
%global with_bundled 0
%global with_debug 0
%global with_check 0
%global with_unit_test 0
%endif
%if 0%{?with_debug}
%global _dwz_low_mem_die_limit 0
%else
%global debug_package %{nil}
%endif
%global provider github
%global provider_tld com
%global project automationbroker
%global repo apb
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
%global gopath /usr/share/gocode
%if 0%{?copr}
%define build_timestamp .%(date +"%Y%m%d%H%M%%S")
%else
%define build_timestamp %{nil}
%endif
# %define selinux_variants targeted
%define moduletype apps
%define modulename apb
Name: %{repo}
Version: 2.0.4
Release: 1%{build_timestamp}%{?dist}
Summary: APB CLI
License: ASL 2.0
URL: https://%{provider_prefix}
Source0: %{name}-%{version}.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 %{arm}}
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le %{mips} s390x
BuildRequires: golang
%if ! 0%{?with_bundled}
%endif
%description
%{summary}
%package container-scripts
Summary: scripts required for running apb in a container
BuildArch: noarch
Requires: %{name}
Requires: nss_wrapper
%description container-scripts
containers scripts for apb
%if 0%{?with_devel}
%package devel
Summary: %{summary}
BuildArch: noarch
Requires: golang
%description devel
devel for %{name}
%{import_path} prefix.
%endif
%prep
%setup -q -n %{repo}-%{version}
%if !0%{?copr}
patch -p0 < downstream.patch
%endif
ln -sf vendor src
mkdir -p src/github.com/automationbroker/apb
cp -r pkg src/github.com/automationbroker/apb
cp -r cmd src/github.com/automationbroker/apb
%build
export GOPATH=$(pwd):%{gopath}
go build -i -ldflags "-s -w" -o apb
%if 0%{?rhel} >= 6
distver=rhel%{rhel}
%endif
%if 0%{?fedora} >= 18
distver=fedora%{fedora}
%endif
rm -rf src
%install
install -d -p %{buildroot}%{_bindir}
install -p -m 755 apb %{buildroot}%{_bindir}/apb
install -m 755 apb-wrapper %{buildroot}%{_bindir}/apb-wrapper
# source codes for building projects
%if 0%{?with_devel}
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
# find all *.go but no *_test.go files and generate devel.file-list
for file in $(find . -iname "*.go" \! -iname "*_test.go" | grep -v "^./Godeps") ; do
echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
done
for file in $(find . -iname "*.proto" | grep -v "^./Godeps") ; do
echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
done
%endif
%if 0%{?with_devel}
sort -u -o devel.file-list devel.file-list
%endif
%files
%license LICENSE
%{_bindir}/apb
%files container-scripts
%{_bindir}/apb-wrapper
%if 0%{?with_devel}
%files devel -f devel.file-list
%license LICENSE
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
%dir %{gopath}/src/%{import_path}
%endif
%changelog
* Wed Mar 25 2020 jesus m. rodriguez <[email protected]> 2.0.4-1
- correct the vet option (#156) ([email protected])
- Bug 1793365: move nss_wrapper to container_scripts rpm (#155) ([email protected])
- Bug 1793365: fix permission for /etc/passwd (#154) ([email protected])
- dep ensure (#148) ([email protected])
- set KUBECONFIG env for all commands (#147) ([email protected])
* Fri Feb 01 2019 Jason Montleon <[email protected]> 2.0.3-1
- add cross compilation for Mac OS/X. (#146) ([email protected])
* Fri Jan 04 2019 Dylan Murray <[email protected]> 2.0.2-1
- Bug 1625751 - Use uuids for service_instance labels (#128)
* Thu Dec 06 2018 Dylan Murray <[email protected]> 2.0.1-1
- Update container docs for 4.0 (#144) ([email protected])
- Bug 1640050 - add '--kubeconfig and KUBECONFIG env' support for all sub
commands (#139) ([email protected])
- Consider going to 2.0.0 (#137) ([email protected])
- Preapre for 1.10 release (#136) ([email protected])
* Mon Sep 10 2018 Dylan Murray <[email protected]> 1.9.7-1
- Bug 1626986 - Marshal ext creds instead of assuming interface type (#133)
- Improvements for running the container as root (#132) ([email protected])
* Thu Sep 06 2018 Dylan Murray <[email protected]> 1.9.6-1
- Bug 1625877 - Change downstream patch to use proper route name (#130)
- Bug 1625870 - Update registry add help command with valid org (#131)
- Update apb_cli.md with instructions to use config file values. (#129)
* Fri Aug 31 2018 Jason Montleon <[email protected]> 1.9.5-1
- Fix downstream patch (#127) ([email protected])
- Ensure that one apb alias works consistently (#126) ([email protected])
- Pre-release docs update. (#122) ([email protected])
* Thu Aug 23 2018 Dylan Murray <[email protected]> 1.9.4-1
- Add broker route suffix as a config option (#123) ([email protected])
- Bug 1620042 - do not harcode in_cluster var & update docs (#120)
* Tue Aug 21 2018 Dylan Murray <[email protected]> 1.9.3-1
- Update apb_cli document (#118) ([email protected])
- Bug 1613720 - Make -n flag for broker namespace (#119) ([email protected])
* Fri Aug 17 2018 David Zager <[email protected]> 1.9.2-1
- Bug 1613664 - Update shorthand flags for bundle subcommand (#117)
- Bug 1577769 - Add support for outputting broker catalog request in yaml, json
(#114) ([email protected])
- Fix BrokerRouteName (#115) ([email protected])
- Bug 1613224 - Add CLI param support for Runner field (#113)
- Add apb-container-scripts sub-package with wrapper (#116)
- Add support for specifying tag in registry add (#110) ([email protected])
- Bug 1595153 - Add support for apb test that works in and out of cluster
(#109) ([email protected])
- Hard code the broker prefix to osb (#112) ([email protected])
- add downstream patch (#111) ([email protected])
- Updates for spec reconciliation changes to bootstrap endpoint (#107)
- Fix loading of defaults for config package & add tests (#105)
- Fix quay default (#104) ([email protected])
- Add unit tests for config and util packages (#97) ([email protected])
- Add quay registry adapter (#101) ([email protected])
- Change default imagePullPolicy to always (#100) ([email protected])
- Update vendor to pick up bundle-lib 0.2.6 (#96) ([email protected])
- Update repo with docs folder (#93) ([email protected])
- Add developers.md, include sections on building and running APBs (#94)
- Add `apb config` cmd for configuring broker/catalog interaction vars (#88)
- Update deprovision command with --skip-params flag (#85)
- Remove go compiler macro (#87) ([email protected])
- Pre-release tweaks (#84) ([email protected])
- Update vendor to pick up bundle-lib release (#83) ([email protected])
- Add support for `apb catalog relist` (#79) ([email protected])
- Match old apb commands (#78) ([email protected])
- Add apb version command with tito versioning (#80) ([email protected])
- Make registry subcommand experience better (#71) ([email protected])
- Add support for viewing bundle logs for action. (#76)
- Remove requirement to supply namespace (#72) ([email protected])
- Add releasers info for tito and brew (#74) ([email protected])
* Thu Jul 05 2018 Dylan Murray <[email protected]> 1.9.1-1
- new package built with tito