diff --git a/.gitignore b/.gitignore index 22dd706..1af01a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /cznic-golex-d7f6f2b.tar.gz /cznic-golex-4ab7c5e.tar.gz +/golex-4ab7c5e190e49208c823ce8ec803aa39e6a4b31a.tar.gz diff --git a/golang-github-cznic-golex.spec b/golang-github-cznic-golex.spec index 8135ccb..e4bd210 100644 --- a/golang-github-cznic-golex.spec +++ b/golang-github-cznic-golex.spec @@ -1,197 +1,77 @@ -# Generate devel rpm -%global with_devel 1 -# Build project from bundled dependencies -%global with_bundled 0 -# Build with debug info rpm -%global with_debug 1 -# Run tests in check section -%global with_check 1 -# Generate unit-test rpm -%global with_unit_test 1 -# Build command line tool -%global with_cli_tool 1 - -%if 0%{?with_debug} -%global _dwz_low_mem_die_limit 0 -%else -%global debug_package %{nil} -%endif - -%global provider github -%global provider_tld com -%global project cznic -%global repo golex # https://github.com/cznic/golex -%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} -%global import_path %{provider_prefix} -%global commit 4ab7c5e190e49208c823ce8ec803aa39e6a4b31a -%global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global commitdate 20170803 +%global goipath github.com/cznic/golex +%global commit 4ab7c5e190e49208c823ce8ec803aa39e6a4b31a +%global date 20170803 +%gometa -Name: golang-%{provider}-%{project}-%{repo} +Name: golang-github-cznic-golex Version: 0 -Release: 0.6.%{commitdate}.git%{shortcommit}%{?dist} +Release: 0.7%{?dist} Summary: Lex/Flex-like utility written in Go License: BSD -URL: https://%{provider_prefix} -Source0: https://%{provider_prefix}/archive/%{commit}/%{project}-%{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 aarch64 %{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} +URL: %{gourl} +Source0: %{gosource} -%if 0%{?with_cli_tool} Provides: golex%{?_isa} = %{version}-%{release} BuildRequires: golang(github.com/cznic/lex) BuildRequires: golang(github.com/cznic/lexer) -%endif %description %{summary} -%if 0%{?with_devel} %package devel Summary: %{summary} BuildArch: noarch -%if 0%{?with_check} && ! 0%{?with_bundled} -BuildRequires: golang(github.com/cznic/lex) -BuildRequires: golang(github.com/cznic/lexer) -%endif - -Provides: golang(%{import_path}/lex) = %{version}-%{release} - %description devel %{summary} This package contains library source intended for building other packages which use import path with -%{import_path} prefix. -%endif - - -%if 0%{?with_unit_test} && 0%{?with_devel} -%package unit-test-devel -Summary: Unit tests for %{name} package - -# 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. -%endif +%{goipath} prefix. %prep -%setup -q -n %{repo}-%{commit} +%gosetup -q %build -%if 0%{?with_cli_tool} -# prepare build environment -mkdir -p ./_build/src/%{provider}.%{provider_tld}/%{project} -ln -s $(pwd) ./_build/src/%{import_path} +%gobuildroot -# run build and set version correctly -export GOPATH=$(pwd)/_build:%{gopath} -%gobuild -o bin/golex %{import_path} -%endif +%gobuild -o _bin/golex %{goipath} %install -%if 0%{?with_cli_tool} -mkdir -p %{buildroot}/%{_bindir} -cp -pav ./bin/golex %{buildroot}/%{_bindir}/ -%endif - -# source codes for building projects -%if 0%{?with_devel} -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" -or -iname "*.s" \) \! -iname "*_test.go") ; 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" >> devel.file-list - - while [ "$dirprefix" != "." ]; do - echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list - dirprefix=$(dirname $dirprefix) - done -done -%endif - -# testing files for this project -%if 0%{?with_unit_test} && 0%{?with_devel} -install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ - -# find all *_test.go files and generate unit-test-devel.file-list -for file in $(find . -iname "*_test.go") ; 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 -%endif - -%if 0%{?with_devel} -sort -u -o devel.file-list devel.file-list -%endif +install -d -p %{buildroot}%{_bindir} +install -p -m 0755 _bin/golex %{buildroot}%{_bindir} +%goinstall -%check -%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} -export GOPATH=%{buildroot}/%{gopath}:%{gopath} - -%if ! 0%{?gotest:1} -%global gotest go test -%endif - -%gotest %{import_path} -%gotest %{import_path}/lex -%endif - -#define license tag if not already defined -%{!?_licensedir:%global license %doc} +%check +%gochecks -%if 0%{?with_cli_tool} %files %license LICENSE -%doc CONTRIBUTORS README AUTHORS +%doc CONTRIBUTORS AUTHORS README + %{_bindir}/golex -%endif -%if 0%{?with_devel} -%files devel -f devel.file-list -%license LICENSE -%doc CONTRIBUTORS README AUTHORS -%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} -%endif -%if 0%{?with_unit_test} && 0%{?with_devel} -%files unit-test-devel -f unit-test-devel.file-list +%files devel -f devel.file-list %license LICENSE -%doc CONTRIBUTORS README AUTHORS -%endif +%doc CONTRIBUTORS AUTHORS README %changelog +* Fri Aug 31 2018 Fabio Valentini - 0-0.7.20170803git4ab7c5e +- Update to use spec 3.0. + * Fri Jul 13 2018 Fedora Release Engineering - 0-0.6.20170803.git4ab7c5e - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild diff --git a/sources b/sources index 9fd1c59..fc302c6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cznic-golex-4ab7c5e.tar.gz) = 710a0244412c4c22790032ea427a847401af24362e0db9c0766d3d73c2992b6b854bd05624b1f1a719646ef0f63cade0c91b786d76ec9d6366e47a8d17ba8dd0 +SHA512 (golex-4ab7c5e190e49208c823ce8ec803aa39e6a4b31a.tar.gz) = 710a0244412c4c22790032ea427a847401af24362e0db9c0766d3d73c2992b6b854bd05624b1f1a719646ef0f63cade0c91b786d76ec9d6366e47a8d17ba8dd0