]>
Commit | Line | Data |
---|---|---|
44eacf93 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 blackfriday | |
7 | Summary: Markdown processor implemented in Go | |
8 | Name: golang-github-russross-%{pkgname} | |
964088ec | 9 | Version: 1.4 |
a69d8e0f | 10 | Release: 2 |
44eacf93 ER |
11 | License: BSD |
12 | Group: Libraries | |
13 | Source0: https://github.com/russross/blackfriday/archive/v%{version}/blackfriday-%{version}.tar.gz | |
964088ec | 14 | # Source0-md5: e66233912216753cc1b39875b81b74e2 |
44eacf93 ER |
15 | URL: https://github.com/russross/blackfriday |
16 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
17 | ||
18 | %define _enable_debug_packages 0 | |
19 | %define gopath %{_libdir}/golang | |
20 | %define import_path github.com/russross/%{pkgname} | |
21 | ||
22 | %description | |
23 | %{summary}. | |
24 | ||
25 | %package devel | |
26 | Summary: %{summary} | |
27 | Group: Development/Languages | |
28 | Requires: golang(github.com/shurcooL/sanitized_anchor_name) | |
29 | Provides: golang(%{import_path}) = %{version}-%{release} | |
44eacf93 ER |
30 | |
31 | %description devel | |
32 | %{summary} | |
33 | ||
34 | This package contains library source intended for building other | |
35 | packages which use import path with %{import_path} prefix. | |
36 | ||
37 | %prep | |
38 | %setup -q -n %{pkgname}-%{version} | |
39 | ||
40 | %build | |
41 | export GOPATH=$(pwd):%{gopath} | |
42 | ||
43 | %if %{with test} | |
44 | go test %{import_path} | |
45 | %endif | |
46 | ||
47 | %install | |
48 | rm -rf $RPM_BUILD_ROOT | |
49 | ||
50 | %if %{with src} | |
51 | # find all *.go but no *_test.go files and generate devel.file-list | |
52 | for file in $(find -iname "*.go" '!' -iname "*_test.go") ; do | |
53 | install -d -p $RPM_BUILD_ROOT%{gopath}/src/%{import_path}/$(dirname $file) | |
54 | cp -pav $file $RPM_BUILD_ROOT%{gopath}/src/%{import_path}/$file | |
55 | echo "%{gopath}/src/%{import_path}/$file" >> devel.file-list | |
56 | done | |
57 | %endif | |
58 | ||
59 | %clean | |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | ||
62 | %if %{with src} | |
63 | %files devel -f devel.file-list | |
64 | %defattr(644,root,root,755) | |
65 | %doc README.md | |
66 | %dir %{gopath}/src/github.com | |
67 | %dir %{gopath}/src/github.com/russross | |
68 | %dir %{gopath}/src/%{import_path} | |
69 | %endif |