3 %bcond_without src # build devel package with sources
4 %bcond_without tests # build without tests
6 %define pkgname template
9 Name: golang-github-template-%{pkgname}
12 License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
14 Source0: %{name}-%{version}.tar.gz
17 BuildRequires: golang >= 1.3.1
18 # if using noarchpackage
19 #BuildRequires: rpmbuild(macros) >= 1.752
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 %define _enable_debug_packages 0
23 %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
24 %define gopath %{_libdir}/golang
25 %define import_path github.com/russross/%{pkgname}
28 A package written in go language
32 Group: Development/Languages
33 #Requires: golang(github.com/../...)
34 Provides: golang(%{import_path}) = %{version}-%{release}
40 This package contains library source intended for building other
41 packages which use import path with %{import_path} prefix.
46 install -d src/$(dirname %{import_path})
47 ln -s ../../.. src/%{import_path}
50 install -d src/$(dirname %{import_path})
51 %{__mv} %{name}-%{version} src/%{import_path}
56 %gobuild -o bin/%{name}
59 rm -rf $RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT%{_bindir}
61 install -p bin/%{name} $RPM_BUILD_ROOT%{_bindir}
64 rm -rf $RPM_BUILD_ROOT
67 %defattr(644,root,root,755)
68 %doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO