2011-05-19 20:17:10 +02:00
|
|
|
# Macros for Go module building.
|
|
|
|
#
|
|
|
|
# Copyright (c) 2011 Sascha Peilicke <saschpe@gmx.de>
|
|
|
|
#
|
|
|
|
|
2011-05-23 12:33:44 +02:00
|
|
|
%go_ver %(LC_ALL=C rpm -q --qf '%%{epoch}:%%{version}\\n' go | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
2011-05-20 11:29:51 +02:00
|
|
|
%go_arch GOARCH
|
2011-05-19 20:17:10 +02:00
|
|
|
|
|
|
|
%go_dir %{_libdir}/go
|
|
|
|
%go_sitedir %{_libdir}/go/pkg
|
2011-05-19 22:36:34 +02:00
|
|
|
%go_sitearch %{_libdir}/go/pkg/linux_%{go_arch}
|
2011-05-19 20:17:10 +02:00
|
|
|
|
2011-06-30 11:18:52 +02:00
|
|
|
%go_requires %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} >= %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
2011-05-19 20:17:10 +02:00
|
|
|
|
2011-05-19 20:23:17 +02:00
|
|
|
%go_provides \
|
2011-05-21 14:19:45 +02:00
|
|
|
Provides: %{name}-devel = %{version} \
|
|
|
|
Provides: %{name}-devel-static = %{version}
|
2011-05-19 20:17:10 +02:00
|
|
|
|
2011-06-30 11:18:52 +02:00
|
|
|
%go_disable_brp_strip_static_archive \
|
|
|
|
%define __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib/rpm/[^/]*/?brp-strip-static-archive %{__strip}!!g')
|
|
|
|
|
|
|
|
%go_make HOST_EXTRA_CFLAGS="%{optflags}" gomake
|
|
|
|
%go_make_install HOST_EXTRA_CFLAGS="%{optflags}" TARGDIR=%{buildroot}%{go_sitearch} gomake install
|
|
|
|
%go_make_test HOST_EXTRA_CFLAGS="%{optflags}" gomake test
|