%global debug_package %{nil} %global provider github %global provider_tld com %global project 10gen %global repo openssl # https://github.com/10gen/openssl %global import_path %{provider}.%{provider_tld}/%{project}/%{repo} %global commit 4c6dbafa5ec35b3ffc6a1b1e1fe29c3eba2053ec %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: golang-%{provider}-%{project}-%{repo} Version: 0 Release: 0.1.git%{shortcommit}%{?dist} Summary: OpenSSL bindings for Go (forked from github.com/spacemonkeygo/openssl) License: ASL 2.0 URL: https://%{import_path} Source0: https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz Patch0: change-import-path-prefix.patch Patch1: use-system-openssl.patch %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 BuildArch: noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} %endif %description %{summary} %package devel Summary: %{summary} BuildRequires: openssl-libs BuildRequires: openssl-devel BuildRequires: golang >= 1.2.1-3 BuildRequires: golang(github.com/spacemonkeygo/spacelog) Requires: golang(github.com/spacemonkeygo/spacelog) Provides: golang(%{import_path}) = %{version}-%{release} Provides: golang(%{import_path}/utils) = %{version}-%{release} %description devel %{summary} This package contains library source intended for building other packages which use %{project}/%{repo}. %prep %setup -q -n %{repo}-%{commit} %patch0 -p1 %patch1 -p1 %build %install # as per commit 'removing code incompatible with openssl 0.9.8e', # NewGCMDecryptionCipherCtx function no longer exists rm -rf ciphers_test.go install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ cp -pav *.c *.go %{buildroot}/%{gopath}/src/%{import_path}/ # copy directories for file in ./* ; do if [ -d $file ]; then cp -rpav $file %{buildroot}%{gopath}/src/%{import_path}/ fi done %check export GOPATH=%{buildroot}/%{gopath}:%{gopath}:/usr/include:/usr/lib64 go test %{import_path} %files devel %if 0%{?fedora} %license LICENSE %doc README.md %else %doc README.md LICENSE %endif %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} %{gopath}/src/%{import_path} %changelog * Mon Jun 15 2015 Marek Skalicky - 0-0.1.git4c6dbaf - First package for Fedora