Blame SPECS/docker-distribution.spec

2e6314
%global with_debug 1
2e6314
43fe0e
%if 0%{?fedora} || 0%{?rhel} == 6
43fe0e
%global with_devel 1
43fe0e
%global with_bundled 0
43fe0e
%global with_check 1
43fe0e
%global with_unit_test 1
43fe0e
%else
43fe0e
%global with_devel 0
43fe0e
%global with_bundled 1
43fe0e
%global with_check 0
43fe0e
%global with_unit_test 0
43fe0e
%endif
43fe0e
43fe0e
%if 0%{?with_debug}
43fe0e
%global _dwz_low_mem_die_limit 0
43fe0e
%else
43fe0e
%global debug_package   %{nil}
43fe0e
%endif
43fe0e
43fe0e
%if ! 0%{?gobuild:1}
43fe0e
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
43fe0e
%endif
43fe0e
43fe0e
%if ! 0%{?gotest:1}
43fe0e
%define gotest() go test -ldflags "${LDFLAGS:-}" %{?**}
43fe0e
%endif
43fe0e
43fe0e
%global provider        github
43fe0e
%global provider_tld    com
43fe0e
%global project         docker
43fe0e
%global repo            distribution
43fe0e
# https://github.com/docker/distribution
43fe0e
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
43fe0e
%global import_path     %{provider_prefix}
43fe0e
%global commit0         48294d928ced5dd9b378f7fd7c6f5da3ff3f2c89
43fe0e
%global shortcommit0    %(c=%{commit0}; echo ${c:0:7})
43fe0e
43fe0e
Name:           %{project}-%{repo}
43fe0e
Version:        2.6.2
2e6314
Release:        2.git%{shortcommit0}%{?dist}
43fe0e
Summary:        Docker toolset to pack, ship, store, and deliver content
43fe0e
License:        ASL 2.0
43fe0e
URL:            https://%{provider_prefix}
43fe0e
Source0:        https://%{provider_prefix}/archive/%{commit0}.tar.gz
43fe0e
Source1:        %{name}.service
43fe0e
Source2:        config.yml
43fe0e
BuildRequires:  git
43fe0e
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} >= 1.6.2
43fe0e
BuildRequires:  systemd
43fe0e
Requires(post): systemd
43fe0e
Requires(preun): systemd
43fe0e
Requires(postun): systemd
43fe0e
Obsoletes:      docker-registry < 0.9.1-8
43fe0e
Provides:       docker-registry = %{version}-%{release}
43fe0e
43fe0e
43fe0e
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
43fe0e
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
43fe0e
43fe0e
%if ! 0%{?with_bundled}
43fe0e
BuildRequires: golang(github.com/AdRoll/goamz/aws)
43fe0e
BuildRequires: golang(github.com/AdRoll/goamz/cloudfront)
43fe0e
BuildRequires: golang(github.com/AdRoll/goamz/s3)
43fe0e
BuildRequires: golang(github.com/Azure/azure-sdk-for-go/storage)
43fe0e
BuildRequires: golang(github.com/Sirupsen/logrus)
43fe0e
BuildRequires: golang(github.com/Sirupsen/logrus/formatters/logstash)
43fe0e
BuildRequires: golang(github.com/bugsnag/bugsnag-go)
43fe0e
BuildRequires: golang(github.com/denverdino/aliyungo/oss)
43fe0e
BuildRequires: golang(github.com/docker/docker/pkg/tarsum)
43fe0e
BuildRequires: golang(github.com/docker/libtrust)
43fe0e
BuildRequires: golang(github.com/garyburd/redigo/redis)
43fe0e
BuildRequires: golang(github.com/gorilla/handlers)
43fe0e
BuildRequires: golang(github.com/gorilla/mux)
43fe0e
BuildRequires: golang(github.com/mitchellh/mapstructure)
43fe0e
BuildRequires: golang(github.com/ncw/swift)
43fe0e
BuildRequires: golang(github.com/ncw/swift/swifttest)
43fe0e
BuildRequires: golang(github.com/noahdesu/go-ceph/rados)
43fe0e
BuildRequires: golang(github.com/stevvooe/resumable)
43fe0e
BuildRequires: golang(github.com/stevvooe/resumable/sha256)
43fe0e
BuildRequires: golang(github.com/stevvooe/resumable/sha512)
43fe0e
BuildRequires: golang(github.com/yvasiyarov/gorelic)
43fe0e
BuildRequires: golang(golang.org/x/crypto/bcrypt)
43fe0e
BuildRequires: golang(golang.org/x/net/context)
43fe0e
BuildRequires: golang(gopkg.in/check.v1)
43fe0e
BuildRequires: golang(gopkg.in/yaml.v2)
43fe0e
%endif
43fe0e
43fe0e
%description
43fe0e
%{summary}
43fe0e
43fe0e
%if 0%{?with_devel}
43fe0e
%package devel
43fe0e
Summary:       %{summary}
43fe0e
BuildArch:     noarch
43fe0e
43fe0e
%if 0%{?with_check}
43fe0e
BuildRequires: golang(github.com/AdRoll/goamz/aws)
43fe0e
BuildRequires: golang(github.com/AdRoll/goamz/cloudfront)
43fe0e
BuildRequires: golang(github.com/AdRoll/goamz/s3)
43fe0e
BuildRequires: golang(github.com/Azure/azure-sdk-for-go/storage)
43fe0e
BuildRequires: golang(github.com/Sirupsen/logrus)
43fe0e
BuildRequires: golang(github.com/denverdino/aliyungo/oss)
43fe0e
BuildRequires: golang(github.com/docker/docker/pkg/tarsum)
43fe0e
BuildRequires: golang(github.com/docker/libtrust)
43fe0e
BuildRequires: golang(github.com/garyburd/redigo/redis)
43fe0e
BuildRequires: golang(github.com/gorilla/handlers)
43fe0e
BuildRequires: golang(github.com/gorilla/mux)
43fe0e
BuildRequires: golang(github.com/mitchellh/mapstructure)
43fe0e
BuildRequires: golang(github.com/ncw/swift)
43fe0e
BuildRequires: golang(github.com/ncw/swift/swifttest)
43fe0e
BuildRequires: golang(github.com/noahdesu/go-ceph/rados)
43fe0e
BuildRequires: golang(github.com/stevvooe/resumable)
43fe0e
BuildRequires: golang(github.com/stevvooe/resumable/sha256)
43fe0e
BuildRequires: golang(github.com/stevvooe/resumable/sha512)
43fe0e
BuildRequires: golang(golang.org/x/crypto/bcrypt)
43fe0e
BuildRequires: golang(golang.org/x/net/context)
43fe0e
BuildRequires: golang(gopkg.in/check.v1)
43fe0e
BuildRequires: golang(gopkg.in/yaml.v2)
43fe0e
%endif
43fe0e
43fe0e
Requires:      golang(github.com/AdRoll/goamz/aws)
43fe0e
Requires:      golang(github.com/AdRoll/goamz/cloudfront)
43fe0e
Requires:      golang(github.com/AdRoll/goamz/s3)
43fe0e
Requires:      golang(github.com/Azure/azure-sdk-for-go/storage)
43fe0e
Requires:      golang(github.com/Sirupsen/logrus)
43fe0e
Requires:      golang(github.com/denverdino/aliyungo/oss)
43fe0e
Requires:      golang(github.com/docker/docker/pkg/tarsum)
43fe0e
Requires:      golang(github.com/docker/libtrust)
43fe0e
Requires:      golang(github.com/garyburd/redigo/redis)
43fe0e
Requires:      golang(github.com/gorilla/handlers)
43fe0e
Requires:      golang(github.com/gorilla/mux)
43fe0e
Requires:      golang(github.com/mitchellh/mapstructure)
43fe0e
Requires:      golang(github.com/ncw/swift)
43fe0e
Requires:      golang(github.com/ncw/swift/swifttest)
43fe0e
Requires:      golang(github.com/noahdesu/go-ceph/rados)
43fe0e
Requires:      golang(github.com/stevvooe/resumable)
43fe0e
Requires:      golang(github.com/stevvooe/resumable/sha256)
43fe0e
Requires:      golang(github.com/stevvooe/resumable/sha512)
43fe0e
Requires:      golang(golang.org/x/crypto/bcrypt)
43fe0e
Requires:      golang(golang.org/x/net/context)
43fe0e
Requires:      golang(gopkg.in/check.v1)
43fe0e
Requires:      golang(gopkg.in/yaml.v2)
43fe0e
43fe0e
Provides:      golang-%{provider}-%{project}-%{repo}-devel = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/configuration) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/context) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/digest) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/health) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/health/api) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/health/checks) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/manifest) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/notifications) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/api/errcode) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/api/v2) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/auth) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/auth/htpasswd) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/auth/silly) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/auth/token) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/client) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/client/auth) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/client/transport) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/handlers) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/listener) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/middleware/registry) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/middleware/repository) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/proxy) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/proxy/scheduler) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/cache) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/cache/memory) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/cache/redis) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/azure) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/base) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/factory) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/filesystem) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/inmemory) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/middleware) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/middleware/cloudfront) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/oss) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/rados) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/s3) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/swift) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/registry/storage/driver/testsuites) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/testutil) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/uuid) = %{version}-%{release}
43fe0e
Provides:      golang(%{import_path}/version) = %{version}-%{release}
43fe0e
43fe0e
%description devel
43fe0e
%{summary}
43fe0e
43fe0e
This package contains library source intended for
43fe0e
building other packages which use import path with
43fe0e
%{import_path} prefix.
43fe0e
%endif
43fe0e
43fe0e
%if 0%{?with_unit_test} && 0%{?with_devel}
43fe0e
%package unit-test
43fe0e
Summary:         Unit tests for %{name} package
43fe0e
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
43fe0e
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} >= 1.6.2
43fe0e
43fe0e
%if 0%{?with_check}
43fe0e
#Here comes all BuildRequires: PACKAGE the unit tests
43fe0e
#in %%check section need for running
43fe0e
%endif
43fe0e
43fe0e
# test subpackage tests code from devel subpackage
43fe0e
Requires:        %{name}-devel = %{version}-%{release}
43fe0e
43fe0e
%description unit-test
43fe0e
%{summary}
43fe0e
43fe0e
This package contains unit tests for project
43fe0e
providing packages with %{import_path} prefix.
43fe0e
%endif
43fe0e
43fe0e
%prep
43fe0e
%autosetup -Sgit -n %{repo}-%{commit0}
43fe0e
43fe0e
pushd vendor
43fe0e
sed -i 's/elliptic.P224(), //' golang.org/x/crypto/ocsp/ocsp.go
43fe0e
mkdir src
43fe0e
mv g* src/.
43fe0e
popd
43fe0e
43fe0e
%build
43fe0e
mkdir _build
43fe0e
43fe0e
pushd _build
43fe0e
mkdir -p src/github.com/%{project}
43fe0e
ln -s $(dirs +1 -l) src/%{import_path}
43fe0e
popd
43fe0e
43fe0e
%if ! 0%{?with_bundled}
43fe0e
export GOPATH=$(pwd)/_build:%{gopath}
43fe0e
%else
43fe0e
export GOPATH=$(pwd)/_build:$(pwd)/vendor:%{gopath}
43fe0e
%endif
43fe0e
43fe0e
pushd _build/src/%{import_path}/cmd/registry
2e6314
%gobuild .
43fe0e
popd
43fe0e
43fe0e
%install
43fe0e
install -d -p %{buildroot}%{_bindir}
43fe0e
install -p -m 0755 cmd/registry/registry %{buildroot}%{_bindir}
43fe0e
43fe0e
# install systemd/init scripts
43fe0e
install -d %{buildroot}%{_unitdir}
43fe0e
install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
43fe0e
43fe0e
# install config file
43fe0e
install -dp %{buildroot}%{_sysconfdir}/%{name}/registry
43fe0e
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/registry
43fe0e
43fe0e
# install root dir
43fe0e
install -d %{buildroot}%{_sharedstatedir}/registry
43fe0e
43fe0e
# source code for building projects
43fe0e
%if 0%{?with_devel}
43fe0e
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
43fe0e
# find all *.go but no *_test.go files and generate devel.file-list
43fe0e
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
43fe0e
    echo "%dir %{gopath}/src/%{import_path}/$(dirname $file)" >> devel.file-list
43fe0e
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
43fe0e
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
43fe0e
    echo "%{gopath}/src/%{import_path}/$file" >> devel.file-list
43fe0e
done
43fe0e
%endif
43fe0e
43fe0e
# testing files for this project
43fe0e
%if 0%{?with_unit_test} && 0%{?with_devel}
43fe0e
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
43fe0e
# find all *_test.go files and generate unit-test.file-list
43fe0e
for file in $(find . -iname "*_test.go"); do
43fe0e
    echo "%dir %{gopath}/src/%{import_path}/$(dirname $file)" >> devel.file-list
43fe0e
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
43fe0e
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
43fe0e
    echo "%{gopath}/src/%{import_path}/$file" >> unit-test.file-list
43fe0e
done
43fe0e
%endif
43fe0e
43fe0e
%if 0%{?with_devel}
43fe0e
sort -u -o devel.file-list devel.file-list
43fe0e
%endif
43fe0e
43fe0e
%check
43fe0e
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
43fe0e
%if ! 0%{?with_bundled}
43fe0e
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
43fe0e
%else
43fe0e
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
43fe0e
%endif
43fe0e
make test
43fe0e
%endif
43fe0e
43fe0e
%pre
43fe0e
43fe0e
%post
43fe0e
%systemd_post %{name}.service
43fe0e
43fe0e
%preun
43fe0e
%systemd_preun %{name}.service
43fe0e
43fe0e
%postun
43fe0e
%systemd_postun_with_restart %{name}.service
43fe0e
43fe0e
#define license tag if not already defined
43fe0e
%{!?_licensedir:%global license %doc}
43fe0e
43fe0e
%files
43fe0e
%if 0%{?fedora} >= 23
43fe0e
%license LICENSE
43fe0e
%else
43fe0e
%doc LICENSE
43fe0e
%endif
43fe0e
%doc AUTHORS CONTRIBUTING.md MAINTAINERS README.md
43fe0e
%{_bindir}/registry
43fe0e
%{_unitdir}/%{name}.service
43fe0e
%dir %{_sharedstatedir}/registry
43fe0e
%config(noreplace) %{_sysconfdir}/%{name}/registry/config.yml
43fe0e
43fe0e
%if 0%{?with_devel}
43fe0e
%files devel -f devel.file-list
43fe0e
%license LICENSE
43fe0e
%doc CONTRIBUTING.md README.md ROADMAP.md AUTHORS
43fe0e
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
43fe0e
%dir %{gopath}/src/%{import_path}
43fe0e
%endif
43fe0e
43fe0e
%if 0%{?with_unit_test} && 0%{?with_devel}
43fe0e
%files unit-test -f unit-test.file-list
43fe0e
%license LICENSE
43fe0e
%doc CONTRIBUTING.md README.md ROADMAP.md AUTHORS
43fe0e
%endif
43fe0e
43fe0e
%changelog
2e6314
* Mon Apr 02 2018 Lokesh Mandvekar <lsm5@redhat.com> - 2.6.2-2.git48294d9
2e6314
- Resolves: #1528265 - correct unitfile error
2e6314
- enable debuginfo
2e6314
43fe0e
* Tue Aug 08 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2.6.2-1.git48294d9
43fe0e
- Resolves: #1474893 CVE-2017-11468, #1478282
43fe0e
- rebase to v2.6.2
43fe0e
43fe0e
* Fri May 05 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2.6.1-1.1.gita25b9ef
43fe0e
- rebase to v2.6.1
43fe0e
43fe0e
* Fri Mar 31 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2.6.0-1.1
43fe0e
- rebuild for all available arches on 7.4
43fe0e
43fe0e
* Mon Jan 23 2017 Frantisek Kluknavsky <fkluknav@redhat.com> - 2.6.0-1
43fe0e
- rebase to v2.6.0
43fe0e
43fe0e
* Mon Jan 09 2017 Frantisek Kluknavsky <fkluknav@redhat.com> - 2.5.1-2
43fe0e
- fix wrong obsoleting of docker-registry
43fe0e
43fe0e
* Mon Oct 24 2016 Frantisek Kluknavsky <fkluknav@redhat.com> - 2.5.1-1
43fe0e
- rebase to v2.5.1
43fe0e
43fe0e
* Wed Sep 07 2016 Lokesh Mandvekar <lsm5@redhat.com> - 2.5.0-1
43fe0e
- Resolves: #1367157 - rebase to v2.5.0
43fe0e
- golang 1.6.2 doesn't support elliptic.P224()
43fe0e
43fe0e
* Sat Jun 25 2016 Lokesh Mandvekar <lsm5@redhat.com> - 2.4.1-2
43fe0e
- built with golang >= 1.6.2
43fe0e
43fe0e
* Thu Apr 28 2016 Lokesh Mandvekar <lsm5@redhat.com> - 2.4.1-1
43fe0e
- Resolves: #1338871 - rebase to v2.4.1
43fe0e
- Resolves: #1338824 - s3 driver: Sorting completed parts by part number for
43fe0e
a better accordance with S3 spec (upstream PR# 1670)
43fe0e
43fe0e
* Thu Apr 28 2016 Lokesh Mandvekar <lsm5@redhat.com> - 2.4.0-2
43fe0e
- Resolves: #1330393 - update unitfile ExecStart
43fe0e
- From: Luwen Su <lsu@redhat.com>
43fe0e
43fe0e
* Tue Apr 19 2016 Lokesh Mandvekar <lsm5@redhat.com> - 2.4.0-1
43fe0e
- Resolves: rhbz#1328475 - rebase to v2.4.0
43fe0e
- Resolves: rhbz#1328526 - obsoletes docker-registry <= 0.9.1-7
43fe0e
43fe0e
* Tue Mar 08 2016 Lokesh Mandvekar <lsm5@redhat.com> - 2.3.1-1
43fe0e
- Resolves: rhbz#1315881 - rebase to v2.3.1
43fe0e
43fe0e
* Tue Jan 19 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2.2.1-1
43fe0e
- Resolves: rhbz#1299915 - rebase to v2.2.1
43fe0e
43fe0e
* Wed Oct 07 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2.1.1-3
43fe0e
- do not install sysconfig file
43fe0e
- Install root dir /var/lib/registry
43fe0e
43fe0e
* Tue Sep 22 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2.1.1-2
43fe0e
- systemd is a dep
43fe0e
43fe0e
* Tue Sep 22 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2.1.1-1
43fe0e
- Resolves: rhbz#1261613 (rhel 7.2) - initial package