fzf.spec 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ##
  2. ## fzf.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2017 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 information
  24. %define V_fzf_base 0.17.1
  25. %define V_fzf_snap 20171016
  26. # package information
  27. Name: fzf
  28. Summary: Fuzzy File Searching
  29. URL: https://github.com/junegunn/fzf/
  30. Vendor: Junegunn Choi
  31. Packager: OpenPKG Foundation e.V.
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: Filesystem
  35. License: MIT
  36. Version: %{V_fzf_base}
  37. Release: 20171016
  38. # list of sources
  39. Source0: http://download.openpkg.org/components/versioned/fzf/fzf-%{V_fzf_snap}.tar.xz
  40. # build information
  41. BuildPreReq: OpenPKG, openpkg >= 20160101, go
  42. PreReq: OpenPKG, openpkg >= 20160101, rsync
  43. %description
  44. fzf(1) is a general-purpose command-line fuzzy finder.
  45. %track
  46. prog fzf = {
  47. version = %{V_fzf_base}
  48. url = https://github.com/junegunn/fzf/releases
  49. regex = (__VER__)\.tar\.gz
  50. }
  51. %prep
  52. %setup -q -n fzf
  53. %build
  54. # build program
  55. ( export GOPATH=`pwd`
  56. cd $GOPATH/src/github.com/junegunn/fzf
  57. go build -x -o bin/fzf main.go
  58. ) || exit $?
  59. %install
  60. # create directory hierarchy
  61. %{l_shtool} mkdir -f -p -m 755 \
  62. $RPM_BUILD_ROOT%{l_prefix}/bin \
  63. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  64. $RPM_BUILD_ROOT%{l_prefix}/share/fzf
  65. # install program
  66. %{l_shtool} install -c -s -m 755 \
  67. src/github.com/junegunn/fzf/bin/fzf \
  68. $RPM_BUILD_ROOT%{l_prefix}/bin/
  69. %{l_shtool} install -c -m 755 \
  70. -e 's;#!/usr/bin/env bash;#!%{l_bash};' \
  71. src/github.com/junegunn/fzf/bin/fzf-tmux \
  72. $RPM_BUILD_ROOT%{l_prefix}/bin/
  73. # install manual page
  74. %{l_shtool} install -c -m 644 \
  75. src/github.com/junegunn/fzf/man/man1/fzf.1 \
  76. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  77. # install aux files
  78. %{l_shtool} install -c -m 644 \
  79. src/github.com/junegunn/fzf/plugin/* \
  80. src/github.com/junegunn/fzf/shell/* \
  81. $RPM_BUILD_ROOT%{l_prefix}/share/fzf/
  82. # determine installation files
  83. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  84. %files -f files
  85. %clean