My build of nnn with minor changes
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

43 行
899 B

  1. #!/bin/bash
  2. set -xe
  3. if [[ $# -ne 2 ]]; then
  4. echo "Usage: $0 <OS_TYPE> <OS_VERSION>"
  5. exit 1
  6. fi
  7. os_type="$1"
  8. os_version="$2"
  9. docker_args="-e OS_TYPE=$os_type -e OS_VERSION=$os_version -v $(pwd):/build:rw --rm=true"
  10. case $os_type in
  11. centos|fedora)
  12. # check for correct package manager
  13. if [[ $os_type == "fedora" ]]; then
  14. YUM=dnf
  15. else
  16. YUM=yum
  17. fi
  18. # set up the docker image with a baseline
  19. cat >Dockerfile <<EOF
  20. FROM $os_type:$os_version
  21. RUN mkdir /build
  22. VOLUME /build
  23. RUN $YUM -y install rpm-build gcc git make readline-devel ncurses-devel
  24. EOF
  25. sudo docker build -t nnn .
  26. # do the build
  27. sudo docker run $docker_args nnn /bin/bash -c "cd /build && ./redhat/build-rpm"
  28. ;;
  29. *)
  30. echo "$OS_TYPE $OS_VERSION not supported!"
  31. exit 1
  32. ;;
  33. esac
  34. # vim: et:ai:ts=4:sw=4