]> git.pld-linux.org Git - projects/template-specs.git/blob - golang-package.spec
ae3428f6aa79b9a27da740923d2ab22c1c66fe0a
[projects/template-specs.git] / golang-package.spec
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
7 Summary:        -
8 Summary(pl.UTF-8):      -
9 Name:           golang-github-template-%{pkgname}
10 Version:        _
11 Release:        0.1
12 License:        - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
13 Group:          Libraries
14 Source0:        %{name}-%{version}.tar.gz
15 # Source0-md5:  -
16 URL:            -
17 BuildRequires:  golang >= 1.3.1
18 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19
20 %define         _enable_debug_packages 0
21 %define         gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
22 %define         gopath          %{_libdir}/golang
23 %define         import_path     github.com/russross/%{pkgname}
24
25 %description
26 A package written in go language
27
28 %package devel
29 Summary:        %{summary}
30 Group:          Development/Languages
31 #Requires:      golang(github.com/../...)
32 Provides:       golang(%{import_path}) = %{version}-%{release}
33 # noarch subpackages only when supported by rpm
34 %if "%{_rpmversion}" >= "4.6"
35 BuildArch:      noarch
36 %endif
37
38 %description devel
39 %{summary}
40
41 This package contains library source intended for building other
42 packages which use import path with %{import_path} prefix.
43
44 %prep
45 %setup -q
46
47 install -d src/$(dirname %{import_path})
48 ln -s ../../.. src/%{import_path}
49
50 # alternative
51 install -d src/$(dirname %{import_path})
52 mv %{name}-%{version} src/%{import_path}
53
54 %build
55 export GOPATH=$(pwd)
56
57 %gobuild -o bin/%{name}
58
59 %install
60 rm -rf $RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT%{_bindir}
62 install -p bin/%{name} $RPM_BUILD_ROOT%{_bindir}
63
64 %clean
65 rm -rf $RPM_BUILD_ROOT
66
67 %files
68 %defattr(644,root,root,755)
69 %doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO
This page took 0.03785 seconds and 2 git commands to generate.