]> git.pld-linux.org Git - projects/template-specs.git/blame - golang-package.spec
- adjusted noarch subpackage rules and some descriptions, more pl
[projects/template-specs.git] / golang-package.spec
CommitLineData
9e1ccb8f
ER
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
4e856b2a
ER
7Summary: -
8Summary(pl.UTF-8): -
9e1ccb8f 9Name: golang-github-template-%{pkgname}
4e856b2a
ER
10Version: _
11Release: 0.1
12License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
9e1ccb8f 13Group: Libraries
4e856b2a
ER
14Source0: %{name}-%{version}.tar.gz
15# Source0-md5: -
16URL: -
17BuildRequires: golang >= 1.3.1
09ee490b
JB
18# if using noarchpackage
19#BuildRequires: rpmbuild(macros) >= 1.752
4e856b2a
ER
20BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22%define _enable_debug_packages 0
9e1ccb8f
ER
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}
4e856b2a
ER
26
27%description
28A package written in go language
29
9e1ccb8f
ER
30%package devel
31Summary: %{summary}
32Group: Development/Languages
33#Requires: golang(github.com/../...)
34Provides: golang(%{import_path}) = %{version}-%{release}
09ee490b 35%{?noarchpackage}
9e1ccb8f
ER
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.
4e856b2a
ER
42
43%prep
44%setup -q
45
57e15cf3
ER
46install -d src/$(dirname %{import_path})
47ln -s ../../.. src/%{import_path}
48
45e36d7d
ER
49# alternative
50install -d src/$(dirname %{import_path})
09ee490b 51%{__mv} %{name}-%{version} src/%{import_path}
45e36d7d 52
4e856b2a 53%build
57e15cf3
ER
54export GOPATH=$(pwd)
55
3073cb6f 56%gobuild -o bin/%{name}
4e856b2a
ER
57
58%install
59rm -rf $RPM_BUILD_ROOT
3073cb6f
ER
60install -d $RPM_BUILD_ROOT%{_bindir}
61install -p bin/%{name} $RPM_BUILD_ROOT%{_bindir}
4e856b2a
ER
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.09406 seconds and 4 git commands to generate.