# # Conditional build: %bcond_without src # build devel package with sources %bcond_without tests # build without tests %define pkgname template Summary: - Summary(pl.UTF-8): - Name: golang-github-template-%{pkgname} Version: _ Release: 0.1 License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here) Group: Libraries Source0: %{name}-%{version}.tar.gz # Source0-md5: - URL: - BuildRequires: golang >= 1.3.1 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _enable_debug_packages 0 %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; %define gopath %{_libdir}/golang %define import_path github.com/russross/%{pkgname} %description A package written in go language %package devel Summary: %{summary} Group: Development/Languages #Requires: golang(github.com/../...) Provides: golang(%{import_path}) = %{version}-%{release} # noarch subpackages only when building with rpm5 %if "%{_rpmversion}" >= "5" BuildArch: noarch %endif %description devel %{summary} This package contains library source intended for building other packages which use import path with %{import_path} prefix. %prep %setup -q install -d src/$(dirname %{import_path}) ln -s ../../.. src/%{import_path} # alternative install -d src/$(dirname %{import_path}) mv %{name}-%{version} src/%{import_path} %build export GOPATH=$(pwd) %gobuild -o bin/%{name} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_bindir} install -p bin/%{name} $RPM_BUILD_ROOT%{_bindir} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO