3 %bcond_without src # build devel package with sources
4 %bcond_without tests # build without tests
6 %define pkgname blackfriday
7 Summary: Markdown processor implemented in Go
8 Name: golang-github-russross-%{pkgname}
13 Source0: https://github.com/russross/blackfriday/archive/v%{version}/blackfriday-%{version}.tar.gz
14 # Source0-md5: e66233912216753cc1b39875b81b74e2
15 URL: https://github.com/russross/blackfriday
16 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18 %define _enable_debug_packages 0
19 %define gopath %{_libdir}/golang
20 %define import_path github.com/russross/%{pkgname}
27 Group: Development/Languages
28 Requires: golang(github.com/shurcooL/sanitized_anchor_name)
29 Provides: golang(%{import_path}) = %{version}-%{release}
30 %if "%{_rpmversion}" >= "5"
37 This package contains library source intended for building other
38 packages which use import path with %{import_path} prefix.
41 %setup -q -n %{pkgname}-%{version}
44 export GOPATH=$(pwd):%{gopath}
47 go test %{import_path}
51 rm -rf $RPM_BUILD_ROOT
54 # find all *.go but no *_test.go files and generate devel.file-list
55 for file in $(find -iname "*.go" '!' -iname "*_test.go") ; do
56 install -d -p $RPM_BUILD_ROOT%{gopath}/src/%{import_path}/$(dirname $file)
57 cp -pav $file $RPM_BUILD_ROOT%{gopath}/src/%{import_path}/$file
58 echo "%{gopath}/src/%{import_path}/$file" >> devel.file-list
63 rm -rf $RPM_BUILD_ROOT
66 %files devel -f devel.file-list
67 %defattr(644,root,root,755)
69 %dir %{gopath}/src/github.com
70 %dir %{gopath}/src/github.com/russross
71 %dir %{gopath}/src/%{import_path}