[packages/golang] -shared subpackage, cgo bcond

glen glen at pld-linux.org
Mon Jun 13 19:42:08 CEST 2016


commit b327c497b2ca1787c534540e109574ce24423913
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Jun 13 20:41:56 2016 +0300

    -shared subpackage, cgo bcond

 golang.spec | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/golang.spec b/golang.spec
index 7584e28..f2f5b34 100644
--- a/golang.spec
+++ b/golang.spec
@@ -13,10 +13,12 @@
 %bcond_without	tests		# build without tests [nop actually]
 %bcond_without	shared		# Build golang shared objects for stdlib
 %bcond_without	ext_linker	# Build golang using external/internal(close to cgo disabled) linking.
+%bcond_without	cgo
 
 %ifnarch %{ix86} %{x8664} %{arm} ppc64le aarch64
 %undefine	with_shared
 %undefine	with_ext_linker
+%undefine	with_cgo
 %endif
 
 Summary:	Go compiler and tools
@@ -77,6 +79,14 @@ build simple, reliable, and efficient software.
 Go to mające otwarte źródła środowisko do programowania, pozwalające
 na łatwe tworzenie prostych, pewnych i wydajnych programów.
 
+%package shared
+Summary:	Golang shared object libraries
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description shared
+Golang shared object libraries
+
 %package doc
 Summary:	Manual for go
 Summary(fr.UTF-8):	Documentation pour go
@@ -125,7 +135,9 @@ export GOARCH=%{GOARCH}
 %if %{without external_linker}
 export GO_LDFLAGS="-linkmode internal"
 %endif
-%if %{without cgo_enabled}
+%if %{with cgo}
+export CGO_ENABLED=1
+%else
 export CGO_ENABLED=0
 %endif
 
@@ -242,10 +254,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/%{name}/pkg/bootstrap
 %{_libdir}/%{name}/pkg/include
 
-%if %{with shared}
-%{_libdir}/%{name}/pkg/linux_%{GOARCH}_dynlink
-%endif
-
 %if 0
 #ifarch %{x8664}
 %dir %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race
@@ -271,6 +279,12 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/%{name}/pkg/linux_%{GOARCH}_race/unicode
 %endif
 
+%if %{with shared}
+%files shared
+%defattr(644,root,root,755)
+%{_libdir}/%{name}/pkg/linux_%{GOARCH}_dynlink
+%endif
+
 %files doc
 %defattr(644,root,root,755)
 %doc doc/*
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/golang.git/commitdiff/b327c497b2ca1787c534540e109574ce24423913



More information about the pld-cvs-commit mailing list