github.com/kovansky/hugo@v0.92.3-0.20220224232819-63076e4ff19f/snap/snapcraft.yaml (about) 1 name: hugo 2 version: git 3 summary: Fast and Flexible Static Site Generator 4 description: | 5 Hugo is a static HTML and CSS website generator written in Go. It is 6 optimized for speed, easy use and configurability. Hugo takes a directory 7 with content and templates and renders them into a full HTML website. 8 license: "Apache-2.0" 9 base: core20 10 confinement: strict 11 grade: devel # "devel" or "stable" 12 13 package-repositories: 14 - type: apt 15 components: [main] 16 suites: [focal] 17 key-id: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 18 url: https://deb.nodesource.com/node_16.x 19 20 apps: 21 hugo: 22 command: bin/hugo 23 completer: hugo-completion 24 plugs: 25 - home 26 - network-bind 27 - removable-media 28 29 parts: 30 git: 31 plugin: nil 32 stage-packages: 33 - git 34 organize: 35 usr/bin/: bin/ 36 prime: 37 - bin/git 38 39 hugo: 40 plugin: nil 41 build-snaps: [go/1.16/stable] 42 source: . 43 override-build: | 44 set -ex 45 46 echo "\nStarting override-build:" 47 export GOPATH=$(realpath ../go) 48 export PATH=$GOPATH/bin:$PATH 49 50 echo ' * Running "go get -v github.com/magefile/mage"...' 51 go get -v github.com/magefile/mage 52 53 #echo ' * Running "mage -v test"...' 54 #mage -v test 55 56 echo " * SNAPCRAFT_IMAGE_INFO=${SNAPCRAFT_IMAGE_INFO=}" 57 # Example: SNAPCRAFT_IMAGE_INFO='{"build_url": "https://launchpad.net/~gohugoio/+snap/hugo-extended-dev/+build/344022"}' 58 export HUGO_BUILD_TAGS="" 59 if echo $SNAPCRAFT_IMAGE_INFO | grep -q '/+snap/hugo-extended'; then 60 HUGO_BUILD_TAGS="extended" 61 fi 62 echo " * Building hugo (HUGO_BUILD_TAGS=\"$HUGO_BUILD_TAGS\")..." 63 [ "$SNAPCRAFT_PROJECT_GRADE" = "stable" ] && mage -v hugoNoGitInfo || mage -v hugo 64 ./hugo version 65 ldd hugo || : 66 67 echo " * Building shell completion..." 68 ./hugo completion bash > hugo-completion 69 70 echo " * Installing to ${SNAPCRAFT_PART_INSTALL}..." 71 install -d $SNAPCRAFT_PART_INSTALL/bin 72 cp -av hugo $SNAPCRAFT_PART_INSTALL/bin/ 73 mv -v hugo-completion $SNAPCRAFT_PART_INSTALL/ 74 75 echo " * Stripping binary..." 76 ls -l $SNAPCRAFT_PART_INSTALL/bin/hugo 77 strip --remove-section=.comment --remove-section=.note $SNAPCRAFT_PART_INSTALL/bin/hugo 78 ls -l $SNAPCRAFT_PART_INSTALL/bin/hugo 79 80 node: 81 plugin: nil 82 stage-packages: 83 - nodejs 84 organize: 85 usr/bin/: bin/ 86 usr/lib/: lib/ 87 prime: 88 - bin/node 89 - lib/*/lib*.so* 90 91 pandoc: 92 plugin: nil 93 stage-packages: 94 - libatomic1 95 - pandoc 96 - pandoc-data 97 organize: 98 usr/bin/: bin/ 99 usr/lib/: lib/ 100 prime: 101 - bin/pandoc