]>
Commit | Line | Data |
---|---|---|
fcb3dbe8 ER |
1 | # TODO |
2 | # - solve hacks better: | |
3 | # - hack1: git rev-parse expects .git repo and aborts | |
4 | # - hack2: go get ./... spews errors about "no install location for directory ... outside GOPATH" and aborts | |
5 | # - hack3: scripts/build.sh does kill 0, which kills jobs and makes it abort with error, ignore errors | |
6 | # - hack4: the same kill 0 kills make as well, use setsid to "fix" | |
7 | # - building downloads go packages - not suitable for builders | |
8 | # | |
9 | # Conditional build: | |
10 | %bcond_without tests # build without tests | |
11 | ||
12 | Summary: Tool for creating identical machine images for multiple platforms from a single source configuration | |
13 | Name: packer | |
14 | Version: 0.3.8 | |
15 | Release: 0.1 | |
16 | License: MPL 2.0 | |
17 | Group: Applications/Emulators | |
18 | Source0: https://github.com/mitchellh/packer/archive/v%{version}/%{name}-%{version}.tar.gz | |
19 | # Source0-md5: 2e8fbcf12e4cd9416b7c1c2ea1d97c3a | |
20 | Patch0: build.patch | |
21 | URL: http://www.packer.io/ | |
22 | BuildRequires: golang >= 1.1 | |
23 | BuildRequires: bash | |
24 | BuildRequires: mercurial | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | Packer is lightweight, runs on every major operating system, and is | |
29 | highly performant, creating machine images for multiple platforms in | |
30 | parallel. Packer comes out of the box with support for creating AMIs | |
31 | (EC2), VMware images, and VirtualBox images. Support for more | |
32 | platforms can be added via plugins. | |
33 | ||
34 | The images that Packer creates can easily be turned into Vagrant | |
35 | boxes. | |
36 | ||
37 | %prep | |
38 | %setup -q | |
39 | %patch0 -p1 | |
40 | ||
41 | %build | |
42 | # avoid interfering with builder env | |
56fe4080 | 43 | unset GIT_WORK_TREE GIT_DIR |
fcb3dbe8 ER |
44 | |
45 | export GOPATH=$(pwd)/GOPATH | |
46 | export GOBIN=$GOPATH/bin | |
47 | export PATH=$PATH:$GOBIN | |
48 | install -d $GOBIN | |
49 | ||
50 | setsid %{__make} || : | |
51 | ||
52 | %{?with_test:%{__make} test} | |
53 | ||
54 | %install | |
55 | rm -rf $RPM_BUILD_ROOT | |
56 | install -d $RPM_BUILD_ROOT%{_bindir} | |
57 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
58 | ||
59 | %clean | |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | ||
62 | %files | |
63 | %defattr(644,root,root,755) | |
64 | %doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE | |
65 | %attr(755,root,root) %{_bindir}/packer | |
66 | %attr(755,root,root) %{_bindir}/packer-builder-amazon-chroot | |
67 | %attr(755,root,root) %{_bindir}/packer-builder-amazon-ebs | |
68 | %attr(755,root,root) %{_bindir}/packer-builder-amazon-instance | |
69 | %attr(755,root,root) %{_bindir}/packer-builder-digitalocean | |
70 | %attr(755,root,root) %{_bindir}/packer-builder-openstack | |
71 | %attr(755,root,root) %{_bindir}/packer-builder-virtualbox | |
72 | %attr(755,root,root) %{_bindir}/packer-builder-vmware | |
73 | %attr(755,root,root) %{_bindir}/packer-command-build | |
74 | %attr(755,root,root) %{_bindir}/packer-command-fix | |
75 | %attr(755,root,root) %{_bindir}/packer-command-inspect | |
76 | %attr(755,root,root) %{_bindir}/packer-command-validate | |
77 | %attr(755,root,root) %{_bindir}/packer-post-processor-vagrant | |
78 | %attr(755,root,root) %{_bindir}/packer-provisioner-chef-solo | |
79 | %attr(755,root,root) %{_bindir}/packer-provisioner-file | |
80 | %attr(755,root,root) %{_bindir}/packer-provisioner-puppet-masterless | |
81 | %attr(755,root,root) %{_bindir}/packer-provisioner-salt-masterless | |
82 | %attr(755,root,root) %{_bindir}/packer-provisioner-shell |