You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.5 KiB

%global _hardened_build 1
%define _user cicd
%define _group cicd
%define _varlib /var/lib/mvoci/
%define _logdir /var/log/cds/
Name: mvoci
Version: 20210924
Release: 1%{?dist}
Summary: My Very Own CI-server
License: GPLv3
URL: https://codeberg.org/snaums/mvoCI
BuildRequires: golang
#Requires:
%description
%prep
%setup -q -T -c %{name}-%{version}
mkdir -p go/src/codeberg.org/snaums/
cd go/src/codeberg.org/snaums/
git clone https://codeberg.org/snaums/mvoCI
%build
export GOPATH=`pwd`
export PATH=$PATH:$GOPATH/bin/:$GOBIN
export GO111MODULE=on
cd go/src/codeberg.org/snaums/mvoCI/
export CGO_ENABLED=0
export HASH=`git rev-list -1 HEAD`
export GOVERSION=`go version`
export DATE=`date +%Y%m%d`
#go build -gccgoflags "-pthread" -ldflags "-s -w -X 'codeberg.org/snaums/mvoCI/core.BuildTime="$DATE"' -X 'codeberg.org/snaums/mvoCI/core.Compiler="$GOVERSION"' -X 'codeberg.org/snaums/mvoCI/core.GitHash="$HASH"' -X 'codeberg.org/snaums/mvoCI/core.Version='"%{version}"'" -o mvoci main.go
go build -gccgoflags -ldflags "-s -w -X 'codeberg.org/snaums/mvoCI/core.BuildTime="$DATE"' -X 'codeberg.org/snaums/mvoCI/core.Compiler="$GOVERSION"' -X 'codeberg.org/snaums/mvoCI/core.GitHash="$HASH"' -X 'codeberg.org/snaums/mvoCI/core.Version='"%{version}"'" -o mvoci main.go
%install
mkdir -p %{buildroot}%{_varlib}
cp go/src/codeberg.org/snaums/mvoCI/mvoci %{buildroot}%{_varlib}
cp -rv go/src/codeberg.org/snaums/mvoCI/views %{buildroot}%{_varlib}
cp -rv go/src/codeberg.org/snaums/mvoCI/static %{buildroot}%{_varlib}
%files
%{_bindir}/mvoci
%changelog