Skip to content

Commit

Permalink
refine APKBUILD according to review suggestion.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwq committed May 25, 2024
1 parent 0f1128a commit 549eea8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
21 changes: 2 additions & 19 deletions build/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,10 @@ source="https://github.com/ericwq/aprilsh/releases/download/$pkgver/aprilsh-$pkg
apshd.initd"

# build info (part 1) required by go build
_git_tag=0.7.0
_git_tag=$pkgver
_git_commit=f170d10
_git_branch=HEAD

# set build tags based on glibc or musl
_musl=$(ldd /bin/ls | grep 'musl'|head -n 1| awk '{print $1}')
if [ "$_musl" == "" ]
then
_build_tag="-tags utmp"
else
_build_tag="-tags utmps"
fi
_build_tag="-tags utmps"

# go build need this
export PATH=$PATH:~/go/bin
Expand Down Expand Up @@ -57,15 +49,6 @@ build() {
echo "build server end : $(date)"
echo "output server to : $builddir/bin/apshd"


# set ldflags (required for update BuildTime)
local ldflags="-s -w \
-X $_module_name/frontend.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%S) \
-X $_module_name/frontend.GitBranch=$_git_branch \
-X $_module_name/frontend.GitCommit=$_git_commit \
-X $_module_name/frontend.GitTag=$_git_tag \
-X $_module_name/frontend.GoVersion=$_go_version \
"
echo "build client start: $(date)"
go build -ldflags="$ldflags" -o "$builddir/bin/apsh" ./frontend/client
echo "build client end : $(date)"
Expand Down
3 changes: 2 additions & 1 deletion doc/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ sudo -u packager sh
run as `packager` user, git pull aports fork.
```sh
sudo apk update
sudo apk add go protoc utmps-dev ncurses-terminfo musl-locales protoc-gen-go colordiff
sudo apk add go protoc utmps-dev ncurses-terminfo openssh-client
sudo apk add musl-locales protoc-gen-go colordiff
cd ~/aports
git config pull.rebase true # rebase pull
git pull # get latest update
Expand Down

0 comments on commit 549eea8

Please sign in to comment.