babel.spec 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. ##
  2. ## babel.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2016 OpenPKG Foundation e.V. <http://openpkg.net/>
  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_babel 6.10.1
  25. %define V_babel_dist 6.10.1
  26. %define V_babel_snap 20160619
  27. # package information
  28. Name: babel
  29. Summary: ECMAScript 6 to ECMAScript 5 Transpiler
  30. URL: https://babeljs.io/
  31. Vendor: Sebastian McKenzie
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: EVAL
  35. Group: Language
  36. License: MIT
  37. Version: %{V_babel}
  38. Release: 20160619
  39. # list of sources
  40. Source0: http://download.openpkg.org/components/versioned/babel/babel-%{V_babel}-%{V_babel_snap}.tar.gz
  41. # build information
  42. BuildPreReq: OpenPKG, openpkg >= 20160101
  43. PreReq: OpenPKG, openpkg >= 20160101, node
  44. %description
  45. This is an ECMAScript 6 to ECMAScript 5 transpiler.
  46. It was formerly known as 6to5.
  47. %track
  48. prog babel = {
  49. version = %{version}
  50. url = https://github.com/babel/babel/releases
  51. regex = v(\d+\.\d+\.\d+)\.tar\.gz
  52. }
  53. %prep
  54. %setup -q -c
  55. %build
  56. find . -name example -type d -print | xargs rm -rf
  57. find . -name test -type d -print | xargs rm -rf
  58. find . -name .npmignore -type f -print | xargs rm -f
  59. find . -name LICENCE -type f -print | xargs rm -f
  60. find . -name LICENSE -type f -print | xargs rm -f
  61. find . -name LICENSE.txt -type f -print | xargs rm -f
  62. find . -name LICENSE.md -type f -print | xargs rm -f
  63. find . -name license.md -type f -print | xargs rm -f
  64. find . -name license -type f -print | xargs rm -f
  65. find . -name CHANGELOG.md -type f -print | xargs rm -f
  66. find . -name README -type f -print | xargs rm -f
  67. find . -name README.md -type f -print | xargs rm -f
  68. find . -name readme.md -type f -print | xargs rm -f
  69. find . -name .travis.yml -type f -print | xargs rm -f
  70. find . -name .jshintrc -type f -print | xargs rm -f
  71. %install
  72. %{l_shtool} mkdir -f -p -m 755 \
  73. $RPM_BUILD_ROOT%{l_prefix}/bin \
  74. $RPM_BUILD_ROOT%{l_prefix}/lib/babel
  75. cp -rp \
  76. node_modules/* \
  77. $RPM_BUILD_ROOT%{l_prefix}/lib/babel/
  78. ( echo "#!/bin/sh"
  79. echo "NODE_PATH=%{l_prefix}/lib/babel; export NODE_PATH"
  80. echo "exec %{l_prefix}/bin/node %{l_prefix}/lib/babel/babel-cli/bin/babel.js \${1+\"\$@\"}"
  81. ) >babel
  82. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  83. babel $RPM_BUILD_ROOT%{l_prefix}/bin/babel
  84. ( echo "#!/bin/sh"
  85. echo "NODE_PATH=%{l_prefix}/lib/babel; export NODE_PATH"
  86. echo "exec %{l_prefix}/bin/node %{l_prefix}/lib/babel/babel-cli/bin/babel-node.js \${1+\"\$@\"}"
  87. ) >babel-node
  88. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  89. babel-node $RPM_BUILD_ROOT%{l_prefix}/bin/babel-node
  90. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  91. %files -f files
  92. %clean