# Generated by go2rpm 1.5.0 %bcond_without check %if 0%{?epel} %bcond_without bundled %endif # Redefine macros for EPEL %if 0%{?epel} %global gobuilddir %{_builddir}/%{name}-%{version}/_build %global gourl https://%{goipath} %global gosource %{gourl}/archive/v%{version}/%{name}-%{version}.tar.gz %define gobuild(o:) %{expand: # https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 %global _dwz_low_mem_die_limit 0 %ifnarch ppc64 go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}' -compressdwarf=false" -a -v -x %{?**}; %else go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}' -compressdwarf=false" -a -v -x %{?**}; %endif } %define goprep(:) %{expand: if [[ ! -e "%{gobuilddir}/bin" ]] ; then install -m 0755 -vd "%{gobuilddir}/bin" export GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}/usr/share/gocode" fi if [[ ! -e "%{gobuilddir}/src/%{goipath}" ]] ; then install -m 0755 -vd "$(dirname %{gobuilddir}/src/%{goipath})" ln -fs "%{_builddir}/%{name}-%{version}" "%{gobuilddir}/src/%{goipath}" fi } %endif # https://github.com/genuinetools/reg %global goipath github.com/genuinetools/reg Version: 0.16.1 %if !0%{?epel} %gometa %endif %global common_description %{expand: Docker registry v2 command line client and repo listing generator with security checks.} %global golicenses LICENSE %global godocs VERSION.txt README.md Name: reg Release: 5%{?dist} Summary: Docker registry v2 command line client License: MIT URL: %{gourl} Source0: %{gosource} # Upstream advertises this as something that's meant to be run in a container # and doesn't provide a systemd unit or sysV init script or sysconfig files # so I'm providing them here. Source1: reg-server.service Source2: sysconfig.reg-server # https://github.com/genuinetools/reg/pull/200 Patch0: fix-row-cell-index-for-server-searching-feature.patch %if 0%{?epel} ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} %endif BuildRequires: systemd-rpm-macros %if %{without bundled} BuildRequires: golang(github.com/coreos/clair/api/v3/clairpb) BuildRequires: golang(github.com/docker/cli/cli/config) BuildRequires: golang(github.com/docker/cli/cli/config/types) BuildRequires: golang(github.com/docker/distribution) BuildRequires: golang(github.com/docker/distribution/manifest/manifestlist) BuildRequires: golang(github.com/docker/distribution/manifest/schema1) BuildRequires: golang(github.com/docker/distribution/manifest/schema2) 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/client) BuildRequires: golang(github.com/docker/docker/pkg/jsonmessage) BuildRequires: golang(github.com/docker/docker/pkg/term) BuildRequires: golang(github.com/genuinetools/pkg/cli) BuildRequires: golang(github.com/gorilla/mux) BuildRequires: golang(github.com/mitchellh/go-wordwrap) BuildRequires: golang(github.com/opencontainers/go-digest) BuildRequires: golang(github.com/peterhellberg/link) BuildRequires: golang(github.com/shurcooL/httpfs/html/vfstemplate) BuildRequires: golang(github.com/sirupsen/logrus) BuildRequires: golang(google.golang.org/grpc) %if %{with check} # Tests BuildRequires: golang(github.com/google/go-cmp/cmp) %endif %endif Obsoletes: reg-server < %{version} %description %{common_description} %prep %if 0%{?epel} %setup -q -n %{name}-%{version} %endif %goprep %patch0 -p1 %build # When vendoring, use Go modules %if %{with bundled} export GO111MODULE=on export GOFLAGS=-mod=vendor %endif %gobuild -o %{gobuilddir}/bin/reg %{goipath} %install # Install the binaries install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ # Install templates and static content mkdir -p %{buildroot}%{_sharedstatedir}/%{name}-server install -d server/templates/ %{buildroot}/%{_sharedstatedir}/%{name}-server/templates/ install -d server/static/ %{buildroot}%{_sharedstatedir}/%{name}-server/static/ cp -p -r server/templates/* %{buildroot}%{_sharedstatedir}/%{name}-server/templates/ cp -p -r server/static/* %{buildroot}%{_sharedstatedir}/%{name}-server/static/ # Install the systemd unit mkdir -p %{buildroot}%{_unitdir} install -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}-server.service # Install the sysconfig file mkdir -p %{buildroot}%{_sysconfdir}/sysconfig install -p -m 0640 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-server %post %systemd_post %{name}-server.service %preun %systemd_preun %{name}-server.service %postun %systemd_postun %{name}-server.service %files %doc README.md Dockerfile Makefile %license LICENSE %{_bindir}/%{name} %{_unitdir}/%{name}-server.service %config(noreplace) %{_sysconfdir}/sysconfig/%{name}-server %config(noreplace) %{_sharedstatedir}/%{name}-server/static/ %config(noreplace) %{_sharedstatedir}/%{name}-server/templates/ %changelog * Sun Sep 19 2021 Robert-André Mauchin - 0.16.1-5 - Fix vendoring for devel package - Make compatible with EPEL8 - Close: rhbz#1941017, rhbz#1933618 * Fri Jul 23 2021 Fedora Release Engineering - 0.16.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Tue Feb 23 2021 Mattia Verga - 0.16.1-3 - Use bundled modules for EPEL8 * Sun Feb 21 2021 Mattia Verga - 0.16.1-2 - Use modules from Fedora repository where possible * Sat Feb 20 2021 Mattia Verga - 0.16.1-1 - Update to 0.16.1 - Fix FTB in F34 - Make use of some Golang macros * Wed Jan 27 2021 Fedora Release Engineering - 0.15.5-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Wed Jul 29 2020 Fedora Release Engineering - 0.15.5-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Sun Jun 14 2020 Athos Ribeiro - 0.15.5-6 - Fix image search * Thu Apr 23 2020 Mattia Verga - 0.15.5-5 - Fix %%postun directive * Thu Jan 30 2020 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Fri Jul 26 2019 Fedora Release Engineering - 0.15.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sat Feb 02 2019 Fedora Release Engineering - 0.15.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Tue Oct 16 2018 Kevin Fenzi - 0.15.5-1 - Update to 0.15.5 * Thu Jul 26 2018 Kevin Fenzi - 0.15.4-1 - Update to 0.15.4. * Sat Jul 14 2018 Fedora Release Engineering - 0.4.1-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Fri Feb 09 2018 Fedora Release Engineering - 0.4.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Thu Aug 03 2017 Fedora Release Engineering - 0.4.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 0.4.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Thu Jun 29 2017 Adam Miller - 0.4.1-5 - Actually apply the patch for single-run execution * Thu Jun 29 2017 Adam Miller - 0.4.1-4 - Fix epel7 build * Tue Jun 27 2017 Adam Miller - 0.4.1-3 - Add patch to allow single-run execution of reg-server for static html generation * Mon Jun 19 2017 Adam Miller - 0.4.1-2 - Add ghost file entry for statically generated index.html * Mon Jun 12 2017 Adam Miller - 0.4.1-1 - Update to latest upstream - Switch to using upstream versioning, they are tagging versions now. * Tue Mar 21 2017 Adam Miller - 0.2.0-2.git.0.94d0af5 - Move static/templates and systemd workingdir to /var/lib/reg-server - Change Source0 to point to github archive url instead of local git-archive - Fix tabs vs spaces in the spec file * Tue Mar 14 2017 Adam Miller - 0.2.0-1.git.0.94d0af5 - First package for Fedora