Blame ignition.spec

333e3f
# Original spec file as generated by:                                                                                                      
333e3f
#     gofed repo2spec --detect github.com/coreos/ignition --commit 76107251acd117c6d3e5b4dae2b47f82f944984b  --with-extra --with-build -f
333e3f
# With:                                                                                                                                    
333e3f
#     gofed@8f62d8d2dea0a87ef60cad72f72e2d7558c0cb75
333e3f
# And:                                                                                                                                     
333e3f
#     $ git submodule status
333e3f
#     33207573a1875bc828da3f863e1de439d7af8166 third_party/cmdsignature (heads/master)
333e3f
#     6bff7ae54535689e2ade3d0bd3d33d903a2190b9 third_party/gofed_infra (remotes/origin/WIP-37-g6bff7ae)
333e3f
#     7e414c78930a81167dc2cd4d3e9adb79eeed38a6 third_party/gofed_resources (heads/master)
333e3f
#     ef6ec0e387f3b125308243898435774da6128a4c third_party/gofedlib (0.1.0a1-20-gef6ec0e)
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
# Not all devel deps exist in Fedora so you can't install the devel rpm 
333e3f
# so we need to build without devel for now
333e3f
# Generate devel rpm
333e3f
%global with_devel 0
333e3f
# Build project from bundled dependencies
333e3f
%global with_bundled 1
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
44fe06
# macros for ignition
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}
c77c54
%global commit          cc7ebe0b92d0fd4b6af2f67873e121894411a80d
333e3f
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
333e3f
# define ldflags, buildflags, testflags here. The ldflags were
333e3f
# taken from ./build. We will need to periodically check these
333e3f
# for consistency
333e3f
%global ldflags ' -X github.com/coreos/ignition/internal/version.Raw=%{version} '
333e3f
%global buildflags %nil
333e3f
%global testflags %nil
333e3f
44fe06
# macros for ignition-dracut
44fe06
%global dracutlibdir          %{_prefix}/lib/dracut
44fe06
%global dracutprovider        github
44fe06
%global dracutprovider_tld    com
44fe06
%global dracutproject         dustymabe
7b7c72
%global dracutrepo            ignition-dracut
7b7c72
# https://github.com/dustymabe/ignition-dracut
6596f4
%global dracutprovider_prefix %{dracutprovider}.%{dracutprovider_tld}/%{dracutproject}/%{dracutrepo}
6596f4
%global dracutimport_path     %{dracutprovider_prefix}
ece2be
%global dracutcommit          d664657cc2f733d8f54e9c0e69ba603babe55d92
44fe06
%global dracutshortcommit     %(c=%{dracutcommit}; echo ${c:0:7})
44fe06
44fe06
333e3f
Name:           ignition
c77c54
Version:        0.27.0
c77c54
Release:        1.git%{shortcommit}%{?dist}
333e3f
Summary:        First boot installer and configuration tool
333e3f
License:        ASL 2.0
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
# add non golang BuildRequires that weren't detected
333e3f
BuildRequires: libblkid-devel
333e3f
333e3f
# Main rpm package BuildRequires
333e3f
%if ! 0%{?with_bundled}
333e3f
# validate/main.go
333e3f
BuildRequires: golang(github.com/spf13/cobra)
333e3f
# Remaining dependencies not included in main packages
333e3f
BuildRequires: golang(github.com/coreos/go-systemd/unit)
333e3f
BuildRequires: golang(github.com/coreos/go-semver/semver)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)
333e3f
BuildRequires: golang(github.com/pin/tftp)
333e3f
BuildRequires: golang(github.com/sigma/vmw-guestinfo/vmcheck)
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)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/awserr)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/session)
333e3f
BuildRequires: golang(github.com/vincent-petithory/dataurl)
333e3f
BuildRequires: golang(github.com/vmware/vmw-ovflib)
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)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3)
c77c54
BuildRequires: golang(github.com/pborman/uuid)
333e3f
%endif
333e3f
333e3f
# Main package Provides (generated with parsedeps.go)
333e3f
%if 0%{?with_bundled}  
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/awserr)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/awsutil)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/client)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/client/metadata)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/corehandlers)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials/endpointcreds)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials/stscreds)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/defaults)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/ec2metadata)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/endpoints)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/request)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/session)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/signer/v4)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/internal/shareddefaults)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/query)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/query/queryutil)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/rest)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/restxml)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3/s3iface)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3/s3manager)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/sts)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/coreos/go-semver/semver)) = %{version}-294930c1e79c64e7dbe360054274fdad492c8cf5
333e3f
Provides: bundled(golang(github.com/coreos/go-systemd/dbus)) = %{version}-39ca1b05acc7ad1220e09f133283b8859a8b71ab
333e3f
Provides: bundled(golang(github.com/coreos/go-systemd/unit)) = %{version}-39ca1b05acc7ad1220e09f133283b8859a8b71ab
333e3f
Provides: bundled(golang(github.com/pin/tftp/netascii)) = %{version}-9ea92f6b1029bc1bf3072bba195c84bb9b0370e3
333e3f
Provides: bundled(golang(github.com/sigma/vmw-guestinfo/rpcvmx)) = %{version}-95dd4126d6e8b4ef1970b3f3fe2e8cdd470d2903
333e3f
Provides: bundled(golang(github.com/sigma/vmw-guestinfo/vmcheck)) = %{version}-95dd4126d6e8b4ef1970b3f3fe2e8cdd470d2903
333e3f
Provides: bundled(golang(github.com/vmware/vmw-guestinfo/bdoor)) = %{version}-25eff159a728be87e103a0b8045e08273f4dbec4
333e3f
Provides: bundled(golang(github.com/vmware/vmw-guestinfo/message)) = %{version}-25eff159a728be87e103a0b8045e08273f4dbec4
333e3f
Provides: bundled(golang(github.com/vmware/vmw-guestinfo/rpcout)) = %{version}-25eff159a728be87e103a0b8045e08273f4dbec4
333e3f
Provides: bundled(golang(go4.org/errorutil)) = %{version}-03efcb870d84809319ea509714dd6d19a1498483
333e3f
%endif
333e3f
333e3f
333e3f
%description
333e3f
Ignition is a utility used to manipulate systems during the initramfs. 
333e3f
This includes partitioning disks, formatting partitions, writing files
333e3f
(regular files, systemd units, networkd units, etc.), and configuring
333e3f
users. On first boot, Ignition reads its configuration from a source 
333e3f
of truth (remote URL, network metadata service, hypervisor bridge, etc.)
333e3f
and applies the configuration.
333e3f
333e3f
%{summary}
333e3f
44fe06
############## devel subpackage ##############
44fe06
333e3f
%if 0%{?with_devel}
333e3f
%package devel
333e3f
Summary:       %{summary}
333e3f
BuildArch:     noarch
333e3f
333e3f
# devel subpackage BuildRequires
333e3f
%if 0%{?with_check} && ! 0%{?with_bundled}
333e3f
# These buildrequires are only for our tests (check)
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)
c77c54
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
# devel subpackage Requires. This is basically the source code from
333e3f
# all of the libraries that ignition imports during build.
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)
c77c54
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
# devel subpackage Provides
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
44fe06
############## unit-test-devel subpackage ##############
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
44fe06
44fe06
############## dracut subpackage ##############
44fe06
%package dracut
44fe06
44fe06
Summary:  Dracut modules for ignition
44fe06
License:  BSD
44fe06
URL:      https://%{dracutprovider_prefix}
b24ebe
Source1:  https://%{dracutprovider_prefix}/archive/%{dracutcommit}/%{dracutrepo}-%{dracutshortcommit}.tar.gz
63ee52
Requires: %{name} = %{version}-%{release}
44fe06
Requires: dracut
44fe06
Requires: dracut-network
44fe06
BuildArchitectures: noarch
44fe06
44fe06
%description dracut
44fe06
Dracut modules for ignition to enable ignition services to run in the
44fe06
initramfs on boot.
44fe06
44fe06
%files dracut
44fe06
%doc README.md
44fe06
%license LICENSE
44fe06
%{dracutlibdir}/modules.d/30ignition
44fe06
%{dracutlibdir}/modules.d/99journald-conf
25ac30
%{_sysconfdir}/grub.d/*
25ac30
%{_prefix}/lib/systemd/system/*.service
44fe06
############## end dracut subpackage ##############
44fe06
333e3f
%prep
5ddad9
# setup command reference: http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html
44fe06
# unpack source0 and apply patches
5ddad9
%setup -T -b 0 -q -n %{repo}-%{commit}
44fe06
# unpack source1 (dracut modules)
44fe06
%setup -T -D -a 1 -q -n %{repo}-%{commit}
333e3f
333e3f
%build
333e3f
# Set up PWD as a proper import path for go
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
export LDFLAGS=%{ldflags}
333e3f
# Tell ignition where to find chroot binary
333e3f
export LDFLAGS+=' -X github.com/coreos/ignition/internal/distro.chrootCmd=%{_sbindir}/chroot '
c77c54
# Enable SELinux relabeling
c77c54
export LDFLAGS+=' -X github.com/coreos/ignition/internal/distro.selinuxRelabel=true '
333e3f
333e3f
echo "Building ignition..."
333e3f
%gobuild -o ./ignition %{import_path}/internal
333e3f
333e3f
echo "Building ignition-validate..."
333e3f
%gobuild -o ./ignition-validate %{import_path}/validate
333e3f
333e3f
333e3f
%install
44fe06
# main package
333e3f
install -d -p %{buildroot}%{_bindir}
333e3f
install -p -m 0755 ./ignition %{buildroot}%{_bindir}
333e3f
install -p -m 0755 ./ignition-validate %{buildroot}%{_bindir}
44fe06
# dracut subpackage
44fe06
install -d -p %{buildroot}/%{dracutlibdir}/modules.d
ec5980
install -d -p %{buildroot}/%{_prefix}/lib/systemd/system
ec5980
install -d -p %{buildroot}/%{_sysconfdir}/grub.d
25ac30
cd %{dracutrepo}-%{dracutcommit}
25ac30
rm dracut/README.txt
25ac30
cp -r dracut/* %{buildroot}/%{dracutlibdir}/modules.d/
ec5980
install -m 0644 -t %{buildroot}/%{_prefix}/lib/systemd/system/ systemd/*
ec5980
install -m 0755 -t %{buildroot}/%{_sysconfdir}/grub.d/ grub/*
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
333e3f
%doc CONTRIBUTING.md code-of-conduct.md README.md doc/
333e3f
%{_bindir}/%{name}
333e3f
%{_bindir}/%{name}-validate
333e3f
333e3f
333e3f
%if 0%{?with_devel}
333e3f
%files devel -f devel.file-list
333e3f
%license LICENSE
333e3f
%doc CONTRIBUTING.md code-of-conduct.md README.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
333e3f
%doc CONTRIBUTING.md code-of-conduct.md README.md
333e3f
%endif
333e3f
333e3f
%changelog
c77c54
* Fri Aug 10 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.27.0-1.gitcc7ebe0
c77c54
- New release 0.27.0
c77c54
ece2be
* Sat Jul 21 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.6.git7610725
ece2be
- Bump to ignition-dracut d664657
ece2be
dc057e
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.0-0.5.git7610725
dc057e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
dc057e
ec5980
* Fri Jun 29 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.4.git7610725
ec5980
- Fix building on el7 (install -D not working)
ec5980
25ac30
* Fri Jun 29 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.3.git7610725
25ac30
- Bump to ignition-dracut 17a201b
25ac30
7fb31c
* Tue Jun 26 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.2.git7610725
7fb31c
- Rename dustymabe/bootengine upstrem to dustymabe/ignition-dracut
7fb31c
333e3f
* Thu Jun 21 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.1.git7610725
333e3f
- First package for Fedora
333e3f