Andrew Jeddeloh 5661723
# Original spec file for 0.28.0 as generated by:
baf7e10
#     gofed repo2spec --detect github.com/coreos/ignition --commit f7079129b8651ac51dba14c3af65692bb413c1dd  --with-extra --with-build -f
baf7e10
# With:
baf7e10
#     gofed/gofed:v1.0.1 docker image
Andrew Jeddeloh ed35918
# Modified by hand for 0.31.0
333e3ff
333e3ff
# If any of the following macros should be set otherwise,
333e3ff
# you can wrap any of them with the following conditions:
333e3ff
# - %%if 0%%{centos} == 7
333e3ff
# - %%if 0%%{?rhel} == 7
333e3ff
# - %%if 0%%{?fedora} == 23
333e3ff
# Or just test for particular distribution:
333e3ff
# - %%if 0%%{centos}
333e3ff
# - %%if 0%%{?rhel}
333e3ff
# - %%if 0%%{?fedora}
333e3ff
#
333e3ff
# Be aware, on centos, both %%rhel and %%centos are set. If you want to test
333e3ff
# rhel specific macros, you can use %%if 0%%{?rhel} && 0%%{?centos} == 0 condition.
333e3ff
# (Don't forget to replace double percentage symbol with single one in order to apply a condition)
333e3ff
333e3ff
# Not all devel deps exist in Fedora so you can't install the devel rpm 
333e3ff
# so we need to build without devel for now
333e3ff
# Generate devel rpm
333e3ff
%global with_devel 0
333e3ff
# Build project from bundled dependencies
333e3ff
%global with_bundled 1
333e3ff
# Build with debug info rpm
333e3ff
%global with_debug 1
333e3ff
# Run tests in check section
333e3ff
%global with_check 1
333e3ff
# Generate unit-test rpm
333e3ff
%global with_unit_test 1
333e3ff
333e3ff
%if 0%{?with_debug}
333e3ff
%global _dwz_low_mem_die_limit 0
333e3ff
%else
333e3ff
%global debug_package   %{nil}
333e3ff
%endif
333e3ff
333e3ff
%if ! 0%{?gobuild:1}
333e3ff
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
333e3ff
%endif
333e3ff
Andrew Jeddeloh c14ed24
# macros for Ignition
333e3ff
%global provider        github
333e3ff
%global provider_tld    com
333e3ff
%global project         coreos
333e3ff
%global repo            ignition
333e3ff
# https://github.com/coreos/ignition
333e3ff
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
333e3ff
%global import_path     %{provider_prefix}
Andrew Jeddeloh ed35918
%global commit          f59a653629be8b1825ed4ff2f9e3d21aa87bd85a
333e3ff
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
333e3ff
# define ldflags, buildflags, testflags here. The ldflags were
333e3ff
# taken from ./build. We will need to periodically check these
333e3ff
# for consistency
333e3ff
%global ldflags ' -X github.com/coreos/ignition/internal/version.Raw=%{version} '
333e3ff
%global buildflags %nil
333e3ff
%global testflags %nil
333e3ff
44fe06b
# macros for ignition-dracut
44fe06b
%global dracutlibdir          %{_prefix}/lib/dracut
44fe06b
%global dracutprovider        github
44fe06b
%global dracutprovider_tld    com
78722da
%global dracutproject         coreos
7b7c721
%global dracutrepo            ignition-dracut
78722da
# https://github.com/coreos/ignition-dracut
6596f44
%global dracutprovider_prefix %{dracutprovider}.%{dracutprovider_tld}/%{dracutproject}/%{dracutrepo}
6596f44
%global dracutimport_path     %{dracutprovider_prefix}
25ea599
%global dracutcommit          2c699252247fd4eb786b66db30a30b777dcd8468
44fe06b
%global dracutshortcommit     %(c=%{dracutcommit}; echo ${c:0:7})
44fe06b
44fe06b
333e3ff
Name:           ignition
Andrew Jeddeloh ed35918
Version:        0.31.0
Benjamin Gilbert efdd301
Release:        4.git%{shortcommit}%{?dist}
333e3ff
Summary:        First boot installer and configuration tool
333e3ff
License:        ASL 2.0
333e3ff
URL:            https://%{provider_prefix}
333e3ff
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
Benjamin Gilbert efdd301
Source1:        https://%{dracutprovider_prefix}/archive/%{dracutcommit}/%{dracutrepo}-%{dracutshortcommit}.tar.gz
Benjamin Gilbert efdd301
Benjamin Gilbert efdd301
Patch0: 0001-grub-find-boot-partition-and-use-it-directly.patch
Benjamin Gilbert efdd301
Patch1: 0001-02_ignition_firstboot-Enable-networking-if-Ignition-.patch
333e3ff
45ea7ad
# For RHEL7 we'll want to specify gopath and list of arches since there is no
45ea7ad
# gopath or go_arches macro.  We'll also want to make sure we pull in golang
45ea7ad
# 1.10 require golang >= 1.10
f1d23b1
%if 0%{?rhel} <= 7 && 0%{?centos} == 0
45ea7ad
%define gopath %{_datadir}/gocode
f1d23b1
ExclusiveArch: x86_64 ppc64le aarch64 s390x
f1d23b1
BuildRequires: golang >= 1.10
f1d23b1
%else
333e3ff
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
333e3ff
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
333e3ff
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
333e3ff
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
f1d23b1
%endif
333e3ff
333e3ff
# add non golang BuildRequires that weren't detected
333e3ff
BuildRequires: libblkid-devel
333e3ff
Luca Bruno 89e03c4
# Requires for 'disks' stage
Colin Walters 1ba750e
%if 0%{?fedora}
Luca Bruno 89e03c4
Requires: btrfs-progs
Colin Walters 1ba750e
%endif
Luca Bruno 89e03c4
Requires: dosfstools
Luca Bruno 89e03c4
Requires: gdisk
Luca Bruno 89e03c4
333e3ff
# Main rpm package BuildRequires
333e3ff
%if ! 0%{?with_bundled}
Andrew Jeddeloh c14ed24
# Remaining dependencies not included in main packages (sorted)
333e3ff
BuildRequires: golang(github.com/ajeddeloh/go-json)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/aws)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/awserr)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/session)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3/s3manager)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/coreos/go-semver/semver)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/coreos/go-systemd/dbus)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/coreos/go-systemd/unit)
c77c54b
BuildRequires: golang(github.com/pborman/uuid)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/pin/tftp)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/sigma/vmw-guestinfo/rpcvmx)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/sigma/vmw-guestinfo/vmcheck)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/vincent-petithory/dataurl)
Andrew Jeddeloh c14ed24
BuildRequires: golang(github.com/vmware/vmw-ovflib)
333e3ff
%endif
333e3ff
Andrew Jeddeloh c14ed24
# Main package Provides (generated with parsedeps.go | sort)
333e3ff
%if 0%{?with_bundled}  
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/awserr)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/awsutil)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/client/metadata)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
Andrew Jeddeloh c14ed24
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/client)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/corehandlers)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials/endpointcreds)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials/stscreds)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
Andrew Jeddeloh c14ed24
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/defaults)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/ec2metadata)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/endpoints)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/request)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/session)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/signer/v4)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
Andrew Jeddeloh c14ed24
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/internal/shareddefaults)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/query/queryutil)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
Andrew Jeddeloh c14ed24
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/query)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/rest)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/restxml)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
Andrew Jeddeloh c14ed24
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3/s3iface)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3/s3manager)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
Andrew Jeddeloh c14ed24
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/sts)) = %{version}-c861d27d0304a79f727e9a8a4e2ac1e74602fdc0
333e3ff
Provides: bundled(golang(github.com/coreos/go-semver/semver)) = %{version}-294930c1e79c64e7dbe360054274fdad492c8cf5
Andrew Jeddeloh 5661723
Provides: bundled(golang(github.com/coreos/go-systemd/dbus)) = %{version}-9002847aa1425fb6ac49077c0a630b3b67e0fbfd
Andrew Jeddeloh 5661723
Provides: bundled(golang(github.com/coreos/go-systemd/unit)) = %{version}-9002847aa1425fb6ac49077c0a630b3b67e0fbfd
333e3ff
Provides: bundled(golang(github.com/pin/tftp/netascii)) = %{version}-9ea92f6b1029bc1bf3072bba195c84bb9b0370e3
333e3ff
Provides: bundled(golang(github.com/sigma/vmw-guestinfo/rpcvmx)) = %{version}-95dd4126d6e8b4ef1970b3f3fe2e8cdd470d2903
333e3ff
Provides: bundled(golang(github.com/sigma/vmw-guestinfo/vmcheck)) = %{version}-95dd4126d6e8b4ef1970b3f3fe2e8cdd470d2903
333e3ff
Provides: bundled(golang(github.com/vmware/vmw-guestinfo/bdoor)) = %{version}-25eff159a728be87e103a0b8045e08273f4dbec4
333e3ff
Provides: bundled(golang(github.com/vmware/vmw-guestinfo/message)) = %{version}-25eff159a728be87e103a0b8045e08273f4dbec4
333e3ff
Provides: bundled(golang(github.com/vmware/vmw-guestinfo/rpcout)) = %{version}-25eff159a728be87e103a0b8045e08273f4dbec4
333e3ff
Provides: bundled(golang(go4.org/errorutil)) = %{version}-03efcb870d84809319ea509714dd6d19a1498483
333e3ff
%endif
333e3ff
333e3ff
333e3ff
%description
Benjamin Gilbert a50f54e
Ignition is a utility used to manipulate systems during the initramfs.
333e3ff
This includes partitioning disks, formatting partitions, writing files
333e3ff
(regular files, systemd units, networkd units, etc.), and configuring
Benjamin Gilbert a50f54e
users. On first boot, Ignition reads its configuration from a source
333e3ff
of truth (remote URL, network metadata service, hypervisor bridge, etc.)
333e3ff
and applies the configuration.
333e3ff
44fe06b
############## devel subpackage ##############
44fe06b
333e3ff
%if 0%{?with_devel}
333e3ff
%package devel
333e3ff
Summary:       %{summary}
333e3ff
BuildArch:     noarch
333e3ff
333e3ff
# devel subpackage BuildRequires
333e3ff
%if 0%{?with_check} && ! 0%{?with_bundled}
Andrew Jeddeloh c14ed24
# These buildrequires are only for our tests (check) (sorted)
333e3ff
BuildRequires: golang(github.com/ajeddeloh/go-json)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/aws)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/awserr)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/session)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3)
333e3ff
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3/s3manager)
333e3ff
BuildRequires: golang(github.com/coreos/go-semver/semver)
333e3ff
BuildRequires: golang(github.com/coreos/go-systemd/dbus)
333e3ff
BuildRequires: golang(github.com/coreos/go-systemd/unit)
c77c54b
BuildRequires: golang(github.com/pborman/uuid)
333e3ff
BuildRequires: golang(github.com/pin/tftp)
333e3ff
BuildRequires: golang(github.com/sigma/vmw-guestinfo/rpcvmx)
333e3ff
BuildRequires: golang(github.com/sigma/vmw-guestinfo/vmcheck)
333e3ff
BuildRequires: golang(github.com/vincent-petithory/dataurl)
333e3ff
BuildRequires: golang(github.com/vmware/vmw-ovflib)
333e3ff
%endif
333e3ff
333e3ff
# devel subpackage Requires. This is basically the source code from
Andrew Jeddeloh c14ed24
# all of the libraries that ignition imports during build. (sorted)
333e3ff
Requires:      golang(github.com/ajeddeloh/go-json)
333e3ff
Requires:      golang(github.com/aws/aws-sdk-go/aws)
333e3ff
Requires:      golang(github.com/aws/aws-sdk-go/aws/awserr)
333e3ff
Requires:      golang(github.com/aws/aws-sdk-go/aws/credentials)
333e3ff
Requires:      golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds)
333e3ff
Requires:      golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
333e3ff
Requires:      golang(github.com/aws/aws-sdk-go/aws/session)
333e3ff
Requires:      golang(github.com/aws/aws-sdk-go/service/s3)
333e3ff
Requires:      golang(github.com/aws/aws-sdk-go/service/s3/s3manager)
333e3ff
Requires:      golang(github.com/coreos/go-semver/semver)
333e3ff
Requires:      golang(github.com/coreos/go-systemd/dbus)
333e3ff
Requires:      golang(github.com/coreos/go-systemd/unit)
c77c54b
Requires:      golang(github.com/pborman/uuid)
333e3ff
Requires:      golang(github.com/pin/tftp)
333e3ff
Requires:      golang(github.com/sigma/vmw-guestinfo/rpcvmx)
333e3ff
Requires:      golang(github.com/sigma/vmw-guestinfo/vmcheck)
333e3ff
Requires:      golang(github.com/vincent-petithory/dataurl)
333e3ff
Requires:      golang(github.com/vmware/vmw-ovflib)
333e3ff
Andrew Jeddeloh c14ed24
# devel subpackage Provides (sorted)
333e3ff
Provides:      golang(%{import_path}/config/shared/errors) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/shared/validations) = %{version}-%{release}
Andrew Jeddeloh c14ed24
Provides:      golang(%{import_path}/config/shared) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/util) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/v1/types) = %{version}-%{release}
Andrew Jeddeloh c14ed24
Provides:      golang(%{import_path}/config/v1) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/v2_0/types) = %{version}-%{release}
Andrew Jeddeloh c14ed24
Provides:      golang(%{import_path}/config/v2_0) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/v2_1/types) = %{version}-%{release}
Andrew Jeddeloh c14ed24
Provides:      golang(%{import_path}/config/v2_1) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/v2_2/types) = %{version}-%{release}
Andrew Jeddeloh c14ed24
Provides:      golang(%{import_path}/config/v2_2) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/v2_3_experimental/types) = %{version}-%{release}
Andrew Jeddeloh c14ed24
Provides:      golang(%{import_path}/config/v2_3_experimental) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/validate/astjson) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/validate/astnode) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/config/validate/report) = %{version}-%{release}
Andrew Jeddeloh c14ed24
Provides:      golang(%{import_path}/config/validate) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/negative/files) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/negative/filesystems) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/negative/general) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/negative/networkd) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/negative/partitions) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/negative/regression) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/negative/security) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/negative/timeouts) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/files) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/filesystems) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/general) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/networkd) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/oem) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/partitions) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/passwd) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/regression) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/security) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/systemd) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/positive/timeouts) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/register) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/registry) = %{version}-%{release}
333e3ff
Provides:      golang(%{import_path}/tests/types) = %{version}-%{release}
Andrew Jeddeloh c14ed24
Provides:      golang(%{import_path}/tests) = %{version}-%{release}
333e3ff
333e3ff
%description devel
333e3ff
%{summary}
333e3ff
333e3ff
This package contains library source intended for
333e3ff
building other packages which use import path with
333e3ff
%{import_path} prefix.
333e3ff
%endif
333e3ff
44fe06b
############## unit-test-devel subpackage ##############
333e3ff
%if 0%{?with_unit_test} && 0%{?with_devel}
333e3ff
%package unit-test-devel
333e3ff
Summary:         Unit tests for %{name} package
333e3ff
%if 0%{?with_check}
333e3ff
#Here comes all BuildRequires: PACKAGE the unit tests
333e3ff
#in %%check section need for running
333e3ff
%endif
333e3ff
333e3ff
# test subpackage tests code from devel subpackage
333e3ff
Requires:        %{name}-devel = %{version}-%{release}
333e3ff
333e3ff
%if 0%{?with_check} && ! 0%{?with_bundled}
333e3ff
BuildRequires: golang(github.com/stretchr/testify/assert)
333e3ff
%endif
333e3ff
333e3ff
Requires:      golang(github.com/stretchr/testify/assert)
333e3ff
333e3ff
%description unit-test-devel
333e3ff
%{summary}
333e3ff
333e3ff
This package contains unit tests for project
333e3ff
providing packages with %{import_path} prefix.
333e3ff
%endif
333e3ff
44fe06b
44fe06b
############## dracut subpackage ##############
44fe06b
%package dracut
44fe06b
44fe06b
Summary:  Dracut modules for ignition
44fe06b
License:  BSD
44fe06b
URL:      https://%{dracutprovider_prefix}
63ee52d
Requires: %{name} = %{version}-%{release}
44fe06b
Requires: dracut
44fe06b
Requires: dracut-network
44fe06b
BuildArchitectures: noarch
44fe06b
14c71e1
44fe06b
%description dracut
44fe06b
Dracut modules for ignition to enable ignition services to run in the
44fe06b
initramfs on boot.
44fe06b
44fe06b
333e3ff
%prep
5ddad91
# setup command reference: http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html
44fe06b
# unpack source0 and apply patches
5ddad91
%setup -T -b 0 -q -n %{repo}-%{commit}
5597ff7
44fe06b
# unpack source1 (dracut modules)
44fe06b
%setup -T -D -a 1 -q -n %{repo}-%{commit}
14c71e1
cd %{dracutrepo}-%{dracutcommit}
14c71e1
%patch0 -p1
Colin Walters 08c873e
%patch1 -p1
333e3ff
333e3ff
%build
333e3ff
# Set up PWD as a proper import path for go
333e3ff
mkdir -p src/%{provider}.%{provider_tld}/%{project}
333e3ff
ln -s ../../../ src/%{import_path}
333e3ff
333e3ff
%if ! 0%{?with_bundled}
333e3ff
export GOPATH=$(pwd):%{gopath}
333e3ff
%else
333e3ff
# No dependency directories so far
333e3ff
export GOPATH=$(pwd):%{gopath}
333e3ff
%endif
333e3ff
333e3ff
export LDFLAGS=%{ldflags}
333e3ff
# Tell ignition where to find chroot binary
333e3ff
export LDFLAGS+=' -X github.com/coreos/ignition/internal/distro.chrootCmd=%{_sbindir}/chroot '
c77c54b
# Enable SELinux relabeling
c77c54b
export LDFLAGS+=' -X github.com/coreos/ignition/internal/distro.selinuxRelabel=true '
333e3ff
333e3ff
echo "Building ignition..."
333e3ff
%gobuild -o ./ignition %{import_path}/internal
333e3ff
333e3ff
echo "Building ignition-validate..."
333e3ff
%gobuild -o ./ignition-validate %{import_path}/validate
333e3ff
333e3ff
333e3ff
%install
44fe06b
# main package
333e3ff
install -d -p %{buildroot}%{_bindir}
333e3ff
install -p -m 0755 ./ignition %{buildroot}%{_bindir}
333e3ff
install -p -m 0755 ./ignition-validate %{buildroot}%{_bindir}
44fe06b
# dracut subpackage
44fe06b
install -d -p %{buildroot}/%{dracutlibdir}/modules.d
ec59806
install -d -p %{buildroot}/%{_prefix}/lib/systemd/system
ec59806
install -d -p %{buildroot}/%{_sysconfdir}/grub.d
25ac30c
cd %{dracutrepo}-%{dracutcommit}
25ac30c
rm dracut/README.txt
25ac30c
cp -r dracut/* %{buildroot}/%{dracutlibdir}/modules.d/
ec59806
install -m 0644 -t %{buildroot}/%{_prefix}/lib/systemd/system/ systemd/*
ec59806
install -m 0755 -t %{buildroot}/%{_sysconfdir}/grub.d/ grub/*
333e3ff
333e3ff
# source codes for building projects
333e3ff
%if 0%{?with_devel}
333e3ff
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
333e3ff
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
333e3ff
# find all *.go but no *_test.go files and generate devel.file-list
333e3ff
for file in $(find . \( -iname "*.go" -or -iname "*.s" \) \! -iname "*_test.go" | grep -v "vendor") ; do
333e3ff
    dirprefix=$(dirname $file)
333e3ff
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix
333e3ff
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
333e3ff
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
333e3ff
333e3ff
    while [ "$dirprefix" != "." ]; do
333e3ff
        echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list
333e3ff
        dirprefix=$(dirname $dirprefix)
333e3ff
    done
333e3ff
done
333e3ff
%endif
333e3ff
333e3ff
# testing files for this project
333e3ff
%if 0%{?with_unit_test} && 0%{?with_devel}
333e3ff
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
333e3ff
# find all *_test.go files and generate unit-test-devel.file-list
333e3ff
for file in $(find . -iname "*_test.go" | grep -v "vendor") ; do
333e3ff
    dirprefix=$(dirname $file)
333e3ff
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix
333e3ff
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
333e3ff
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list
333e3ff
333e3ff
    while [ "$dirprefix" != "." ]; do
333e3ff
        echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list
333e3ff
        dirprefix=$(dirname $dirprefix)
333e3ff
    done
333e3ff
done
333e3ff
%endif
333e3ff
333e3ff
%if 0%{?with_devel}
333e3ff
sort -u -o devel.file-list devel.file-list
333e3ff
%endif
333e3ff
333e3ff
%check
333e3ff
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
333e3ff
%if ! 0%{?with_bundled}
333e3ff
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
333e3ff
%else
333e3ff
# Since we aren't packaging up the vendor directory we need to link
333e3ff
# back to it somehow. Hack it up so that we can add the vendor
333e3ff
# directory from BUILD dir as a gopath to be searched when executing
333e3ff
# tests from the BUILDROOT dir.
333e3ff
ln -s ./ ./vendor/src # ./vendor/src -> ./vendor
333e3ff
333e3ff
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
333e3ff
%endif
333e3ff
333e3ff
%if ! 0%{?gotest:1}
333e3ff
%global gotest go test
333e3ff
%endif
333e3ff
333e3ff
%gotest %{import_path}/config/v1
333e3ff
%gotest %{import_path}/config/v1/types
333e3ff
%gotest %{import_path}/config/v2_0
333e3ff
%gotest %{import_path}/config/v2_0/types
333e3ff
%gotest %{import_path}/config/v2_1
333e3ff
%gotest %{import_path}/config/v2_1/types
333e3ff
%gotest %{import_path}/config/v2_2
333e3ff
%gotest %{import_path}/config/v2_2/types
Andrew Jeddeloh 5661723
%gotest %{import_path}/config/v2_3
Andrew Jeddeloh 5661723
%gotest %{import_path}/config/v2_3/types
Andrew Jeddeloh 5661723
%gotest %{import_path}/config/v2_4_experimental
Andrew Jeddeloh 5661723
%gotest %{import_path}/config/v2_4_experimental/types
333e3ff
%gotest %{import_path}/config/validate
333e3ff
%gotest %{import_path}/internal/config
333e3ff
%gotest %{import_path}/internal/exec/stages/files
333e3ff
%gotest %{import_path}/internal/exec/util
333e3ff
%gotest %{import_path}/internal/registry
333e3ff
%gotest %{import_path}/internal/util
333e3ff
%gotest %{import_path}/tests
333e3ff
%endif
333e3ff
333e3ff
#define license tag if not already defined
333e3ff
%{!?_licensedir:%global license %doc}
333e3ff
333e3ff
%files
333e3ff
%license LICENSE
Andrew Jeddeloh c14ed24
%doc README.md code-of-conduct.md CONTRIBUTING.md doc/
333e3ff
%{_bindir}/%{name}
333e3ff
%{_bindir}/%{name}-validate
333e3ff
Benjamin Gilbert efdd301
%files dracut
Benjamin Gilbert efdd301
%doc README.md
Benjamin Gilbert efdd301
%license LICENSE
Benjamin Gilbert efdd301
%{dracutlibdir}/modules.d/30ignition
Benjamin Gilbert efdd301
%{dracutlibdir}/modules.d/99journald-conf
Benjamin Gilbert efdd301
%{_sysconfdir}/grub.d/*
Benjamin Gilbert efdd301
%{_prefix}/lib/systemd/system/*.service
Benjamin Gilbert efdd301
333e3ff
%if 0%{?with_devel}
333e3ff
%files devel -f devel.file-list
333e3ff
%license LICENSE
Andrew Jeddeloh c14ed24
%doc README.md code-of-conduct.md CONTRIBUTING.md
333e3ff
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
333e3ff
%endif
333e3ff
333e3ff
%if 0%{?with_unit_test} && 0%{?with_devel}
333e3ff
%files unit-test-devel -f unit-test-devel.file-list
333e3ff
%license LICENSE
Andrew Jeddeloh c14ed24
%doc README.md code-of-conduct.md CONTRIBUTING.md
333e3ff
%endif
333e3ff
333e3ff
%changelog
Benjamin Gilbert efdd301
* Mon Mar 18 2019 Benjamin Gilbert <bgilbert@backtick.net> - 0.31.0-4.gitf59a653
Benjamin Gilbert efdd301
- Move some dracut subpackage configuration within the specfile
Benjamin Gilbert efdd301
Colin Walters 08c873e
* Mon Mar 18 2019 Colin Walters <walters@verbum.org> - 0.31.0-3.gitf59a653
Colin Walters 08c873e
- Backport patch for networking
Colin Walters 08c873e
14c71e1
* Mon Mar 04 2019 Dusty Mabe <dusty@dustymabe.com> - 0.31.0-2.gitf59a653
14c71e1
- ignition-dracut: backport patch for finding ignition.firstboot file on UEFI systems
14c71e1
  https://github.com/coreos/ignition-dracut/pull/52
14c71e1
Andrew Jeddeloh ed35918
* Wed Feb 20 2019 Andrew Jeddeloh <andrew.jeddeloh@redhat.com> - 0.31.0-1.gitf59a653
Andrew Jeddeloh ed35918
- New release 0.31.0
Andrew Jeddeloh ed35918
25ea599
* Fri Feb 15 2019 Dusty Mabe <dusty@dustymabe.com> - 0.30.0-4.git308d7a0
25ea599
- Bump to ignition-dracut 2c69925
25ea599
- * support platform configs and user configs in /boot
25ea599
    ^ https://github.com/coreos/ignition-dracut/pull/43
25ea599
  * Add ability to parse config.ign file on boot
25ea599
    ^ https://github.com/coreos/ignition-dracut/pull/42
25ea599
d8b94af
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-3.git308d7a0
d8b94af
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d8b94af
83f481a
* Mon Jan 28 2019 Dusty Mabe <dusty@dustymabe.com> - 0.30.0-2.git308d7a0
83f481a
- Bump to ignition-dracut fa7131b
83f481a
- * 7579b92 journal: add clarifying comment for context
83f481a
  * a6551f1 Remount /sysroot rw (#38)
83f481a
  * ignition-firstboot-complete.service: Remount /boot rw
83f481a
Benjamin Gilbert a917a6a
* Sat Dec 15 2018 Benjamin Gilbert <bgilbert@redhat.com> - 0.30.0-1.git308d7a0
Benjamin Gilbert a917a6a
- New release 0.30.0
Benjamin Gilbert a917a6a
45ea7ad
* Fri Dec 14 2018 Michael Nguyen <mnguyen@redhat.com> - 0.29.1-3.gitb1ab0b2
45ea7ad
- define gopath for RHEL7
45ea7ad
f1d23b1
* Tue Dec 11 2018 Dusty Mabe <dusty@dustymabe.com> - 0.29.1-2.gitb1ab0b2
f1d23b1
- require golang >= 1.10 and specify architecture list for RHEL7
f1d23b1
Andrew Jeddeloh 5661723
* Tue Dec 11 2018 Andrew Jeddeloh <andrew.jeddeloh@redhat.com> - 0.29.1-1.gitb1ab0b2
Andrew Jeddeloh 5661723
- New release 0.29.1
Andrew Jeddeloh 5661723
603981e
* Wed Nov 21 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.28.0-12.gitf707912
6cf1223
- Rebuild for protobuf 3.6 in rawhide (f30)
603981e
78722da
* Tue Nov 20 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.28.0-11.git7b83454
78722da
- Bump to ignition-dracut 7b83454
78722da
a0c9413
* Thu Oct 25 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-10.gitf707912
a0c9413
- Bump to ignition-dracut decf63f
a0c9413
- * 03d8438 30ignition: only instmods if module available
a0c9413
  
6fc7632
* Thu Oct 25 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-9.gitf707912
6fc7632
- Bump to ignition-dracut 7ee64ca
6fc7632
- * 3ec0b39 remove ignition-remount-sysroot.service files
6fc7632
  * 66335f2 ignition: run files stage at original CL ordering
6fc7632
  * 0301a03 ignition-disks.service: drop Requires=network.target
6fc7632
  * a0bc135 ignition-ask-var-mount.service: use RemainAfterExit=yes
6fc7632
  * ecf5779 module-setup.sh: explicitly install qemu_fw_cfg
6fc7632
c1c1198
* Mon Oct 15 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-8.gitf707912
c1c1198
- Bump to ignition-dracut 4bdfb34
c1c1198
- * 6d0763a module-setup: Make mkfs.btrfs optional
c1c1198
0d1e132
* Wed Oct 10 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.28.0-7.gitf707912
0d1e132
- Backport patch for handling sysctl files correctly
0d1e132
  https://github.com/coreos/coreos-assembler/pull/128
0d1e132
  https://github.com/openshift/machine-config-operator/pull/123
0d1e132
42544b2
* Wed Sep 26 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-6.gitf707912
42544b2
- Bump to ignition-dracut c09ce6f
42544b2
- * ce9f648 30ignition: add support for ignition-disks
42544b2
8a2fd45
* Mon Sep 24 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-5.gitf707912
8a2fd45
- Remove requires for btrfs on !fedora
8a2fd45
- Bump to ignition-dracut 8c85eb3
8a2fd45
- * 26f2396 journal: Don't log to console AND kmsg
8a2fd45
623734c
* Mon Sep 17 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.28.0-4.gitf707912
623734c
- Backport patch for relabeling /var/home on FCOS
623734c
  https://github.com/coreos/fedora-coreos-config/issues/2
623734c
Luca Bruno 89e03c4
* Thu Sep 06 2018 Luca Bruno <lucab@fedoraproject.org> - 0.28.0-3.gitf707912
Luca Bruno 89e03c4
- Add requires for disks stage
Luca Bruno 89e03c4
8c01d92
* Thu Aug 30 2018 Dusty Mabe <dusty@dustymabe.com> - 0.28.0-2.gitf707912
8c01d92
- Bump to ignition-dracut d056287
8c01d92
- * 3f41219 dracut/ignition: remove CL-legacy udev references
8c01d92
- * 92ef9dd coreos-firstboot-complete: RemainAfterExit=yes
8c01d92
baf7e10
* Thu Aug 30 2018 Andrew Jeddeloh <andrewjeddeloh@redhat.com> - 0.28.0-1.gitf707912
Andrew Jeddeloh c14ed24
- New release 0.28.0
Andrew Jeddeloh c14ed24
d2ffbc1
* Fri Aug 17 2018 Dusty Mabe <dusty@dustymabe.com> - 0.27.0-3.gitcc7ebe0
d2ffbc1
- Bump to ignition-dracut 56aa514
d2ffbc1
5597ff7
* Wed Aug 15 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.27.0-2.gitcc7ebe0
5597ff7
- Backport patch for /root relabeling
5597ff7
  https://github.com/coreos/ignition/pull/613
5597ff7
c77c54b
* Fri Aug 10 2018 Jonathan Lebon <jonathan@jlebon.com> - 0.27.0-1.gitcc7ebe0
c77c54b
- New release 0.27.0
c77c54b
ece2be4
* Sat Jul 21 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.6.git7610725
ece2be4
- Bump to ignition-dracut d664657
ece2be4
dc057e0
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.0-0.5.git7610725
dc057e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
dc057e0
ec59806
* Fri Jun 29 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.4.git7610725
ec59806
- Fix building on el7 (install -D not working)
ec59806
25ac30c
* Fri Jun 29 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.3.git7610725
25ac30c
- Bump to ignition-dracut 17a201b
25ac30c
7fb31cc
* Tue Jun 26 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.2.git7610725
7fb31cc
- Rename dustymabe/bootengine upstrem to dustymabe/ignition-dracut
7fb31cc
333e3ff
* Thu Jun 21 2018 Dusty Mabe <dusty@dustymabe.com> - 0.26.0-0.1.git7610725
333e3ff
- First package for Fedora
333e3ff