chalk.spec 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ##
  2. ## chalk.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_chalk 3.0.0
  25. %define V_chalk_snap 20160608
  26. # package information
  27. Name: chalk
  28. Summary: Output Colorizer
  29. URL: https://github.com/chalk/chalk-cli/
  30. Vendor: Sindre Sorhus
  31. Packager: OpenPKG Foundation e.V.
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: Terminal
  35. License: MIT
  36. Version: %{V_chalk}
  37. Release: 20160608
  38. # list of sources
  39. Source0: http://download.openpkg.org/components/versioned/chalk/chalk-%{V_chalk}-%{V_chalk_snap}.tar.gz
  40. # build information
  41. BuildPreReq: OpenPKG, openpkg >= 20160101
  42. PreReq: OpenPKG, openpkg >= 20160101, node
  43. %description
  44. This is a terminal output colorizer.
  45. %track
  46. prog chalk = {
  47. version = %{version}
  48. url = https://github.com/chalk/chalk-cli/releases
  49. regex = v(\d+\.\d+\.\d+)
  50. }
  51. %prep
  52. %setup -q -c
  53. %build
  54. find . -name test -type d -print | xargs rm -rf
  55. find . -name example -type d -print | xargs rm -rf
  56. find . -name license -type f -print | xargs rm -f
  57. find . -name LICENSE -type f -print | xargs rm -f
  58. find . -name readme.md -type f -print | xargs rm -f
  59. find . -name readme.markdown -type f -print | xargs rm -f
  60. find . -name README -type f -print | xargs rm -f
  61. find . -name .travis.yml -type f -print | xargs rm -f
  62. %install
  63. %{l_shtool} mkdir -f -p -m 755 \
  64. $RPM_BUILD_ROOT%{l_prefix}/bin \
  65. $RPM_BUILD_ROOT%{l_prefix}/lib/chalk
  66. cp -rp \
  67. node_modules/* \
  68. $RPM_BUILD_ROOT%{l_prefix}/lib/chalk/
  69. ( echo "#!/bin/sh"
  70. echo "NODE_PATH=%{l_prefix}/lib/chalk; export NODE_PATH"
  71. echo "exec %{l_prefix}/lib/chalk/chalk-cli/cli.js \${1+\"\$@\"}"
  72. ) >chalk
  73. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  74. chalk $RPM_BUILD_ROOT%{l_prefix}/bin/chalk
  75. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  76. %files -f files
  77. %clean