|
|
@ -1,4 +1,4 @@ |
|
|
|
%define fullversion 2021-04-06T23-11-00Z |
|
|
|
%define fullversion 2021-10-08T23-58-24Z |
|
|
|
%define realversion %(echo %{fullversion} | sed -e 's/[^0-9]//g' | cut -c -8) |
|
|
|
%define realversion %(echo %{fullversion} | sed -e 's/[^0-9]//g' | cut -c -8) |
|
|
|
|
|
|
|
|
|
|
|
%global _hardened_build 1 |
|
|
|
%global _hardened_build 1 |
|
|
@ -48,8 +48,8 @@ Minio Gateway Package |
|
|
|
%setup -T -q -c %{name}-%{realversion} |
|
|
|
%setup -T -q -c %{name}-%{realversion} |
|
|
|
export GOPATH=`pwd` |
|
|
|
export GOPATH=`pwd` |
|
|
|
export GO111MODULE=on |
|
|
|
export GO111MODULE=on |
|
|
|
mkdir -p src/github.com/minio/ |
|
|
|
mkdir -p go/src/github.com/minio/ |
|
|
|
cd src/github.com/minio/ |
|
|
|
cd go/src/github.com/minio/ |
|
|
|
git clone https://github.com/minio/minio |
|
|
|
git clone https://github.com/minio/minio |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -57,7 +57,8 @@ git clone https://github.com/minio/minio |
|
|
|
export GOPATH=`pwd` |
|
|
|
export GOPATH=`pwd` |
|
|
|
export GO111MODULE=on |
|
|
|
export GO111MODULE=on |
|
|
|
export CGO_ENABLED=0 |
|
|
|
export CGO_ENABLED=0 |
|
|
|
cd src/github.com/minio/minio |
|
|
|
export GOPROXY=https://goproxy.io |
|
|
|
|
|
|
|
cd go/src/github.com/minio/minio |
|
|
|
git checkout tags/RELEASE.%{fullversion} |
|
|
|
git checkout tags/RELEASE.%{fullversion} |
|
|
|
export COMMIT=$(git rev-parse HEAD) |
|
|
|
export COMMIT=$(git rev-parse HEAD) |
|
|
|
export SHORTCOMMIT=$(git rev-parse --short HEAD) |
|
|
|
export SHORTCOMMIT=$(git rev-parse --short HEAD) |
|
|
@ -67,17 +68,12 @@ sed 's/Version = goGetTag/Version = "%{fullversion}"/' -i cmd/build-constants.go |
|
|
|
sed 's/ReleaseTag = goGetTag/ReleaseTag = "RELEASE.%{fullversion}"/' -i cmd/build-constants.go |
|
|
|
sed 's/ReleaseTag = goGetTag/ReleaseTag = "RELEASE.%{fullversion}"/' -i cmd/build-constants.go |
|
|
|
sed 's/CommitID = goGetTag/CommitID = "'$COMMIT'"/' -i cmd/build-constants.go |
|
|
|
sed 's/CommitID = goGetTag/CommitID = "'$COMMIT'"/' -i cmd/build-constants.go |
|
|
|
sed 's/ShortCommitID = CommitID\[:12\]/ShortCommitID = "'$SHORTCOMMIT'"/' -i cmd/build-constants.go |
|
|
|
sed 's/ShortCommitID = CommitID\[:12\]/ShortCommitID = "'$SHORTCOMMIT'"/' -i cmd/build-constants.go |
|
|
|
go build -v -tags kqueue -trimpath --ldflags " |
|
|
|
go generate |
|
|
|
-X github.com/minio/minio/cmd.ReleaseTag=RELEASE.%{fullversion} |
|
|
|
go build -v -tags kqueue -trimpath --ldflags "-X github.com/minio/minio/cmd.ReleaseTag=RELEASE.%{fullversion} -X github.com/minio/minio/cmd.CommitID=$COMMIT -X github.com/minio/minio/cmd.ShortCommitID=$SHORTCOMMIT -X github.com/minio/minio/cmd.Version=%{version} -extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid %{version}" -o minio |
|
|
|
-X github.com/minio/minio/cmd.CommitID=$COMMIT |
|
|
|
|
|
|
|
-X github.com/minio/minio/cmd.ShortCommitID=$SHORTCOMMIT |
|
|
|
|
|
|
|
-X github.com/minio/minio/cmd.Version=%{version} |
|
|
|
|
|
|
|
-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') |
|
|
|
|
|
|
|
-buildid %{version}" -o minio |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install |
|
|
|
%install |
|
|
|
install -p -D -m 0555 src/github.com/minio/minio/minio %{buildroot}%{_bindir}/minio |
|
|
|
install -p -D -m 0555 go/src/github.com/minio/minio/minio %{buildroot}%{_bindir}/minio |
|
|
|
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/minio/server |
|
|
|
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/minio/server |
|
|
|
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/minio/gateway |
|
|
|
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/minio/gateway |
|
|
|
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/minio-server.service |
|
|
|
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/minio-server.service |
|
|
@ -108,7 +104,7 @@ exit 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%check |
|
|
|
%check |
|
|
|
cd src/github.com/minio/minio |
|
|
|
cd go/src/github.com/minio/minio |
|
|
|
./minio --version | tee v |
|
|
|
./minio --version | tee v |
|
|
|
v=$(awk '/version/{print $3}' v) |
|
|
|
v=$(awk '/version/{print $3}' v) |
|
|
|
test "$v" = RELEASE.%{fullversion} |
|
|
|
test "$v" = RELEASE.%{fullversion} |
|
|
|