make ignition-dracut a subpackage

It was requested i make it a subpackage rather than a
separate package.

(cherry picked from commit 3d83b5d89ce2613647a4eb6b21c1a6bc66b52ca7)
This commit is contained in:
Dusty Mabe 2018-06-25 14:40:05 -04:00
parent 62f9eb85d7
commit 44fe06b5ab
No known key found for this signature in database
GPG Key ID: 3302DBD73952E671
2 changed files with 50 additions and 55 deletions

View File

@ -1,53 +0,0 @@
%global debug_package %{nil}
%global dracutlibdir %{_prefix}/lib/dracut
%global provider github
%global provider_tld com
%global project dustymabe
%global repo bootengine
# https://github.com/dustymabe/bootengine
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
%global commit bf3b454db89bcff82d01b472786821bd458d3593
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: ignition-dracut
Version: 0
Release: 0.1.git%{shortcommit}%{?dist}
Summary: Dracut modules for ignition
License: BSD
URL: https://%{provider_prefix}
Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
Requires: ignition
Requires: dracut
Requires: dracut-network
BuildArchitectures: noarch
%description
Dracut modules for ignition to enable ignition services to run in the
initramfs on boot.
%prep
%setup -q -n %{repo}-%{commit}
%build
%install
# dracut modules
install -d -p %{buildroot}/%{dracutlibdir}/modules.d
rm ./dracut/README.txt
cp -r ./dracut/* %{buildroot}/%{dracutlibdir}/modules.d/
%files
%doc README.md
%license LICENSE
%defattr(-,root,root,0755)
%{dracutlibdir}/modules.d/30ignition
%{dracutlibdir}/modules.d/99journald-conf
%changelog
* Thu Jun 21 2018 Dusty Mabe <dusty@dustymabe.com> - 0-0.1.gitbf3b454
- First package for Fedora

View File

@ -47,6 +47,7 @@
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
%endif
# macros for ignition
%global provider github
%global provider_tld com
%global project coreos
@ -56,7 +57,6 @@
%global import_path %{provider_prefix}
%global commit 76107251acd117c6d3e5b4dae2b47f82f944984b
%global shortcommit %(c=%{commit}; echo ${c:0:7})
# define ldflags, buildflags, testflags here. The ldflags were
# taken from ./build. We will need to periodically check these
# for consistency
@ -64,6 +64,19 @@
%global buildflags %nil
%global testflags %nil
# macros for ignition-dracut
%global dracutlibdir %{_prefix}/lib/dracut
%global dracutprovider github
%global dracutprovider_tld com
%global dracutproject dustymabe
%global dracutrepo bootengine
# https://github.com/dustymabe/bootengine
%global dracutprovider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global dracutimport_path %{provider_prefix}
%global dracutcommit bf3b454db89bcff82d01b472786821bd458d3593
%global dracutshortcommit %(c=%{dracutcommit}; echo ${c:0:7})
Name: ignition
Version: 0.26.0
Release: 0.1.git%{shortcommit}%{?dist}
@ -71,6 +84,7 @@ Summary: First boot installer and configuration tool
License: ASL 2.0
URL: https://%{provider_prefix}
Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
Source1: https://%{dracutprovider_prefix}/archive/%{dracutcommit}/%{dracutrepo}-%{dracutshortcommit}.tar.gz
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
@ -156,6 +170,8 @@ and applies the configuration.
%{summary}
############## devel subpackage ##############
%if 0%{?with_devel}
%package devel
Summary: %{summary}
@ -254,6 +270,7 @@ building other packages which use import path with
%{import_path} prefix.
%endif
############## unit-test-devel subpackage ##############
%if 0%{?with_unit_test} && 0%{?with_devel}
%package unit-test-devel
Summary: Unit tests for %{name} package
@ -278,11 +295,37 @@ This package contains unit tests for project
providing packages with %{import_path} prefix.
%endif
############## dracut subpackage ##############
%package dracut
Summary: Dracut modules for ignition
License: BSD
URL: https://%{dracutprovider_prefix}
Requires: ignition
Requires: dracut
Requires: dracut-network
BuildArchitectures: noarch
%description dracut
Dracut modules for ignition to enable ignition services to run in the
initramfs on boot.
%files dracut
%doc README.md
%license LICENSE
%defattr(-,root,root,0755)
%{dracutlibdir}/modules.d/30ignition
%{dracutlibdir}/modules.d/99journald-conf
############## end dracut subpackage ##############
%prep
# unpack source0 and apply patches
%setup -q -n %{repo}-%{commit}
# unpack source1 (dracut modules)
%setup -T -D -a 1 -q -n %{repo}-%{commit}
%build
# Set up PWD as a proper import path for go
mkdir -p src/%{provider}.%{provider_tld}/%{project}
ln -s ../../../ src/%{import_path}
@ -306,9 +349,14 @@ echo "Building ignition-validate..."
%install
# main package
install -d -p %{buildroot}%{_bindir}
install -p -m 0755 ./ignition %{buildroot}%{_bindir}
install -p -m 0755 ./ignition-validate %{buildroot}%{_bindir}
# dracut subpackage
install -d -p %{buildroot}/%{dracutlibdir}/modules.d
rm %{dracutrepo}-%{dracutcommit}/dracut/README.txt
cp -r %{dracutrepo}-%{dracutcommit}/dracut/* %{buildroot}/%{dracutlibdir}/modules.d/
# source codes for building projects
%if 0%{?with_devel}