From 7494fdf3cfc3e2e78e2eb46c5c241c85f0f3f9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 28 Mar 2018 13:57:58 +0200 Subject: [PATCH 1/3] Logically separet srpm macros --- {rpm => srpm}/macros.d/macros.go-srpm | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {rpm => srpm}/macros.d/macros.go-srpm (100%) diff --git a/rpm/macros.d/macros.go-srpm b/srpm/macros.d/macros.go-srpm similarity index 100% rename from rpm/macros.d/macros.go-srpm rename to srpm/macros.d/macros.go-srpm From ba87a789fbbe744c1725f2288e37d3e834ac6099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 28 Mar 2018 15:43:19 +0200 Subject: [PATCH 2/3] Add go-srpm-macros example spec file --- specs/go-srpm-macros/go-srpm-macros.spec | 31 ++++++++++++++++++++++++ specs/go-srpm-macros/macros.go-srpm | 1 + 2 files changed, 32 insertions(+) create mode 100644 specs/go-srpm-macros/go-srpm-macros.spec create mode 120000 specs/go-srpm-macros/macros.go-srpm diff --git a/specs/go-srpm-macros/go-srpm-macros.spec b/specs/go-srpm-macros/go-srpm-macros.spec new file mode 100644 index 0000000..a85de7d --- /dev/null +++ b/specs/go-srpm-macros/go-srpm-macros.spec @@ -0,0 +1,31 @@ +Name: go-srpm-macros +Version: 1 +Release: 1%{?dist} +Summary: RPM macros for building Golang packages for various architectures +Group: Development/Libraries +License: GPLv3+ +Source0: macros.go-srpm +BuildArch: noarch +# for install command +BuildRequires: coreutils + +%description +The package provides macros for building projects in Go +on various architectures. + +%prep +# nothing to prep, just for hooks + +%build +# nothing to build, just for hooks + +%install +install -m 644 -D "%{SOURCE0}" \ + '%{buildroot}%{_rpmconfigdir}/macros.d/macros.go-srpm' + +%files +%{_rpmconfigdir}/macros.d/macros.go-srpm + +%changelog +* Wed Mar 28 2018 Jakub Čajka +- initial sample package diff --git a/specs/go-srpm-macros/macros.go-srpm b/specs/go-srpm-macros/macros.go-srpm new file mode 120000 index 0000000..ad460fd --- /dev/null +++ b/specs/go-srpm-macros/macros.go-srpm @@ -0,0 +1 @@ +../../srpm/macros.d/macros.go-srpm \ No newline at end of file From 1c224bb51b2961b0686ceb99f9d989f865dea754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 28 Mar 2018 16:08:32 +0200 Subject: [PATCH 3/3] Add go-compilers example spec file --- specs/go-compilers/go-compilers.spec | 104 ++++++++++++++++++ specs/go-compilers/go-rpm-integration | 1 + specs/go-compilers/go.attr | 1 + specs/go-compilers/gobundled.attr | 1 + specs/go-compilers/gobundled.prov | 1 + specs/go-compilers/golist | 1 + specs/go-compilers/gosymlink.attr | 1 + specs/go-compilers/gosymlink.deps | 1 + specs/go-compilers/macros.go-compilers-gcc | 1 + specs/go-compilers/macros.go-compilers-golang | 1 + specs/go-compilers/macros.go-rpm | 1 + 11 files changed, 114 insertions(+) create mode 100644 specs/go-compilers/go-compilers.spec create mode 120000 specs/go-compilers/go-rpm-integration create mode 120000 specs/go-compilers/go.attr create mode 120000 specs/go-compilers/gobundled.attr create mode 120000 specs/go-compilers/gobundled.prov create mode 120000 specs/go-compilers/golist create mode 120000 specs/go-compilers/gosymlink.attr create mode 120000 specs/go-compilers/gosymlink.deps create mode 120000 specs/go-compilers/macros.go-compilers-gcc create mode 120000 specs/go-compilers/macros.go-compilers-golang create mode 120000 specs/go-compilers/macros.go-rpm diff --git a/specs/go-compilers/go-compilers.spec b/specs/go-compilers/go-compilers.spec new file mode 100644 index 0000000..3856d22 --- /dev/null +++ b/specs/go-compilers/go-compilers.spec @@ -0,0 +1,104 @@ +Name: go-compilers +Version: 1 +Release: 1%{?dist} +Summary: Go language compilers for various architectures +Group: Development/Tools +License: GPLv3+ +Source0: macros.go-compilers-golang +Source1: macros.go-compilers-gcc +Source2: macros.go-rpm +Source3: gobundled.prov +Source4: gosymlink.deps +Source5: go.attr +Source6: gobundled.attr +Source7: gosymlink.attr +Source8: go-rpm-integration +Source9: golist + + +ExclusiveArch: %{go_arches} + +# for install, cut and rm commands +BuildRequires: coreutils +# for go specific macros +BuildRequires: go-srpm-macros + +%description +The package provides correct golang language compiler +base on an architectures. + +%ifarch %{golang_arches} +%package golang-compiler +Summary: compiler for golang + +BuildRequires: golang + +Requires: golang + +Provides: compiler(go-compiler) = 2 +Provides: compiler(golang) + +%description golang-compiler +Compiler for golang. +%endif + +%ifarch %{gccgo_arches} +%package gcc-go-compiler +Summary: compiler for gcc-go + +# GCC>=5 holds in Fedora now +Requires: gcc-go + +Provides: compiler(go-compiler) = 1 +Provides: compiler(gcc-go) + +%description gcc-go-compiler +Compiler for gcc-go. +%endif + +%prep + +%build + +%install +%ifarch %{golang_arches} +# executables +install -m 755 -D %{SOURCE8} %{buildroot}%{_bindir}/go-rpm-integration +install -m 755 -D %{SOURCE3} %{buildroot}%{_rpmconfigdir}/gobundled.prov +install -m 755 -D %{SOURCE4} %{buildroot}%{_rpmconfigdir}/gosymlink.deps +# macros +install -m 644 -D %{SOURCE0} %{buildroot}%{_rpmconfigdir}/macros.d/macros.go-compilers-golang +install -m 644 -D %{SOURCE2} %{buildroot}%{_rpmconfigdir}/macros.d/macros.go-rpm +# attrs +install -m 644 -D %{SOURCE5} %{buildroot}%{_rpmconfigdir}/fileattrs/go.attr +install -m 644 -D %{SOURCE6} %{buildroot}%{_rpmconfigdir}/fileattrs/gobundled.attr +install -m 644 -D %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/gosymlink.attr + +install -D -p -m 0755 %{SOURCE9} %{buildroot}%{_bindir}/golist +%endif + +%ifarch %{gccgo_arches} +install -m 644 -D %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/macros.go-compilers-gcc +%endif + +%ifarch %{golang_arches} +%files golang-compiler +%{_rpmconfigdir}/macros.d/macros.go-compilers-golang +%{_rpmconfigdir}/macros.d/macros.go-rpm +%{_rpmconfigdir}/gobundled.prov +%{_rpmconfigdir}/gosymlink.deps +%{_rpmconfigdir}/fileattrs/go.attr +%{_rpmconfigdir}/fileattrs/gobundled.attr +%{_rpmconfigdir}/fileattrs/gosymlink.attr +%{_bindir}/golist +%{_bindir}/go-rpm-integration +%endif + +%ifarch %{gccgo_arches} +%files gcc-go-compiler +%{_rpmconfigdir}/macros.d/macros.go-compilers-gcc +%endif + +%changelog +* Wed Mar 28 2018 Jakub Čajka - 1-1 +- initial sample package diff --git a/specs/go-compilers/go-rpm-integration b/specs/go-compilers/go-rpm-integration new file mode 120000 index 0000000..f0c9eef --- /dev/null +++ b/specs/go-compilers/go-rpm-integration @@ -0,0 +1 @@ +../../bin/go-rpm-integration \ No newline at end of file diff --git a/specs/go-compilers/go.attr b/specs/go-compilers/go.attr new file mode 120000 index 0000000..c86b47b --- /dev/null +++ b/specs/go-compilers/go.attr @@ -0,0 +1 @@ +../../rpm/fileattrs/go.attr \ No newline at end of file diff --git a/specs/go-compilers/gobundled.attr b/specs/go-compilers/gobundled.attr new file mode 120000 index 0000000..a02b9ab --- /dev/null +++ b/specs/go-compilers/gobundled.attr @@ -0,0 +1 @@ +../../rpm/fileattrs/gobundled.attr \ No newline at end of file diff --git a/specs/go-compilers/gobundled.prov b/specs/go-compilers/gobundled.prov new file mode 120000 index 0000000..1b4106e --- /dev/null +++ b/specs/go-compilers/gobundled.prov @@ -0,0 +1 @@ +../../rpm/gobundled.prov \ No newline at end of file diff --git a/specs/go-compilers/golist b/specs/go-compilers/golist new file mode 120000 index 0000000..29d0187 --- /dev/null +++ b/specs/go-compilers/golist @@ -0,0 +1 @@ +../../bin/golist \ No newline at end of file diff --git a/specs/go-compilers/gosymlink.attr b/specs/go-compilers/gosymlink.attr new file mode 120000 index 0000000..46422a8 --- /dev/null +++ b/specs/go-compilers/gosymlink.attr @@ -0,0 +1 @@ +../../rpm/fileattrs/gosymlink.attr \ No newline at end of file diff --git a/specs/go-compilers/gosymlink.deps b/specs/go-compilers/gosymlink.deps new file mode 120000 index 0000000..35a3c6a --- /dev/null +++ b/specs/go-compilers/gosymlink.deps @@ -0,0 +1 @@ +../../rpm/gosymlink.deps \ No newline at end of file diff --git a/specs/go-compilers/macros.go-compilers-gcc b/specs/go-compilers/macros.go-compilers-gcc new file mode 120000 index 0000000..cd97ce7 --- /dev/null +++ b/specs/go-compilers/macros.go-compilers-gcc @@ -0,0 +1 @@ +../../rpm/macros.d/macros.go-compilers-gcc \ No newline at end of file diff --git a/specs/go-compilers/macros.go-compilers-golang b/specs/go-compilers/macros.go-compilers-golang new file mode 120000 index 0000000..b897119 --- /dev/null +++ b/specs/go-compilers/macros.go-compilers-golang @@ -0,0 +1 @@ +../../rpm/macros.d/macros.go-compilers-golang \ No newline at end of file diff --git a/specs/go-compilers/macros.go-rpm b/specs/go-compilers/macros.go-rpm new file mode 120000 index 0000000..3cf6da9 --- /dev/null +++ b/specs/go-compilers/macros.go-rpm @@ -0,0 +1 @@ +../../rpm/macros.d/macros.go-rpm \ No newline at end of file