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 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 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