yq.spec 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ##
  2. ## yq.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2022 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 information
  24. %define V_yq_base 4.25.1
  25. %define V_yq_snap 20220429
  26. # package information
  27. Name: yq
  28. Summary: Go YAML Tool
  29. URL: https://github.com/mikefarah/yq
  30. Vendor: Mike Farah
  31. Packager: OpenPKG Project
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: Text
  35. License: MIT
  36. Version: %{V_yq_base}.%{V_yq_snap}
  37. Release: 20220429
  38. # list of sources
  39. Source0: http://download.openpkg.org/components/versioned/yq/yq-%{V_yq_snap}.tar.xz
  40. # build information
  41. BuildPreReq: OpenPKG, openpkg >= 20160101, go
  42. PreReq: OpenPKG, openpkg >= 20160101
  43. %description
  44. This is a Go YAML tool.
  45. %track
  46. prog yq:base = {
  47. version = %{V_yq_base}
  48. url = https://github.com/mikefarah/yq/releases
  49. regex = (\d+\.\d+\.\d+)\.tar\.gz
  50. }
  51. prog yq:snap = {
  52. version = %{V_yq_snap}
  53. url = http://download.openpkg.org/components/versioned/yq/
  54. regex = yq-(__VER__)\.tar\.xz
  55. }
  56. %prep
  57. %setup -q -n yq
  58. %build
  59. # build program
  60. export GOPATH=`pwd`
  61. cd $GOPATH/src/github.com/mikefarah/yq
  62. go build -v -o yq .
  63. %install
  64. # create directory hierarchy
  65. %{l_shtool} mkdir -f -p -m 755 \
  66. $RPM_BUILD_ROOT%{l_prefix}/bin
  67. # install program
  68. %{l_shtool} install -c -s -m 755 \
  69. src/github.com/mikefarah/yq/yq \
  70. $RPM_BUILD_ROOT%{l_prefix}/bin/
  71. # determine installation files
  72. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  73. %files -f files
  74. %clean