Blame ignition.spec.orig

Andrew Jeddeloh c14ed2
# Original spec file as generated by:
Andrew Jeddeloh c14ed2
#     gofed repo2spec --detect github.com/coreos/ignition --commit f7079129b8651ac51dba14c3af65692bb413c1dd  --with-extra --with-build -f
Andrew Jeddeloh c14ed2
# With:
Andrew Jeddeloh c14ed2
#     gofed/gofed:v1.0.1 docker image
333e3f
333e3f
333e3f
# If any of the following macros should be set otherwise,
333e3f
# you can wrap any of them with the following conditions:
333e3f
# - %%if 0%%{centos} == 7
333e3f
# - %%if 0%%{?rhel} == 7
333e3f
# - %%if 0%%{?fedora} == 23
333e3f
# Or just test for particular distribution:
333e3f
# - %%if 0%%{centos}
333e3f
# - %%if 0%%{?rhel}
333e3f
# - %%if 0%%{?fedora}
333e3f
#
333e3f
# Be aware, on centos, both %%rhel and %%centos are set. If you want to test
333e3f
# rhel specific macros, you can use %%if 0%%{?rhel} && 0%%{?centos} == 0 condition.
333e3f
# (Don't forget to replace double percentage symbol with single one in order to apply a condition)
333e3f
333e3f
# Generate devel rpm
333e3f
%global with_devel 1
333e3f
# Build project from bundled dependencies
333e3f
%global with_bundled 0
333e3f
# Build with debug info rpm
333e3f
%global with_debug 1
333e3f
# Run tests in check section
333e3f
%global with_check 1
333e3f
# Generate unit-test rpm
333e3f
%global with_unit_test 1
333e3f
333e3f
%if 0%{?with_debug}
333e3f
%global _dwz_low_mem_die_limit 0
333e3f
%else
333e3f
%global debug_package   %{nil}
333e3f
%endif
333e3f
333e3f
%if ! 0%{?gobuild:1}
333e3f
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
333e3f
%endif
333e3f
333e3f
%global provider        github
333e3f
%global provider_tld    com
333e3f
%global project         coreos
333e3f
%global repo            ignition
333e3f
# https://github.com/coreos/ignition
333e3f
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
333e3f
%global import_path     %{provider_prefix}
Andrew Jeddeloh c14ed2
%global commit          f7079129b8651ac51dba14c3af65692bb413c1dd
333e3f
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
333e3f
333e3f
Name:           golang-%{provider}-%{project}-%{repo}
333e3f
Version:        0
333e3f
Release:        0.1.git%{shortcommit}%{?dist}
333e3f
Summary:        !!!!FILL!!!!
333e3f
# Detected licences
333e3f
# - Unknown at 'LICENSE'
333e3f
License:        !!!!FILL!!!!
333e3f
URL:            https://%{provider_prefix}
333e3f
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
333e3f
333e3f
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
333e3f
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
333e3f
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
333e3f
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
333e3f
333e3f
%if ! 0%{?with_bundled}
333e3f
# validate/main.go
333e3f
BuildRequires: golang(github.com/spf13/cobra)
333e3f
333e3f
# Remaining dependencies not included in main packages
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/vmware/vmw-ovflib)
333e3f
BuildRequires: golang(github.com/coreos/go-systemd/unit)
333e3f
BuildRequires: golang(github.com/coreos/go-semver/semver)
333e3f
BuildRequires: golang(github.com/sigma/vmw-guestinfo/vmcheck)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/pin/tftp)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3/s3manager)
333e3f
BuildRequires: golang(github.com/sigma/vmw-guestinfo/rpcvmx)
333e3f
BuildRequires: golang(github.com/coreos/go-systemd/dbus)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/session)
333e3f
BuildRequires: golang(github.com/vincent-petithory/dataurl)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/awserr)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)
333e3f
BuildRequires: golang(github.com/ajeddeloh/go-json)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/pborman/uuid)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/aws/aws-sdk-go/aws)
333e3f
%endif
333e3f
333e3f
%description
333e3f
%{summary}
333e3f
333e3f
%if 0%{?with_devel}
333e3f
%package devel
333e3f
Summary:       %{summary}
333e3f
BuildArch:     noarch
333e3f
333e3f
%if 0%{?with_check} && ! 0%{?with_bundled}
333e3f
BuildRequires: golang(github.com/ajeddeloh/go-json)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/awserr)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/session)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3/s3manager)
333e3f
BuildRequires: golang(github.com/coreos/go-semver/semver)
333e3f
BuildRequires: golang(github.com/coreos/go-systemd/dbus)
333e3f
BuildRequires: golang(github.com/coreos/go-systemd/unit)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/pborman/uuid)
333e3f
BuildRequires: golang(github.com/pin/tftp)
333e3f
BuildRequires: golang(github.com/sigma/vmw-guestinfo/rpcvmx)
333e3f
BuildRequires: golang(github.com/sigma/vmw-guestinfo/vmcheck)
333e3f
BuildRequires: golang(github.com/vincent-petithory/dataurl)
333e3f
BuildRequires: golang(github.com/vmware/vmw-ovflib)
333e3f
%endif
333e3f
333e3f
Requires:      golang(github.com/ajeddeloh/go-json)
333e3f
Requires:      golang(github.com/aws/aws-sdk-go/aws)
333e3f
Requires:      golang(github.com/aws/aws-sdk-go/aws/awserr)
333e3f
Requires:      golang(github.com/aws/aws-sdk-go/aws/credentials)
333e3f
Requires:      golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)
333e3f
Requires:      golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
333e3f
Requires:      golang(github.com/aws/aws-sdk-go/aws/session)
333e3f
Requires:      golang(github.com/aws/aws-sdk-go/service/s3)
333e3f
Requires:      golang(github.com/aws/aws-sdk-go/service/s3/s3manager)
333e3f
Requires:      golang(github.com/coreos/go-semver/semver)
333e3f
Requires:      golang(github.com/coreos/go-systemd/dbus)
333e3f
Requires:      golang(github.com/coreos/go-systemd/unit)
Andrew Jeddeloh c14ed2
Requires:      golang(github.com/pborman/uuid)
333e3f
Requires:      golang(github.com/pin/tftp)
333e3f
Requires:      golang(github.com/sigma/vmw-guestinfo/rpcvmx)
333e3f
Requires:      golang(github.com/sigma/vmw-guestinfo/vmcheck)
333e3f
Requires:      golang(github.com/vincent-petithory/dataurl)
333e3f
Requires:      golang(github.com/vmware/vmw-ovflib)
333e3f
333e3f
Provides:      golang(%{import_path}/config/shared) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/shared/errors) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/shared/validations) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/util) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v1) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v1/types) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_0) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_0/types) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_1) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_1/types) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_2) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_2/types) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_3_experimental) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_3_experimental/types) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/validate) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/validate/astjson) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/validate/astnode) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/validate/report) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/negative/files) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/negative/filesystems) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/negative/general) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/negative/networkd) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/negative/partitions) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/negative/regression) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/negative/security) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/negative/timeouts) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/files) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/filesystems) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/general) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/networkd) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/oem) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/partitions) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/passwd) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/regression) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/security) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/systemd) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/positive/timeouts) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/register) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/registry) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/tests/types) = %{version}-%{release}
333e3f
333e3f
%description devel
333e3f
%{summary}
333e3f
333e3f
This package contains library source intended for
333e3f
building other packages which use import path with
333e3f
%{import_path} prefix.
333e3f
%endif
333e3f
333e3f
%if 0%{?with_unit_test} && 0%{?with_devel}
333e3f
%package unit-test-devel
333e3f
Summary:         Unit tests for %{name} package
333e3f
%if 0%{?with_check}
333e3f
#Here comes all BuildRequires: PACKAGE the unit tests
333e3f
#in %%check section need for running
333e3f
%endif
333e3f
333e3f
# test subpackage tests code from devel subpackage
333e3f
Requires:        %{name}-devel = %{version}-%{release}
333e3f
333e3f
%if 0%{?with_check} && ! 0%{?with_bundled}
333e3f
BuildRequires: golang(github.com/stretchr/testify/assert)
333e3f
%endif
333e3f
333e3f
Requires:      golang(github.com/stretchr/testify/assert)
333e3f
333e3f
%description unit-test-devel
333e3f
%{summary}
333e3f
333e3f
This package contains unit tests for project
333e3f
providing packages with %{import_path} prefix.
333e3f
%endif
333e3f
333e3f
%prep
333e3f
%setup -q -n %{repo}-%{commit}
333e3f
333e3f
%build
333e3f
mkdir -p src/%{provider}.%{provider_tld}/%{project}
333e3f
ln -s ../../../ src/%{import_path}
333e3f
333e3f
%if ! 0%{?with_bundled}
333e3f
export GOPATH=$(pwd):%{gopath}
333e3f
%else
333e3f
# No dependency directories so far
333e3f
export GOPATH=$(pwd):%{gopath}
333e3f
%endif
333e3f
333e3f
#%gobuild -o bin/internal %{import_path}/internal
333e3f
#%gobuild -o bin/internal/util/tools/docs %{import_path}/internal/util/tools/docs
333e3f
#%gobuild -o bin/tests/stubs/id-stub %{import_path}/tests/stubs/id-stub
333e3f
#%gobuild -o bin/tests/stubs/useradd-stub %{import_path}/tests/stubs/useradd-stub
333e3f
#%gobuild -o bin/tests/stubs/usermod-stub %{import_path}/tests/stubs/usermod-stub
333e3f
#%gobuild -o bin/validate %{import_path}/validate
333e3f
333e3f
%install
333e3f
install -d -p %{buildroot}%{_bindir}
333e3f
#install -p -m 0755 bin/internal %{buildroot}%{_bindir}
333e3f
#install -p -m 0755 bin/internal/util/tools/docs %{buildroot}%{_bindir}
333e3f
#install -p -m 0755 bin/tests/stubs/id-stub %{buildroot}%{_bindir}
333e3f
#install -p -m 0755 bin/tests/stubs/useradd-stub %{buildroot}%{_bindir}
333e3f
#install -p -m 0755 bin/tests/stubs/usermod-stub %{buildroot}%{_bindir}
333e3f
#install -p -m 0755 bin/validate %{buildroot}%{_bindir}
333e3f
333e3f
# source codes for building projects
333e3f
%if 0%{?with_devel}
333e3f
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
333e3f
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
333e3f
# find all *.go but no *_test.go files and generate devel.file-list
333e3f
for file in $(find . \( -iname "*.go" -or -iname "*.s" \) \! -iname "*_test.go" | grep -v "vendor") ; do
333e3f
    dirprefix=$(dirname $file)
333e3f
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix
333e3f
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
333e3f
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
333e3f
333e3f
    while [ "$dirprefix" != "." ]; do
333e3f
        echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list
333e3f
        dirprefix=$(dirname $dirprefix)
333e3f
    done
333e3f
done
333e3f
%endif
333e3f
333e3f
# testing files for this project
333e3f
%if 0%{?with_unit_test} && 0%{?with_devel}
333e3f
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
333e3f
# find all *_test.go files and generate unit-test-devel.file-list
333e3f
for file in $(find . -iname "*_test.go" | grep -v "vendor") ; do
333e3f
    dirprefix=$(dirname $file)
333e3f
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix
333e3f
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
333e3f
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list
333e3f
333e3f
    while [ "$dirprefix" != "." ]; do
333e3f
        echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list
333e3f
        dirprefix=$(dirname $dirprefix)
333e3f
    done
333e3f
done
333e3f
%endif
333e3f
333e3f
%if 0%{?with_devel}
333e3f
sort -u -o devel.file-list devel.file-list
333e3f
%endif
333e3f
333e3f
%check
333e3f
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
333e3f
%if ! 0%{?with_bundled}
333e3f
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
333e3f
%else
333e3f
# Since we aren't packaging up the vendor directory we need to link
333e3f
# back to it somehow. Hack it up so that we can add the vendor
333e3f
# directory from BUILD dir as a gopath to be searched when executing
333e3f
# tests from the BUILDROOT dir.
333e3f
ln -s ./ ./vendor/src # ./vendor/src -> ./vendor
333e3f
333e3f
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
333e3f
%endif
333e3f
333e3f
%if ! 0%{?gotest:1}
333e3f
%global gotest go test
333e3f
%endif
333e3f
333e3f
%gotest %{import_path}/config/v1
333e3f
%gotest %{import_path}/config/v1/types
333e3f
%gotest %{import_path}/config/v2_0
333e3f
%gotest %{import_path}/config/v2_0/types
333e3f
%gotest %{import_path}/config/v2_1
333e3f
%gotest %{import_path}/config/v2_1/types
333e3f
%gotest %{import_path}/config/v2_2
333e3f
%gotest %{import_path}/config/v2_2/types
333e3f
%gotest %{import_path}/config/v2_3_experimental
333e3f
%gotest %{import_path}/config/v2_3_experimental/types
333e3f
%gotest %{import_path}/config/validate
333e3f
%gotest %{import_path}/internal/config
333e3f
%gotest %{import_path}/internal/exec/stages/files
333e3f
%gotest %{import_path}/internal/exec/util
333e3f
%gotest %{import_path}/internal/registry
333e3f
%gotest %{import_path}/internal/util
333e3f
%gotest %{import_path}/tests
333e3f
%endif
333e3f
333e3f
#define license tag if not already defined
333e3f
%{!?_licensedir:%global license %doc}
333e3f
333e3f
%files
333e3f
%license LICENSE
Andrew Jeddeloh c14ed2
%doc README.md code-of-conduct.md CONTRIBUTING.md
333e3f
#%{_bindir}/internal
333e3f
#%{_bindir}/internal/util/tools/docs
333e3f
#%{_bindir}/tests/stubs/id-stub
333e3f
#%{_bindir}/tests/stubs/useradd-stub
333e3f
#%{_bindir}/tests/stubs/usermod-stub
333e3f
#%{_bindir}/validate
333e3f
333e3f
%if 0%{?with_devel}
333e3f
%files devel -f devel.file-list
333e3f
%license LICENSE
Andrew Jeddeloh c14ed2
%doc README.md code-of-conduct.md CONTRIBUTING.md
333e3f
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
333e3f
%endif
333e3f
333e3f
%if 0%{?with_unit_test} && 0%{?with_devel}
333e3f
%files unit-test-devel -f unit-test-devel.file-list
333e3f
%license LICENSE
Andrew Jeddeloh c14ed2
%doc README.md code-of-conduct.md CONTRIBUTING.md
333e3f
%endif
333e3f
Andrew Jeddeloh c14ed2
%changelog* Thu Aug 30 2018 root - 0-0.1.gitf707912
333e3f
- First package for Fedora
333e3f