#debuginfo not supported with Go %global debug_package %{nil} # modifying the Go binaries breaks the DWARF debugging %global __os_install_post %{_rpmconfigdir}/brp-compress %global gopath %{_datadir}/gocode %global import_path github.com/openshift/source-to-image %global ldflags -X github.com/openshift/source-to-image/pkg/version.majorFromGit=1 -X github.com/openshift/source-to-image/pkg/version.minorFromGit=0+ -X github.com/openshift/source-to-image/pkg/version.versionFromGit=v1.0.8-dirty -X github.com/openshift/source-to-image/pkg/version.commitFromGit=c99ef8b %global commit c99ef8b29e94bdaf62d5d5aefa74d12af6d37e3 # docker_version is the version of docker requires by packages %global docker_version 1.6 Name: source-to-image Version: 1.0.8 Release: 3%{?dist} Summary: a tool (s2i) for building reproducible Docker images License: ASL 2.0 URL: https://github.com/openshift/%{name} ExclusiveArch: %{go_arches} Source0: https://%{import_path}/archive/v%{version}.tar.gz BuildRequires: systemd BuildRequires: golang >= 1.4 Requires: docker >= %{docker_version} Requires: iptables # # These are defined as per: # https://fedoraproject.org/wiki/Packaging:Guidelines#Bundling_and_Duplication_of_system_libraries # Provides: bundled(golang(github.com/cpuguy83/go-md2man/md2man)) = 71acacd42f85e5e82f70a55327789582a5200a90 Provides: bundled(golang(github.com/docker/docker/builder/command)) = 0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d Provides: bundled(golang(github.com/docker/docker/builder/parser)) = 0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d Provides: bundled(golang(github.com/fsouza/go-dockerclient)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/longpath)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/promise)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/docker/go-units)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/golang.org/x/net/context)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix)) = 0099401a7342ad77e71ca9f9a57c5e72fb80f6b2 Provides: bundled(golang(github.com/golang/glog)) = d1c4472bf2efd3826f2b5bdcc02d8416798d678c Provides: bundled(golang(github.com/russross/blackfriday)) = 8cec3a854e68dba10faabbe31c089abf4a3e57a6 Provides: bundled(golang(github.com/shurcooL/sanitized_anchor_name)) = 244f5ac324cb97e1987ef901a0081a77bfd8e845 Provides: bundled(golang(github.com/spf13/cobra)) = d732ab3a34e6e9e6b5bdac80707c2b6bad852936 Provides: bundled(golang(github.com/spf13/pflag)) = b084184666e02084b8ccb9b704bf0d79c466eb1d Provides: bundled(golang(github.com/inconshreveable/mousetrap)) = 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 %description Source-to-image (s2i) is a tool for building reproducible Docker images. s2i produces ready-to-run images by injecting source code into a Docker image and assembling a new Docker image which incorporates the builder image and built source. The result is then ready to use with docker run. s2i supports incremental builds which re-use previously downloaded dependencies, previously built artifacts, etc. %prep %setup -q -n %{name}-%{version} %build # Gaming the GOPATH because bundled libs in golang mkdir _build pushd _build mkdir -p src/github.com/openshift ln -s $(dirs +1 -l) src/%{import_path} popd mkdir _thirdpartylibs pushd _thirdpartylibs ln -s \ $(dirs +1 -l)/Godeps/_workspace/src/ \ src popd export GOPATH=$(pwd)/_build:$(pwd)/_thirdpartylibs:%{buildroot}%{gopath}:%{gopath} for cmd in s2i do go install -ldflags "%{ldflags}" %{import_path}/cmd/${cmd} done %install install -d -m 755 %{buildroot}%{_bindir} # Install components for bin in s2i do echo "+++ INSTALLING ${bin}" install -p -m 755 _build/bin/${bin} %{buildroot}%{_bindir}/${bin} done install -d -m 755 %{buildroot}%{_sysconfdir}/bash_completion.d install -p -m 644 contrib/bash/s2i %{buildroot}%{_sysconfdir}/bash_completion.d/s2i %check go test %files %doc README.md CONTRIBUTING.md AUTHORS docs/* %license LICENSE %{_bindir}/s2i %{_sysconfdir}/bash_completion.d/s2i %changelog * Thu May 05 2016 Adam Miller - 1.0.8-3 - Set ExclusiveArch correctly * Thu May 05 2016 Adam Miller - 1.0.8-2 - Add docs to docdir * Wed May 04 2016 Adam Miller - 1.0.8-1 - First package build