File zypper-docker.spec of Package zypper-docker
#
# spec file for package zypper-docker
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define go_arches %ix86 x86_64
%ifarch %go_arches
%define go_tool go
%define GO_BUILD_FLAGS ""
%else
%define go_tool go-5
%define GO_BUILD_FLAGS "-gccgoflags=\"-static-libgo\""
%endif
%define version_unconverted 1.2.0
Name: zypper-docker
Version: 1.2.0
Release: 0
Summary: Easy patch and update solution for Docker images
License: Apache-2.0
Group: Development/Languages/Other
Url: https://github.com/SUSE/zypper-docker
Source0: %{name}-%{version}.tar.xz
Source42: zypper-docker-rpmlintrc
%ifarch %go_arches
BuildRequires: go >= 1.5
%else
BuildRequires: gcc5-go >= 5.0
%endif
Requires: libzypp > 9.34
BuildRequires: libzypp > 9.34
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExcludeArch: %ix86
%description
The zypper-docker command line tool provides a quick way to patch and update
Docker images based either on SUSE Linux Enterprise or openSUSE.
zypper-docker mimics zypper command line syntax to ease its usage.
zypper-docker relies on zypper to perform the actual operations against Docker images.
%prep
%setup -q
%build
export GOPATH=$PWD/go
mkdir -p $GOPATH/src/github.com/SUSE
# Copy the vendor directory into the GOPATH.
cp -r $PWD/vendor/* $GOPATH/src
ln -s $PWD $GOPATH/src/github.com/SUSE/zypper-docker
%go_tool build %GO_BUILD_FLAGS
# build man pages
cd man
%go_tool run generate.go
%check
export GOPATH=$PWD/go
%go_tool test -v
%install
%{__mkdir_p} %{buildroot}%{_bindir}
%{__install} -m755 zypper-docker-%{version} %{buildroot}%{_bindir}/zypper-docker
# install manpages
install -d %{buildroot}%{_mandir}/man1
install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1
%files
%defattr(-,root,root)
%doc README.md LICENSE
%{_bindir}/zypper-docker
%{_mandir}/man1/zypper-docker-*.1.gz
%{_mandir}/man1/zypper-docker.1.gz
%changelog