hugo.spec 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ##
  2. ## hugo.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_hugo_base 0.27
  25. %define V_hugo_snap 20170911
  26. # package information
  27. Name: hugo
  28. Summary: Static Website Generator
  29. URL: http://gohugo.io/
  30. Vendor: Steve Francia
  31. Packager: OpenPKG Foundation e.V.
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: Web
  35. License: Apache
  36. Version: %{V_hugo_base}.%{V_hugo_snap}
  37. Release: 20170911
  38. # list of sources
  39. Source0: http://download.openpkg.org/components/versioned/hugo/hugo-%{V_hugo_snap}.tar.xz
  40. # build information
  41. BuildPreReq: OpenPKG, openpkg >= 20160101, go
  42. PreReq: OpenPKG, openpkg >= 20160101
  43. %description
  44. Hugo is a static HTML and CSS website generator written in Go. It
  45. is optimized for speed, easy use and configurability. Hugo takes a
  46. directory with content and templates and renders them into a full
  47. HTML website. Hugo relies on Markdown files with front matter for
  48. meta data. And you can run Hugo from any directory. This works
  49. well for shared hosts and other systems where you don’t have a
  50. privileged account. Hugo renders a typical website of moderate size
  51. in a fraction of a second. A good rule of thumb is that each piece
  52. of content renders in around 1 millisecond. Hugo is designed to work
  53. well for any kind of website including blogs, tumbles and docs.
  54. %track
  55. prog hugo = {
  56. version = %{V_hugo_base}
  57. url = https://github.com/spf13/hugo/releases
  58. regex = v(__VER__)\.tar\.gz
  59. }
  60. %prep
  61. %setup -q -n hugo
  62. %build
  63. # build program
  64. export GOPATH=`pwd`
  65. cd $GOPATH/src/github.com/spf13/hugo
  66. go build -x \
  67. -ldflags "-X github.com/spf13/hugo/hugolib.CommitHash=000000 -X github.com/spf13/hugo/hugolib.BuildDate=`date +%FT%T%z`" \
  68. -o hugo main.go
  69. %install
  70. # create directory hierarchy
  71. %{l_shtool} mkdir -f -p -m 755 \
  72. $RPM_BUILD_ROOT%{l_prefix}/bin
  73. # install program
  74. %{l_shtool} install -c -s -m 755 \
  75. src/github.com/spf13/hugo/hugo \
  76. $RPM_BUILD_ROOT%{l_prefix}/bin/
  77. # determine installation files
  78. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  79. %files -f files
  80. %clean