#3 Update to v1.3.1
Merged 3 years ago by yselkowitz. Opened 3 years ago by yselkowitz.
rpms/ yselkowitz/source-to-image rawhide  into  rawhide

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- /source-to-image-226afa1.tar.gz

+ /source-to-image-*.tar.gz

file modified
+73 -212
@@ -1,237 +1,103 @@ 

- %if 0%{?fedora} || 0%{?rhel} == 6

- %global with_devel 1

- %global with_bundled 1

- %global with_debug 0

- %global with_check 1

- %global with_unit_test 1

- %else

+ # github.com/containers/image/v5 is not yet packaged

  %global with_devel 0

  %global with_bundled 1

- %global with_debug 0

- %global with_check 0

- %global with_unit_test 0

- %endif

  

- %if 0%{?with_debug}

- %global _dwz_low_mem_die_limit 0

- %else

- %global debug_package   %{nil}

- %endif

+ %global goipath github.com/openshift/source-to-image

+ Version:        1.3.1

  

- %if ! 0%{?gobuild:1}

- %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};

- %endif

+ %gometa

  

- %global provider        github

- %global provider_tld    com

- %global project         openshift

- %global repo            source-to-image

- # https://github.com/openshift/source-to-image

- %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}

- %global import_path     %{provider_prefix}

- %global commit          226afa1319c3498f47b974ec8ceb36526341a19c

- %global shortcommit     %(c=%{commit}; echo ${c:0:7})

- 

- %global majorFromGit    1

- %global minorFromGit    0+

- %global versionFromGit  v1.0.9

- %global commitFromGit   %{commit}

- 

- 

- Name:           %{repo}

- Version:        1.1.7

- Release:        9%{?dist}

+ %global common_description %{expand:

+ Source-to-Image (S2I) is a toolkit and workflow for building reproducible 

+ container images from source code. S2I produces ready-to-run images by 

+ injecting source code into a container image and letting the container prepare 

+ that source code for execution. By creating self-assembling builder images, 

+ you can version and control your build environments exactly like you use 

+ container images to version your runtime environments.}

+ 

+ %global golicenses LICENSE

+ 

+ Name:           source-to-image

+ Release:        1%{?dist}

  Summary:        A tool for building artifacts from source and injecting into docker images

  License:        ASL 2.0

- URL:            https://%{provider_prefix}

- Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz

- 

- # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required

- ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}

- # there is no docker on ppc64, only on ppc64le

- # https://bugzilla.redhat.com/show_bug.cgi?id=1465159

- ExcludeArch: ppc64

- # If go_compiler is not set to 1, there is no virtual provide. Use golang instead.

- BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}

+ URL:            %{gourl}

+ Source0:        %{gosource}

  

- %if ! 0%{?with_bundled}

- BuildRequires: golang(github.com/golang/glog)

- BuildRequires: golang(github.com/spf13/cobra)

- BuildRequires: golang(github.com/spf13/pflag)

+ # for github.com/containers/storage, a dependency of github.com/containers/image/v5

+ %if 0%{?fedora}

+ BuildRequires:  btrfs-progs-devel

  %endif

- 

- Requires:      docker

+ BuildRequires:  device-mapper-devel

+ %if ! 0%{?with_bundled}

+ #BuildRequires:  golang(github.com/containers/image/v5/transports/alltransports)

+ #BuildRequires:  golang(github.com/containers/image/v5/types)

+ BuildRequires:  golang(github.com/docker/distribution/reference)

+ BuildRequires:  golang(github.com/docker/docker/api/types)

+ BuildRequires:  golang(github.com/docker/docker/api/types/container)

+ BuildRequires:  golang(github.com/docker/docker/api/types/network)

+ BuildRequires:  golang(github.com/docker/docker/api/types/strslice)

+ BuildRequires:  golang(github.com/docker/docker/cli/config)

+ BuildRequires:  golang(github.com/docker/docker/client)

+ BuildRequires:  golang(github.com/docker/docker/pkg/jsonmessage)

+ BuildRequires:  golang(github.com/docker/docker/pkg/stdcopy)

+ BuildRequires:  golang(github.com/docker/go-connections/tlsconfig)

+ BuildRequires:  golang(github.com/moby/buildkit/frontend/dockerfile/parser)

+ BuildRequires:  golang(github.com/spf13/cobra)

+ BuildRequires:  golang(github.com/spf13/pflag)

+ BuildRequires:  golang(golang.org/x/net/context)

+ BuildRequires:  golang(k8s.io/klog/v2)

+ %endif

+ # for tests

+ BuildRequires:  git-core

+ %if ! 0%{?with_devel}

+ Obsoletes: %{name}-devel < %{version}-%{release}

+ Obsoletes: %{name}-unit-test < %{version}-%{release}

+ %endif

+ 

+ Recommends:    docker

  Requires:      git

  Requires:      tar

  

  Provides:      s2i = %{version}-%{release}

  

  %description

- %{summary}

+ %{common_description}

  

  %if 0%{?with_devel}

- %package devel

- Summary:       %{summary}

- BuildArch:     noarch

- 

- %if 0%{?with_check}

- BuildRequires: golang(github.com/golang/glog)

- BuildRequires: golang(github.com/spf13/cobra)

- BuildRequires: golang(github.com/spf13/pflag)

- %endif

- 

- Requires:      golang(github.com/golang/glog)

- Requires:      golang(github.com/spf13/cobra)

- Requires:      golang(github.com/spf13/pflag)

- 

- Provides:      golang(%{import_path}) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/api) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/api/describe) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/api/validation) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/build) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/build/ignore) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/build/strategies) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/build/strategies/layered) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/build/strategies/onbuild) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/build/strategies/sti) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/cmd) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/config) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/create) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/create/templates) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/docker) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/docker/test) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/errors) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/ignore) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/run) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/scm) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/scm/empty) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/scm/file) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/scm/git) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/scripts) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/tar) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/test) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/util) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/util/user) = %{version}-%{release}

- Provides:      golang(%{import_path}/pkg/version) = %{version}-%{release}

- Provides:      golang(%{import_path}/test/integration) = %{version}-%{release}

- 

- %description devel

- %{summary}

- 

- This package contains library source intended for

- building other packages which use import path with

- %{import_path} prefix.

- %endif

- 

- %if 0%{?with_unit_test} && 0%{?with_devel}

- %package unit-test

- Summary:         Unit tests for %{name} package

- # If go_compiler is not set to 1, there is no virtual provide. Use golang instead.

- # If go_compiler is not set to 1, there is no virtual provide. Use golang instead.

- BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}

- 

- %if 0%{?with_check}

- #Here comes all BuildRequires: PACKAGE the unit tests

- #in %%check section need for running

- %endif

+ %godevelpkg

  

- # test subpackage tests code from devel subpackage

- Requires:        %{name}-devel = %{version}-%{release}

- 

- %description unit-test

- %{summary}

- 

- This package contains unit tests for project

- providing packages with %{import_path} prefix.

+ Provides: %{name}-devel = %{version}-%{release}

+ Provides: %{name}-unit-test = %{version}-%{release}

+ Obsoletes: %{name}-devel < %{version}-%{release}

+ Obsoletes: %{name}-unit-test < %{version}-%{release}

  %endif

  

  %prep

- %setup -q -n %{repo}-%{commit}

- 

- %build

- mkdir -p src/github.com/openshift

- ln -s ../../../ src/github.com/openshift/source-to-image

- 

- %if ! 0%{?with_bundled}

- export GOPATH=$(pwd):%{gopath}

+ %if 0%{?with_bundled}

+ %goprep -k

  %else

- export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath}

+ %goprep

  %endif

  

- export STI_GIT_MAJOR=1.0

- export STI_GIT_MINOR=2

- export STI_GIT_VERSION=%{commit}

- 

- export LDFLAGS="\

- 	-X %{import_path}/pkg/version.majorFromGit=%{majorFromGit} \

- 	-X %{import_path}/pkg/version.minorFromGit=%{minorFromGit} \

- 	-X %{import_path}/pkg/version.versionFromGit=%{versionFromGit} \

- 	-X %{import_path}/pkg/version.commitFromGit=%{commitFromGit}"

- %gobuild -o bin/s2i %{import_path}/cmd/s2i

+ %build

+ %if 0%{?rhel}

+ export BUILDTAGS="$BUILDTAGS exclude_graphdriver_btrfs "

+ %endif

+ export LDFLAGS="$LDFLAGS -X %{goipath}/pkg/version.versionFromGit=v%{version} "

+ %gobuild -o %{gobuilddir}/bin/s2i %{goipath}/cmd/s2i

  

  %install

  install -d -p %{buildroot}%{_bindir}

- install -p -m 0755 bin/s2i %{buildroot}%{_bindir}

- 

- # source codes for building projects

- %if 0%{?with_devel}

- install -d -p %{buildroot}/%{gopath}/src/%{import_path}/

- echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list

- # find all *.go but no *_test.go files and generate devel.file-list

- for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do

-     echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list

-     install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)

-     cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file

-     echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list

- done

- %endif

- 

- # testing files for this project

- %if 0%{?with_unit_test} && 0%{?with_devel}

- install -d -p %{buildroot}/%{gopath}/src/%{import_path}/

- # find all *_test.go files and generate unit-test.file-list

- for file in $(find . -iname "*_test.go"); do

-     echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list

-     install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)

-     cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file

-     echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list

- done

- %endif

+ install -p -m 0755 %{gobuilddir}/bin/s2i %{buildroot}%{_bindir}

  

  %if 0%{?with_devel}

- sort -u -o devel.file-list devel.file-list

+ %godevelinstall

  %endif

  

  %check

- %if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}

- %if ! 0%{?with_bundled}

- export GOPATH=%{buildroot}/%{gopath}:%{gopath}

- %else

- export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}

- %endif

- 

- %if ! 0%{?gotest:1}

- %global gotest go test

- %endif

- 

- %gotest %{import_path}/pkg/api

- %gotest %{import_path}/pkg/api/validation

- %gotest %{import_path}/pkg/build/strategies/layered

- %gotest %{import_path}/pkg/build/strategies/onbuild

- %gotest %{import_path}/pkg/build/strategies/sti

- %gotest %{import_path}/pkg/docker

- %gotest %{import_path}/pkg/ignore

- #%%gotest %%{import_path}/pkg/scm

- #%gotest %{import_path}/pkg/scm/git

- %gotest %{import_path}/pkg/scripts

- %gotest %{import_path}/pkg/tar

- %gotest %{import_path}/pkg/util

- %gotest %{import_path}/pkg/util/user

- %gotest %{import_path}/test/integration

- %endif

- 

- #define license tag if not already defined

- %{!?_licensedir:%global license %doc}

+ export LDFLAGS="$LDFLAGS -X %{goipath}/pkg/version.versionFromGit=v%{version} "

+ %gocheck -d pkg/docker

  

  %files

  %license LICENSE
@@ -239,19 +105,14 @@ 

  %{_bindir}/s2i

  

  %if 0%{?with_devel}

- %files devel -f devel.file-list

- %license LICENSE

- %doc README.md CONTRIBUTING.md AUTHORS

- %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}

- %endif

- 

- %if 0%{?with_unit_test} && 0%{?with_devel}

- %files unit-test -f unit-test.file-list

- %license LICENSE

- %doc README.md CONTRIBUTING.md AUTHORS

+ %gopkgfiles

  %endif

  

  %changelog

+ * Mon Feb 22 2021 Yaakov Selkowitz <yselkowi@redhat.com> - 1.3.1-1

+ - Update to v1.3.1

+ - Overhaul to conform to Go packaging guidelines

+ 

  * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.7-9

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (source-to-image-226afa1.tar.gz) = b1e7d05af5992cfcdd7886304c8d9f14b051d97e4721cda69279ce7508b958299231f0e0de30f6ecc84c0ea32592125c327dbbb5bbb85412aefb40588e6d021b

+ SHA512 (source-to-image-1.3.1.tar.gz) = 797568839ee4b7e9c8330b0074c4a86b77a86739d5d1153ce9d33f81c82b49534cedfc4a844785d9c5539b0e9780f5a4c287869357e079da0e9f86effa7ea910

Overhaul to conform to Go packaging guidelines

Due to lack of golang-github-containers-image, this would need to be built with bundled dependencies and without a -devel package (which AFAICS is currently unused).

Pull-Request has been merged by yselkowitz

3 years ago