-
-
Save jimklo/2510107a3fa355d93ce2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- | |
set p = { | |
'archives_src': 'file:///workspace/code/thirdparty', | |
'work_path': '/workspace/code/thirdparty', | |
'archives': { | |
'protobuf-2.4.1': { | |
'archive': 'protobuf-2.4.1.tar.bz2', | |
'archive_sha': 'sha512=52b0208c685e44126cb3915a74bde692ef91430f0407144b6c30b72a9f143b1ee4f1eea47a550184c689a1758b92582e7f26f0683c2d387205b957a69830f2f3', | |
'archive_opts': 'J', | |
'src_path': '/workspace/code/thirdparty/protobuf-2.4.1', | |
'script': 'salt://thirdparty/install-protobuf.sh', | |
'installs': '/usr/local/bin/protoc' | |
}, | |
'boost_1_51_0': { | |
'archive': 'boost_1_51_0.tar.gz', | |
'archive_sha': 'sha512=e1e147d2794fe618c671e14e46ecfa3e44a90276337c3ce084583cfd4057f9108a19650755586ef15f65bd4fbeef9e118f33de0d14dfcc3d9ab4ecde4d645532', | |
'archive_opts': 'z', | |
'src_path': '/workspace/code/thirdparty/boost_1_51_0', | |
'script': 'salt://thirdparty/install-boost.sh', | |
'installs': '/usr/local/include/boost' | |
} | |
} | |
} | |
%} | |
{% for tpname, tp in p.archives.iteritems() %} | |
thirdparty-{{tpname}}-exists: | |
file.exists: | |
- name: '{{p.work_path}}/{{tp.archive}}' | |
unpack-{{tpname}}-tar: | |
archive.extracted: | |
- name: '{{p.work_path}}' | |
- source: '{{p.archives_src}}/{{p.archive}}' | |
- source_hash: '{{tp.archive_sha}}' | |
- tar_options: {{tp.archive_opts}} | |
- archive_format: tar | |
- if_missing: '{{tp.src_path}}' | |
- require: | |
- file: thirdparty-{{tpname}}-exists | |
install-{{tpname}}: | |
cmd.script: | |
- source: '{{tp.script}}' | |
- cwd: '{{tp.src_path}}' | |
installed-{{tpname}}: | |
file.exists: | |
- name: '{{tp.installs}}' | |
cleanup-{{tpname}}: | |
file.absent: | |
- name: '{{tp.src_path}}' | |
- require: | |
- file: thirdparty-{{tpname}}-tar | |
- file: installed-{{tp.installs}} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment