[packages/packer] new, even builds

glen glen at pld-linux.org
Wed Sep 25 23:54:19 CEST 2013


commit fcb3dbe8e78bd5fb883b5f988546994a803f3c95
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Sep 26 00:53:57 2013 +0300

    new, even builds

 build.patch | 27 ++++++++++++++++++++
 packer.spec | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)
---
diff --git a/packer.spec b/packer.spec
new file mode 100644
index 0000000..fd86d80
--- /dev/null
+++ b/packer.spec
@@ -0,0 +1,82 @@
+# TODO
+# - solve hacks better:
+#   - hack1: git rev-parse expects .git repo and aborts
+#   - hack2: go get ./... spews errors about "no install location for directory ... outside GOPATH" and aborts
+#   - hack3: scripts/build.sh does kill 0, which kills jobs and makes it abort with error, ignore errors
+#   - hack4: the same kill 0 kills make as well, use setsid to "fix"
+# - building downloads go packages - not suitable for builders
+#
+# Conditional build:
+%bcond_without	tests		# build without tests
+
+Summary:	Tool for creating identical machine images for multiple platforms from a single source configuration
+Name:		packer
+Version:	0.3.8
+Release:	0.1
+License:	MPL 2.0
+Group:		Applications/Emulators
+Source0:	https://github.com/mitchellh/packer/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	2e8fbcf12e4cd9416b7c1c2ea1d97c3a
+Patch0:		build.patch
+URL:		http://www.packer.io/
+BuildRequires:	golang >= 1.1
+BuildRequires:	bash
+BuildRequires:	mercurial
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Packer is lightweight, runs on every major operating system, and is
+highly performant, creating machine images for multiple platforms in
+parallel. Packer comes out of the box with support for creating AMIs
+(EC2), VMware images, and VirtualBox images. Support for more
+platforms can be added via plugins.
+
+The images that Packer creates can easily be turned into Vagrant
+boxes.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%build
+# avoid interfering with builder env
+#unset GIT_WORK_TREE GIT_DIR
+
+export GOPATH=$(pwd)/GOPATH
+export GOBIN=$GOPATH/bin
+export PATH=$PATH:$GOBIN
+install -d $GOBIN
+
+setsid %{__make} || :
+
+%{?with_test:%{__make} test}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_bindir}
+cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE
+%attr(755,root,root) %{_bindir}/packer
+%attr(755,root,root) %{_bindir}/packer-builder-amazon-chroot
+%attr(755,root,root) %{_bindir}/packer-builder-amazon-ebs
+%attr(755,root,root) %{_bindir}/packer-builder-amazon-instance
+%attr(755,root,root) %{_bindir}/packer-builder-digitalocean
+%attr(755,root,root) %{_bindir}/packer-builder-openstack
+%attr(755,root,root) %{_bindir}/packer-builder-virtualbox
+%attr(755,root,root) %{_bindir}/packer-builder-vmware
+%attr(755,root,root) %{_bindir}/packer-command-build
+%attr(755,root,root) %{_bindir}/packer-command-fix
+%attr(755,root,root) %{_bindir}/packer-command-inspect
+%attr(755,root,root) %{_bindir}/packer-command-validate
+%attr(755,root,root) %{_bindir}/packer-post-processor-vagrant
+%attr(755,root,root) %{_bindir}/packer-provisioner-chef-solo
+%attr(755,root,root) %{_bindir}/packer-provisioner-file
+%attr(755,root,root) %{_bindir}/packer-provisioner-puppet-masterless
+%attr(755,root,root) %{_bindir}/packer-provisioner-salt-masterless
+%attr(755,root,root) %{_bindir}/packer-provisioner-shell
diff --git a/build.patch b/build.patch
new file mode 100644
index 0000000..45cdc21
--- /dev/null
+++ b/build.patch
@@ -0,0 +1,27 @@
+--- packer/scripts/build.sh	2013-09-26 00:24:44.414373468 +0300
++++ /tmp/build.sh	2013-09-26 00:38:58.457386171 +0300
+@@ -1,4 +1,5 @@
+ #!/bin/bash
++set -x
+ #
+ # This script only builds the application from source.
+ set -e
+@@ -17,7 +18,7 @@
+ cd $DIR
+ 
+ # Get the git commit
+-GIT_COMMIT=$(git rev-parse HEAD)
++GIT_COMMIT=$(git rev-parse HEAD || echo ca9426d6e73c2307e0f3d451adecccbe19241a8c)
+ GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)
+ 
+ # If we're building on Windows, specify an extension
+@@ -36,7 +37,8 @@
+ fi
+ 
+ echo -e "${OK_COLOR}--> Installing dependencies to speed up builds...${NO_COLOR}"
+-go get ./...
++#pwd
++go get ./... || :
+ 
+ # This function waits for all background tasks to complete
+ waitAll() {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/packer.git/commitdiff/fcb3dbe8e78bd5fb883b5f988546994a803f3c95



More information about the pld-cvs-commit mailing list