]> git.pld-linux.org Git - projects/template-specs.git/blame_incremental - golang-package.spec
- use explicit PYTEST_PLUGINS lists for reliable tests (not failing if some conflicti...
[projects/template-specs.git] / golang-package.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_without src # build devel package with sources
4%bcond_without tests # build without tests
5
6%define pkgname template
7Summary: -
8Summary(pl.UTF-8): -
9Name: golang-github-template-%{pkgname}
10Version: _
11Release: 0.1
12License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
13Group: Libraries
14Source0: %{name}-%{version}.tar.gz
15# Source0-md5: -
16URL: -
17BuildRequires: golang >= 1.3.1
18# if using noarch subpackage
19#BuildRequires: rpm-build >= 4.6
20BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
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}
26
27%description
28A package written in go language
29
30%package devel
31Summary: %{summary}
32Group: Development/Languages
33#Requires: golang(github.com/../...)
34Provides: golang(%{import_path}) = %{version}-%{release}
35BuildArch: noarch
36
37%description devel
38%{summary}
39
40This package contains library source intended for building other
41packages which use import path with %{import_path} prefix.
42
43%prep
44%setup -q
45
46install -d src/$(dirname %{import_path})
47ln -s ../../.. src/%{import_path}
48
49# alternative
50install -d src/$(dirname %{import_path})
51%{__mv} %{name}-%{version} src/%{import_path}
52
53%build
54export GOPATH=$(pwd)
55
56%gobuild -o bin/%{name}
57
58%install
59rm -rf $RPM_BUILD_ROOT
60install -d $RPM_BUILD_ROOT%{_bindir}
61install -p bin/%{name} $RPM_BUILD_ROOT%{_bindir}
62
63%clean
64rm -rf $RPM_BUILD_ROOT
65
66%files
67%defattr(644,root,root,755)
68%doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO
This page took 0.053344 seconds and 4 git commands to generate.