packer.spec 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ##
  2. ## packer.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2020 OpenPKG Project <http://openpkg.org/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_packer_base 1.5.2
  25. %define V_packer_snap 20200213
  26. # package information
  27. Name: packer
  28. Summary: Machine Image Creation Tool
  29. URL: http://www.packer.io/
  30. Vendor: Mitchell Hashimoto
  31. Packager: OpenPKG Project
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: Filesystem
  35. License: MPL
  36. Version: %{V_packer_base}.%{V_packer_snap}
  37. Release: 20200213
  38. # list of sources
  39. Source0: http://download.openpkg.org/components/versioned/packer/packer-%{V_packer_snap}.tar.xz
  40. # build information
  41. BuildPreReq: OpenPKG, openpkg >= 20160101, go
  42. PreReq: OpenPKG, openpkg >= 20160101
  43. %description
  44. Packer is a tool for creating identical machine images for multiple
  45. platforms from a single source configuration. A machine image is a
  46. single static unit that contains a pre-configured operating system
  47. and installed software which is used to quickly create new running
  48. machines.
  49. %track
  50. prog packer:release = {
  51. version = %{V_packer_base}
  52. url = https://github.com/hashicorp/packer/releases
  53. regex = v(\d+\.\d+\.\d+)\.tar\.gz
  54. }
  55. prog packer:snapshot = {
  56. version = %{V_packer_snap}
  57. url = http://download.openpkg.org/components/versioned/packer/
  58. regex = packer-(__VER__)\.tar\.xz
  59. }
  60. %prep
  61. %setup -q -n packer
  62. %build
  63. # build program
  64. export GOPATH=`pwd`
  65. cd src/github.com/hashicorp/packer
  66. go build -v -o bin/packer
  67. %install
  68. # create directory hierarchy
  69. %{l_shtool} mkdir -f -p -m 755 \
  70. $RPM_BUILD_ROOT%{l_prefix}/bin
  71. # install program
  72. %{l_shtool} install -c -s -m 755 \
  73. src/github.com/hashicorp/packer/bin/packer \
  74. $RPM_BUILD_ROOT%{l_prefix}/bin/packer
  75. # determine installation files
  76. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  77. %files -f files
  78. %clean