cbor.spec 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ##
  2. ## cbor.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2019 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_cbor 4.1.5
  25. %define V_cbor_snap 20190130
  26. # package information
  27. Name: cbor
  28. Summary: Concise Binary Object Representation
  29. URL: http://cbor.io/
  30. Vendor: Carsten Bormann et al.
  31. Packager: OpenPKG Project
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: Libraries
  35. License: MIT
  36. Version: %{V_cbor}
  37. Release: 20190130
  38. # list of sources
  39. Source0: http://download.openpkg.org/components/versioned/cbor/cbor-%{V_cbor}-%{V_cbor_snap}.tar.gz
  40. # build information
  41. BuildPreReq: OpenPKG, openpkg >= 20160101, node-openpkg
  42. PreReq: OpenPKG, openpkg >= 20160101, node, git
  43. %description
  44. The Concise Binary Object Representation (CBOR) is a data format
  45. whose design goals include the possibility of extremely small code
  46. size, fairly small message size, and extensibility without the need
  47. for version negotiation.
  48. %track
  49. prog cbor:release = {
  50. version = %{V_cbor}
  51. url = https://github.com/hildjj/node-cbor/releases
  52. regex = v(__VER__)\.tar\.gz
  53. }
  54. prog cbor:snapshot = {
  55. version = %{V_cbor_snap}
  56. url = http://download.openpkg.org/components/versioned/cbor/
  57. regex = cbor-\d+\.\d+\.\d+-(\d+)\.tar\.gz
  58. }
  59. %prep
  60. %setup -q -c
  61. %build
  62. rm -rf node_modules/cbor/src
  63. rm -rf node_modules/cbor/man_src
  64. rm -rf node_modules/cbor/test
  65. rm -f node_modules/cbor/Gruntfile.js
  66. rm -f node_modules/cbor/coffeelint.json
  67. %{l_prefix}/bin/node-openpkg squeeze
  68. %{l_shtool} subst \
  69. -e 's;#!/usr/bin/env node;#!%{l_prefix}/bin/node;g' \
  70. node_modules/cbor/bin/*
  71. %install
  72. %{l_shtool} mkdir -f -p -m 755 \
  73. $RPM_BUILD_ROOT%{l_prefix}/bin \
  74. $RPM_BUILD_ROOT%{l_prefix}/lib/cbor
  75. %{l_prefix}/bin/node-openpkg install \
  76. %{l_prefix}/lib/cbor/
  77. for prg in node_modules/cbor/bin/*; do
  78. name=`echo $prg | sed -e 's;.*/;;'`
  79. echo "$name"
  80. ( echo "#!/bin/sh"
  81. echo "NODE_PATH=%{l_prefix}/lib/cbor; export NODE_PATH"
  82. echo "exec %{l_prefix}/lib/cbor/cbor/bin/$name \${1+\"\$@\"}"
  83. ) >$name.sh
  84. %{l_shtool} install -c -m 755 \
  85. $name.sh $RPM_BUILD_ROOT%{l_prefix}/bin/$name
  86. done
  87. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  88. %files -f files
  89. %clean