Andrew Jeddeloh 566172
# Original spec file for 0.28.0 as generated by:
baf7e1
#     gofed repo2spec --detect github.com/coreos/ignition --commit f7079129b8651ac51dba14c3af65692bb413c1dd  --with-extra --with-build -f
baf7e1
# With:
baf7e1
#     gofed/gofed:v1.0.1 docker image
Andrew Jeddeloh ed3591
# Modified by hand for 0.31.0
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
Andrew Jeddeloh c14ed2
# 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}
Andrew Jeddeloh ed3591
%global commit          f59a653629be8b1825ed4ff2f9e3d21aa87bd85a
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
78722d
%global dracutproject         coreos
7b7c72
%global dracutrepo            ignition-dracut
78722d
# https://github.com/coreos/ignition-dracut
6596f4
%global dracutprovider_prefix %{dracutprovider}.%{dracutprovider_tld}/%{dracutproject}/%{dracutrepo}
6596f4
%global dracutimport_path     %{dracutprovider_prefix}
25ea59
%global dracutcommit          2c699252247fd4eb786b66db30a30b777dcd8468
44fe06
%global dracutshortcommit     %(c=%{dracutcommit}; echo ${c:0:7})
44fe06
44fe06
333e3f
Name:           ignition
Andrew Jeddeloh ed3591
Version:        0.31.0
14c71e
Release:        2.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
45ea7a
# For RHEL7 we'll want to specify gopath and list of arches since there is no
45ea7a
# gopath or go_arches macro.  We'll also want to make sure we pull in golang
45ea7a
# 1.10 require golang >= 1.10
f1d23b
%if 0%{?rhel} <= 7 && 0%{?centos} == 0
45ea7a
%define gopath %{_datadir}/gocode
f1d23b
ExclusiveArch: x86_64 ppc64le aarch64 s390x
f1d23b
BuildRequires: golang >= 1.10
f1d23b
%else
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}
f1d23b
%endif
333e3f
333e3f
# add non golang BuildRequires that weren't detected
333e3f
BuildRequires: libblkid-devel
333e3f
Luca Bruno 89e03c
# Requires for 'disks' stage
Colin Walters 1ba750
%if 0%{?fedora}
Luca Bruno 89e03c
Requires: btrfs-progs
Colin Walters 1ba750
%endif
Luca Bruno 89e03c
Requires: dosfstools
Luca Bruno 89e03c
Requires: gdisk
Luca Bruno 89e03c
333e3f
# Main rpm package BuildRequires
333e3f
%if ! 0%{?with_bundled}
Andrew Jeddeloh c14ed2
# Remaining dependencies not included in main packages (sorted)
333e3f
BuildRequires: golang(github.com/ajeddeloh/go-json)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws)
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)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/session)
333e3f
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3/s3manager)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/coreos/go-semver/semver)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/coreos/go-systemd/dbus)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/coreos/go-systemd/unit)
c77c54
BuildRequires: golang(github.com/pborman/uuid)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/pin/tftp)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/sigma/vmw-guestinfo/rpcvmx)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/sigma/vmw-guestinfo/vmcheck)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/vincent-petithory/dataurl)
Andrew Jeddeloh c14ed2
BuildRequires: golang(github.com/vmware/vmw-ovflib)
333e3f
%endif
333e3f
Andrew Jeddeloh c14ed2
# Main package Provides (generated with parsedeps.go | sort)
333e3f
%if 0%{?with_bundled}  
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/metadata)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
Andrew Jeddeloh c14ed2
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/client)) = %{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/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
Andrew Jeddeloh c14ed2
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials)) = %{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
Andrew Jeddeloh c14ed2
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws)) = %{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/query/queryutil)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
Andrew Jeddeloh c14ed2
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/rest)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3f
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/restxml)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
Andrew Jeddeloh c14ed2
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/xml/xmlutil)) = %{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
Andrew Jeddeloh c14ed2
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3)) = %{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
Andrew Jeddeloh 566172
Provides: bundled(golang(github.com/coreos/go-systemd/dbus)) = %{version}-9002847aa1425fb6ac49077c0a630b3b67e0fbfd
Andrew Jeddeloh 566172
Provides: bundled(golang(github.com/coreos/go-systemd/unit)) = %{version}-9002847aa1425fb6ac49077c0a630b3b67e0fbfd
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}
Andrew Jeddeloh c14ed2
# These buildrequires are only for our tests (check) (sorted)
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
Andrew Jeddeloh c14ed2
# all of the libraries that ignition imports during build. (sorted)
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
Andrew Jeddeloh c14ed2
# devel subpackage Provides (sorted)
333e3f
Provides:      golang(%{import_path}/config/shared/errors) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/shared/validations) = %{version}-%{release}
Andrew Jeddeloh c14ed2
Provides:      golang(%{import_path}/config/shared) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/util) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v1/types) = %{version}-%{release}
Andrew Jeddeloh c14ed2
Provides:      golang(%{import_path}/config/v1) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_0/types) = %{version}-%{release}
Andrew Jeddeloh c14ed2
Provides:      golang(%{import_path}/config/v2_0) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_1/types) = %{version}-%{release}
Andrew Jeddeloh c14ed2
Provides:      golang(%{import_path}/config/v2_1) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_2/types) = %{version}-%{release}
Andrew Jeddeloh c14ed2
Provides:      golang(%{import_path}/config/v2_2) = %{version}-%{release}
333e3f
Provides:      golang(%{import_path}/config/v2_3_experimental/types) = %{version}-%{release}
Andrew Jeddeloh c14ed2
Provides:      golang(%{import_path}/config/v2_3_experimental) = %{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}
Andrew Jeddeloh c14ed2
Provides:      golang(%{import_path}/config/validate) = %{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}
Andrew Jeddeloh c14ed2
Provides:      golang(%{import_path}/tests) = %{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
14c71e
Patch0: 0001-grub-find-boot-partition-and-use-it-directly.patch
14c71e
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}
5597ff
44fe06
# unpack source1 (dracut modules)
44fe06
%setup -T -D -a 1 -q -n %{repo}-%{commit}
14c71e
cd %{dracutrepo}-%{dracutcommit}
14c71e
%patch0 -p1
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
Andrew Jeddeloh 566172
%gotest %{import_path}/config/v2_3
Andrew Jeddeloh 566172
%gotest %{import_path}/config/v2_3/types
Andrew Jeddeloh 566172
%gotest %{import_path}/config/v2_4_experimental
Andrew Jeddeloh 566172
%gotest %{import_path}/config/v2_4_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 doc/
333e3f
%{_bindir}/%{name}
333e3f
%{_bindir}/%{name}-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
333e3f
%changelog
14c71e
* Mon Mar 04 2019 Dusty Mabe <dusty@dustymabe.com> - 0.31.0-2.gitf59a653
14c71e
- ignition-dracut: backport patch for finding ignition.firstboot file on UEFI systems
14c71e
  https://github.com/coreos/ignition-dracut/pull/52
14c71e
Andrew Jeddeloh ed3591
* Wed Feb 20 2019 Andrew Jeddeloh <andrew.jeddeloh@redhat.com> - 0.31.0-1.gitf59a653
Andrew Jeddeloh ed3591
- New release 0.31.0
Andrew Jeddeloh ed3591
25ea59
* Fri Feb 15 2019 Dusty Mabe <dusty@dustymabe.com> - 0.30.0-4.git308d7a0
25ea59
- Bump to ignition-dracut 2c69925
25ea59
- * support platform configs and user configs in /boot
25ea59
    ^ https://github.com/coreos/ignition-dracut/pull/43
25ea59
  * Add ability to parse config.ign file on boot
25ea59
    ^ https://github.com/coreos/ignition-dracut/pull/42
25ea59
d8b94a
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-3.git308d7a0
d8b94a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d8b94a
83f481
* Mon Jan 28 2019 Dusty Mabe <dusty@dustymabe.com> - 0.30.0-2.git308d7a0
83f481
- Bump to ignition-dracut fa7131b
83f481
- * 7579b92 journal: add clarifying comment for context
83f481
  * a6551f1 Remount /sysroot rw (#38)
83f481
  * ignition-firstboot-complete.service: Remount /boot rw
83f481
Benjamin Gilbert a917a6
* Sat Dec 15 2018 Benjamin Gilbert <bgilbert@redhat.com> - 0.30.0-1.git308d7a0
Benjamin Gilbert a917a6
- New release 0.30.0
Benjamin Gilbert a917a6
45ea7a
* Fri Dec 14 2018 Michael Nguyen <mnguyen@redhat.com> - 0.29.1-3.gitb1ab0b2
45ea7a
- define gopath for RHEL7
45ea7a
f1d23b
* Tue Dec 11 2018 Dusty Mabe <dusty@dustymabe.com> - 0.29.1-2.gitb1ab0b2
f1d23b
- require golang >= 1.10 and specify architecture list for RHEL7
f1d23b
Andrew Jeddeloh 566172
* Tue Dec 11 2018 Andrew Jeddeloh <andrew.jeddeloh@redhat.com> - 0.29.1-1.gitb1ab0b2
Andrew Jeddeloh 566172
- New release 0.29.1
Andrew Jeddeloh 566172
603981
* Wed Nov 21 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.28.0-12.gitf707912
6cf122
- Rebuild for protobuf 3.6 in rawhide (f30)
603981
78722d
* Tue Nov 20 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.28.0-11.git7b83454
78722d
- Bump to ignition-dracut 7b83454
78722d
a0c941
* Thu Oct 25 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-10.gitf707912
a0c941
- Bump to ignition-dracut decf63f
a0c941
- * 03d8438 30ignition: only instmods if module available
a0c941
  
6fc763
* Thu Oct 25 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-9.gitf707912
6fc763
- Bump to ignition-dracut 7ee64ca
6fc763
- * 3ec0b39 remove ignition-remount-sysroot.service files
6fc763
  * 66335f2 ignition: run files stage at original CL ordering
6fc763
  * 0301a03 ignition-disks.service: drop Requires=network.target
6fc763
  * a0bc135 ignition-ask-var-mount.service: use RemainAfterExit=yes
6fc763
  * ecf5779 module-setup.sh: explicitly install qemu_fw_cfg
6fc763
c1c119
* Mon Oct 15 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-8.gitf707912
c1c119
- Bump to ignition-dracut 4bdfb34
c1c119
- * 6d0763a module-setup: Make mkfs.btrfs optional
c1c119
0d1e13
* Wed Oct 10 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.28.0-7.gitf707912
0d1e13
- Backport patch for handling sysctl files correctly
0d1e13
  https://github.com/coreos/coreos-assembler/pull/128
0d1e13
  https://github.com/openshift/machine-config-operator/pull/123
0d1e13
42544b
* Wed Sep 26 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-6.gitf707912
42544b
- Bump to ignition-dracut c09ce6f
42544b
- * ce9f648 30ignition: add support for ignition-disks
42544b
8a2fd4
* Mon Sep 24 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-5.gitf707912
8a2fd4
- Remove requires for btrfs on !fedora
8a2fd4
- Bump to ignition-dracut 8c85eb3
8a2fd4
- * 26f2396 journal: Don't log to console AND kmsg
8a2fd4
623734
* Mon Sep 17 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.28.0-4.gitf707912
623734
- Backport patch for relabeling /var/home on FCOS
623734
  https://github.com/coreos/fedora-coreos-config/issues/2
623734
Luca Bruno 89e03c
* Thu Sep 06 2018 Luca Bruno <lucab@fedoraproject.org> - 0.28.0-3.gitf707912
Luca Bruno 89e03c
- Add requires for disks stage
Luca Bruno 89e03c
8c01d9
* Thu Aug 30 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-2.gitf707912
8c01d9
- Bump to ignition-dracut d056287
8c01d9
- * 3f41219 dracut/ignition: remove CL-legacy udev references
8c01d9
- * 92ef9dd coreos-firstboot-complete: RemainAfterExit=yes
8c01d9
baf7e1
* Thu Aug 30 2018 Andrew Jeddeloh <andrewjeddeloh@redhat.com> - 0.28.0-1.gitf707912
Andrew Jeddeloh c14ed2
- New release 0.28.0
Andrew Jeddeloh c14ed2
d2ffbc
* Fri Aug 17 2018 Dusty Mabe <dusty@dustymabe.com> - 0.27.0-3.gitcc7ebe0
d2ffbc
- Bump to ignition-dracut 56aa514
d2ffbc
5597ff
* Wed Aug 15 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.27.0-2.gitcc7ebe0
5597ff
- Backport patch for /root relabeling
5597ff
  https://github.com/coreos/ignition/pull/613
5597ff
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