1f2fd3
%if 0%{?fedora} || 0%{?rhel} == 6
1f2fd3
%global with_devel 0
1f2fd3
%global with_bundled 1
1f2fd3
%global with_debug 1
1f2fd3
%global with_check 0
1f2fd3
%global with_unit_test 0
1f2fd3
%else
1f2fd3
%global with_devel 0
1f2fd3
%global with_bundled 1
1f2fd3
%global with_debug 1
1f2fd3
%global with_check 0
1f2fd3
%global with_unit_test 0
1f2fd3
%endif
1f2fd3
1f2fd3
#%if 0%{?with_debug}
1f2fd3
#%global _dwz_low_mem_die_limit 0
1f2fd3
#%else
1f2fd3
%global debug_package   %{nil}
1f2fd3
#%endif
1f2fd3
1f2fd3
%global provider        github
1f2fd3
%global provider_tld    com
1f2fd3
%global project         projectatomic
1f2fd3
%global repo            skopeo
1f2fd3
# https://github.com/projectatomic/skopeo
1f2fd3
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
1f2fd3
%global import_path     %{provider_prefix}
06ee43
%global commit          1f655f3f0910a87f844a0ada49eada23ad9fca03
1f2fd3
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
1f2fd3
1f2fd3
Name:           skopeo
1f2fd3
Epoch:          1
06ee43
Version:        0.1.17
06ee43
Release:        0.7.git%{shortcommit}%{?dist}
1f2fd3
Summary:        Inspect Docker images and repositories on registries
1f2fd3
License:        ASL 2.0
1f2fd3
URL:            https://%{provider_prefix}
06ee43
Source0:        https://github.com/projectatomic/skopeo/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
1f2fd3
1f2fd3
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
1f2fd3
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
1f2fd3
BuildRequires:  git
1f2fd3
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
1f2fd3
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} >= 1.6.2
1f2fd3
BuildRequires:  go-md2man
1f2fd3
BuildRequires:  gpgme-devel
1f2fd3
BuildRequires:  libassuan-devel
06ee43
Requires: %{repo}-containers = %{epoch}:%{version}-%{release}
1f2fd3
1f2fd3
%description
1f2fd3
Command line utility to inspect images and repositories directly on Docker
1f2fd3
registries without the need to pull them
1f2fd3
1f2fd3
%if 0%{?with_devel}
1f2fd3
%package devel
1f2fd3
Summary:       %{summary}
1f2fd3
BuildArch:     noarch
1f2fd3
1f2fd3
%if 0%{?with_check} && ! 0%{?with_bundled}
1f2fd3
BuildRequires: golang(github.com/Azure/go-ansiterm/winterm)
1f2fd3
BuildRequires: golang(github.com/Sirupsen/logrus)
1f2fd3
BuildRequires: golang(github.com/docker/distribution)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/context)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/digest)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/manifest)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/manifest/manifestlist)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/manifest/schema1)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/manifest/schema2)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/reference)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/registry/api/errcode)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/registry/api/v2)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/registry/client)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/registry/client/auth)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/registry/client/transport)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/registry/storage/cache)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/registry/storage/cache/memory)
1f2fd3
BuildRequires: golang(github.com/docker/distribution/uuid)
1f2fd3
BuildRequires: golang(github.com/docker/docker/api)
1f2fd3
BuildRequires: golang(github.com/docker/docker/daemon/graphdriver)
1f2fd3
BuildRequires: golang(github.com/docker/docker/distribution/metadata)
1f2fd3
BuildRequires: golang(github.com/docker/docker/distribution/xfer)
1f2fd3
BuildRequires: golang(github.com/docker/docker/dockerversion)
1f2fd3
BuildRequires: golang(github.com/docker/docker/image)
1f2fd3
BuildRequires: golang(github.com/docker/docker/image/v1)
1f2fd3
BuildRequires: golang(github.com/docker/docker/layer)
1f2fd3
BuildRequires: golang(github.com/docker/docker/opts)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/archive)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/chrootarchive)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/fileutils)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/homedir)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/httputils)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/idtools)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/ioutils)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/jsonlog)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/jsonmessage)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/longpath)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/mflag)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/parsers/kernel)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/plugins)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/pools)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/progress)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/promise)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/random)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/reexec)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/stringid)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/system)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/tarsum)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/term)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/term/windows)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/useragent)
1f2fd3
BuildRequires: golang(github.com/docker/docker/pkg/version)
1f2fd3
BuildRequires: golang(github.com/docker/docker/reference)
1f2fd3
BuildRequires: golang(github.com/docker/docker/registry)
1f2fd3
BuildRequires: golang(github.com/docker/engine-api/types)
1f2fd3
BuildRequires: golang(github.com/docker/engine-api/types/blkiodev)
1f2fd3
BuildRequires: golang(github.com/docker/engine-api/types/container)
1f2fd3
BuildRequires: golang(github.com/docker/engine-api/types/filters)
1f2fd3
BuildRequires: golang(github.com/docker/engine-api/types/image)
1f2fd3
BuildRequires: golang(github.com/docker/engine-api/types/network)
1f2fd3
BuildRequires: golang(github.com/docker/engine-api/types/registry)
1f2fd3
BuildRequires: golang(github.com/docker/engine-api/types/strslice)
1f2fd3
BuildRequires: golang(github.com/docker/go-connections/nat)
1f2fd3
BuildRequires: golang(github.com/docker/go-connections/tlsconfig)
1f2fd3
BuildRequires: golang(github.com/docker/go-units)
1f2fd3
BuildRequires: golang(github.com/docker/libtrust)
1f2fd3
BuildRequires: golang(github.com/gorilla/context)
1f2fd3
BuildRequires: golang(github.com/gorilla/mux)
1f2fd3
BuildRequires: golang(github.com/opencontainers/runc/libcontainer/user)
1f2fd3
BuildRequires: golang(github.com/vbatts/tar-split/archive/tar)
1f2fd3
BuildRequires: golang(github.com/vbatts/tar-split/tar/asm)
1f2fd3
BuildRequires: golang(github.com/vbatts/tar-split/tar/storage)
1f2fd3
BuildRequires: golang(golang.org/x/net/context)
1f2fd3
%endif
1f2fd3
1f2fd3
%description devel
1f2fd3
%{summary}
1f2fd3
1f2fd3
This package contains library source intended for
1f2fd3
building other packages which use import path with
1f2fd3
%{import_path} prefix.
1f2fd3
%endif
1f2fd3
1f2fd3
%if 0%{?with_unit_test} && 0%{?with_devel}
1f2fd3
%package unit-test-devel
1f2fd3
Summary:         Unit tests for %{name} package
1f2fd3
%if 0%{?with_check}
1f2fd3
#Here comes all BuildRequires: PACKAGE the unit tests
1f2fd3
#in %%check section need for running
1f2fd3
%endif
1f2fd3
1f2fd3
# test subpackage tests code from devel subpackage
06ee43
Requires:        %{name}-devel = %{epoch}:%{version}-%{release}
1f2fd3
1f2fd3
%description unit-test-devel
1f2fd3
%{summary}
1f2fd3
1f2fd3
This package contains unit tests for project
1f2fd3
providing packages with %{import_path} prefix.
1f2fd3
%endif
1f2fd3
06ee43
%package containers
06ee43
Summary: Configuration files for working with image signature
06ee43
# /etc/containers/registries.d/default.yaml has been moved from atomic to
06ee43
# skopeo-containers
06ee43
Conflicts: atomic <= 1.13.1-1
06ee43
06ee43
%description containers
06ee43
This package installs a default signature store configuration
06ee43
policy under `/etc/containers/`.
06ee43
1f2fd3
%prep
1f2fd3
%autosetup -Sgit -n %{repo}-%{commit}
1f2fd3
1f2fd3
%build
1f2fd3
mkdir -p src/github.com/projectatomic
1f2fd3
ln -s ../../../ src/github.com/projectatomic/skopeo
1f2fd3
1f2fd3
mkdir -p vendor/src
1f2fd3
for v in vendor/*; do
1f2fd3
    if test ${v} = vendor/src; then continue; fi
1f2fd3
    if test -d ${v}; then
1f2fd3
	mv ${v} vendor/src/
1f2fd3
    fi
1f2fd3
done
1f2fd3
1f2fd3
%if ! 0%{?with_bundled}
1f2fd3
rm -rf vendor/
1f2fd3
export GOPATH=$(pwd):%{gopath}
1f2fd3
%else
1f2fd3
export GOPATH=$(pwd):$(pwd)/vendor:%{gopath}
1f2fd3
%endif
1f2fd3
1f2fd3
export GO15VENDOREXPERIMENT=1
1f2fd3
1f2fd3
%if ! 0%{?gobuild:1}
1f2fd3
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
1f2fd3
%endif
1f2fd3
1f2fd3
%gobuild -o skopeo ./cmd/skopeo
1f2fd3
1f2fd3
if test -f man/skopeo.1.md; then
1f2fd3
    go-md2man -in man/skopeo.1.md -out skopeo.1
1f2fd3
fi
1f2fd3
1f2fd3
%install
1f2fd3
mkdir -p %{buildroot}/%{_mandir}/man1
1f2fd3
make DESTDIR=%{buildroot} install
1f2fd3
1f2fd3
# source codes for building projects
1f2fd3
%if 0%{?with_devel}
1f2fd3
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
1f2fd3
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
1f2fd3
# find all *.go but no *_test.go files and generate devel.file-list
1f2fd3
for file in $(find . -iname "*.go" \! -iname "*_test.go" | grep -v "./vendor") ; do
1f2fd3
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
1f2fd3
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
1f2fd3
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
1f2fd3
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
1f2fd3
done
1f2fd3
%endif
1f2fd3
1f2fd3
# testing files for this project
1f2fd3
%if 0%{?with_unit_test} && 0%{?with_devel}
1f2fd3
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
1f2fd3
# find all *_test.go files and generate unit-test.file-list
1f2fd3
for file in $(find . -iname "*_test.go" | grep -v "./vendor"); do
1f2fd3
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
1f2fd3
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
1f2fd3
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
1f2fd3
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list
1f2fd3
done
1f2fd3
%endif
1f2fd3
1f2fd3
%if 0%{?with_devel}
1f2fd3
sort -u -o devel.file-list devel.file-list
1f2fd3
%endif
1f2fd3
1f2fd3
%check
1f2fd3
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
1f2fd3
%if ! 0%{?with_bundled}
1f2fd3
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
1f2fd3
%else
1f2fd3
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
1f2fd3
%endif
1f2fd3
1f2fd3
%gotest %{import_path}/integration
1f2fd3
%endif
1f2fd3
1f2fd3
#define license tag if not already defined
1f2fd3
%{!?_licensedir:%global license %doc}
1f2fd3
1f2fd3
%if 0%{?with_devel}
1f2fd3
%files devel -f devel.file-list
1f2fd3
%license LICENSE
1f2fd3
%doc README.md
1f2fd3
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
1f2fd3
%endif
1f2fd3
1f2fd3
%if 0%{?with_unit_test} && 0%{?with_devel}
1f2fd3
%files unit-test-devel -f unit-test-devel.file-list
1f2fd3
%license LICENSE
1f2fd3
%doc README.md
1f2fd3
%endif
1f2fd3
06ee43
%files containers
06ee43
%{_sysconfdir}/containers
06ee43
%config(noreplace) %{_sysconfdir}/containers/policy.json
06ee43
%config(noreplace) %{_sysconfdir}/containers/registries.d/default.yaml
06ee43
%dir %{_sysconfdir}/containers
06ee43
%dir %{_sysconfdir}/containers/registries.d
06ee43
%dir %{_sharedstatedir}/atomic/sigstore
06ee43
1f2fd3
%files
1f2fd3
%{_bindir}/skopeo
1f2fd3
%{_mandir}/man1/skopeo.1*
1f2fd3
%license LICENSE
1f2fd3
%doc README.md
afbf16
%{_datadir}/bash-completion/
1f2fd3
1f2fd3
%changelog
06ee43
* Tue Nov 22 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.17-0.7.git1f655f3
06ee43
- runtime dep was missing epoch value, added now
06ee43
06ee43
* Fri Nov 18 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.17-0.6.git1f655f3
06ee43
- Resolves: #1396531 - list skopeo runtime requirements correctly
06ee43
06ee43
* Mon Oct 31 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.17-0.5
06ee43
- built commit 1f655f3
06ee43
06ee43
* Tue Oct 18 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.17-0.4
06ee43
- Resolves: #1386386 - skopeo-containers conflicts with atomic <= 1.13.1-1
06ee43
- use correct bug number, #1385584 was for atomic
06ee43
06ee43
* Tue Oct 18 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.17-0.3
06ee43
- Resolves: #1385584 - skopeo-containers conflicts with atomic <= 1.13.1-1
06ee43
06ee43
* Mon Oct 17 2016 Frantisek Kluknavsky <fkluknav@redhat.com> - 1:0.1.17-0.2
06ee43
- obsoletes atomic, fixed dependencies
06ee43
- %{_sysconfdir}/containers/ owned only by skopeo-containers
06ee43
06ee43
* Fri Oct 14 2016 Frantisek Kluknavsky <fkluknav@redhat.com> - 1:0.1.17-0.1
06ee43
- rebase, skopeo-containers subpackage added
06ee43
afbf16
* Tue Sep 20 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.14-0.6
afbf16
- built mtrmac/integrate-all-the-things commit d830391
afbf16
afbf16
* Fri Sep 16 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.14-0.5
afbf16
- built mtrmac/integrate-all-the-things commit 85e4551
afbf16
afbf16
* Tue Sep 13 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.14-0.4
afbf16
- built mtrmac/integrate-all-the-things commit 02b9f8b
afbf16
afbf16
* Tue Sep 13 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.14-0.3
afbf16
- built mtrmac/integrate-all-the-things commit b3fcce0
afbf16
afbf16
* Tue Sep 06 2016 Frantisek Kluknavsky <fkluknav@redhat.com> - 1:0.1.14-0.2.dev
afbf16
- own the whole bash-completion dir (https://fedoraproject.org/wiki/Packaging:Guidelines)
afbf16
afbf16
* Tue Sep 06 2016 Frantisek Kluknavsky <fkluknav@redhat.com> - 1:0.1.14-0.1.dev
afbf16
- update to 0.1.14-dev
afbf16
1f2fd3
* Tue Jul 25 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.13-8
1f2fd3
- bump release, srpm issues in previous build
1f2fd3
1f2fd3
* Tue Jul 12 2016 Lokesh Mandvekar <lsm5@redhat.com> - 1:0.1.13-7
1f2fd3
- build with golang >= 1.6.2
1f2fd3
1f2fd3
* Fri Jun 24 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1:0.1.13-6
1f2fd3
- Bump Epoch to 1 since that's what skopeo had when it was an atomic
1f2fd3
subpackage
1f2fd3
1f2fd3
* Tue Jun 21 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.1.13-5
1f2fd3
- include go-srpm-macros and compiler(go-compiler) in fedora conditionals
1f2fd3
- define %%gobuild if not already
1f2fd3
- add patch to build with older version of golang
1f2fd3
1f2fd3
* Thu Jun 02 2016 Antonio Murdaca <runcom@fedoraproject.org> - 0.1.13-4
1f2fd3
- update to v0.1.12
1f2fd3
1f2fd3
* Tue May 31 2016 Antonio Murdaca <runcom@fedoraproject.org> - 0.1.12-3
1f2fd3
- fix go build source path
1f2fd3
1f2fd3
* Fri May 27 2016 Antonio Murdaca <runcom@fedoraproject.org> - 0.1.12-2
1f2fd3
- update to v0.1.12
1f2fd3
1f2fd3
* Tue Mar 08 2016 Antonio Murdaca <runcom@fedoraproject.org> - 0.1.11-1
1f2fd3
- update to v0.1.11
1f2fd3
1f2fd3
* Tue Mar 08 2016 Antonio Murdaca <runcom@fedoraproject.org> - 0.1.10-1
1f2fd3
- update to v0.1.10
1f2fd3
- change runcom -> projectatomic
1f2fd3
1f2fd3
* Mon Feb 29 2016 Antonio Murdaca <runcom@fedoraproject.org> - 0.1.9-1
1f2fd3
- update to v0.1.9
1f2fd3
1f2fd3
* Mon Feb 29 2016 Antonio Murdaca <runcom@fedoraproject.org> - 0.1.8-1
1f2fd3
- update to v0.1.8
1f2fd3
1f2fd3
* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.4-2
1f2fd3
- https://fedoraproject.org/wiki/Changes/golang1.6
1f2fd3
1f2fd3
* Fri Jan 29 2016 Antonio Murdaca <runcom@redhat.com> - 0.1.4
1f2fd3
- First package for Fedora