diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..63ff7b5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/freetype-go-b763ddb.tar.gz diff --git a/golang-github-BurntSushi-freetype-go.spec b/golang-github-BurntSushi-freetype-go.spec new file mode 100644 index 0000000..1a459f3 --- /dev/null +++ b/golang-github-BurntSushi-freetype-go.spec @@ -0,0 +1,110 @@ +%global debug_package %{nil} + +%global provider github +%global provider_tld com +%global project BurntSushi +%global repo freetype-go +# https://github.com/BurntSushi/freetype-go +%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} +%global import_path %{provider_prefix} +%global commit b763ddbfe298bf71c999a2833470da508f3a0677 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +Name: golang-%{provider}-%{project}-%{repo} +Version: 0 +Release: 0.1.git%{shortcommit}%{?dist} +Summary: A fork of freetype-go with bounding box calculations +License: GPLv2+ or FTL +URL: https://%{provider_prefix} +Source0: %{url}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz + +# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required +ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}} +# If go_compiler is not set to 1, there is no virtual provide. Use golang instead. +BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} + +%description +%{summary}. + +%package devel +Summary: %{summary} +BuildArch: noarch +Provides: golang(%{import_path}/freetype) = %{version}-%{release} +Provides: golang(%{import_path}/freetype/truetype) = %{version}-%{release} +Provides: golang(%{import_path}/freetype/raster) = %{version}-%{release} + +%description devel +%{summary}. + +This package contains library source intended for +building other packages which use import path with +%{import_path} prefix. + +%package unit-test-devel +Summary: Unit tests for %{name} package +BuildArch: noarch +# test subpackage tests code from devel subpackage +Requires: %{name}-devel = %{version}-%{release} + +%description unit-test-devel +%{summary}. + +This package contains unit tests for project +providing packages with %{import_path} prefix. + + +%prep +%setup -q -n %{repo}-%{commit} + +%build + +%install +# source codes for building projects +install -d -p %{buildroot}%{gopath}/src/%{import_path}/ +echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list +# find all *.go but no *_test.go files and generate devel.file-list +for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list + install -d -p %{buildroot}%{gopath}/src/%{import_path}/$(dirname $file) + cp -pav $file %{buildroot}%{gopath}/src/%{import_path}/$file + echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list +done + +# testing files for this project +install -d %{buildroot}%{gopath}/src/%{import_path}/ +# find all *_test.go files and generate unit-test.file-list +for file in $(find . -iname "*_test.go" -or -iname "luxi-fonts"); do + dirprefix=$(dirname $file) + install -d -p %{buildroot}%{gopath}/src/%{import_path}/$dirprefix + cp -pav $file %{buildroot}%{gopath}/src/%{import_path}/$file + echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list + while [ "$dirprefix" != "." ]; do + echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list + dirprefix=$(dirname $dirprefix) + done +done + +sort -u -o devel.file-list devel.file-list +sort -u -o unit-test-devel.file-list unit-test-devel.file-list + +%check +export GOPATH=%{buildroot}%{gopath}:%{gopath} + +%if ! 0%{?gotest:1} +%global gotest go test +%endif + +%gotest %{import_path}/freetype +%gotest %{import_path}/freetype/raster +%gotest %{import_path}/freetype/truetype + +%files devel -f devel.file-list +%doc README +%license LICENSE +%dir %{gopath}/src/%{import_path} + +%files unit-test-devel -f unit-test-devel.file-list + +%changelog +* Mon Aug 7 2017 mosquito - 0-0.1.gitb763ddb +- Initial package build diff --git a/sources b/sources new file mode 100644 index 0000000..28c75bc --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (freetype-go-b763ddb.tar.gz) = 3e56e8375dc634a42cad2cbc6fb6e65a27ea94ce97513c428a9367922525b12ca05ccae7322256e537ac67a5846c3dfd2d2c9eee5beeb7f9a6a0ce3cdfa97de8