diff --git a/.gitignore b/.gitignore index 2f06223..780aa5a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /govalidator-4918b99.tar.gz /govalidator-7.tar.gz /govalidator-8.tar.gz +/govalidator-9.tar.gz +/govalidator-f9ffefc3facfbe0caee3fea233cbb6e8208f4541.tar.gz diff --git a/golang-github-asaskevich-govalidator.spec b/golang-github-asaskevich-govalidator.spec index 55d064c..bc427ea 100644 --- a/golang-github-asaskevich-govalidator.spec +++ b/golang-github-asaskevich-govalidator.spec @@ -1,187 +1,58 @@ -# If any of the following macros should be set otherwise, -# you can wrap any of them with the following conditions: -# - %%if 0%%{centos} == 7 -# - %%if 0%%{?rhel} == 7 -# - %%if 0%%{?fedora} == 23 -# Or just test for particular distribution: -# - %%if 0%%{centos} -# - %%if 0%%{?rhel} -# - %%if 0%%{?fedora} -# -# Be aware, on centos, both %%rhel and %%centos are set. If you want to test -# rhel specific macros, you can use %%if 0%%{?rhel} && 0%%{?centos} == 0 condition. -# (Don't forget to replace double percentage symbol with single one in order to apply a condition) - -# Generate devel rpm -%global with_devel 1 -# Build project from bundled dependencies -%global with_bundled 0 -# Build with debug info rpm -%global with_debug 0 -# Run tests in check section -%global with_check 1 -# Generate unit-test rpm -%global with_unit_test 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 asaskevich -%global repo govalidator # https://github.com/asaskevich/govalidator -%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} -%global import_path %{provider_prefix} +%global goipath github.com/asaskevich/govalidator +%global commit f9ffefc3facfbe0caee3fea233cbb6e8208f4541 +Version: 9 -Name: golang-%{provider}-%{project}-%{repo} -Version: 8 -Release: 4%{?dist} +%gometa + +Name: %{goname} +Release: 1%{?dist} Summary: Validators and sanitizers for strings, numerics, slices and structs # Detected licences -# - MIT/X11 (BSD like) at 'LICENSE' +# - Expat License at 'LICENSE' License: MIT -URL: https://%{provider_prefix} -Source0: https://%{provider_prefix}/archive/v%{version}/%{repo}-%{version}.tar.gz -# Work around Go 1.10 changes to net/uri validation -# https://github.com/asaskevich/govalidator/issues/250 -Patch0: govalidator-8-irc-uri-testfix.patch - -# 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} %description -%{summary} +%{summary}. + -%if 0%{?with_devel} %package devel Summary: %{summary} BuildArch: noarch -%if 0%{?with_check} && ! 0%{?with_bundled} -%endif - - -Provides: golang(%{import_path}) = %{version}-%{release} - %description devel -%{summary} +%{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 -%if 0%{?with_check} -#Here comes all BuildRequires: PACKAGE the unit tests -#in %%check section need for running -%endif - -# test subpackage tests code from devel subpackage -Requires: %{name}-devel = %{version}-%{release} - -%if 0%{?with_check} && ! 0%{?with_bundled} -%endif +%{goipath} prefix. -%description unit-test-devel -%{summary} - -This package contains unit tests for project -providing packages with %{import_path} prefix. -%endif - %prep -%setup -q -n %{repo}-%{version} -%patch0 -p1 - -%build -%install -# 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 - -%check -%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} -%if ! 0%{?with_bundled} -export GOPATH=%{buildroot}/%{gopath}:%{gopath} -%else -# No dependency directories so far +%forgeautosetup -export GOPATH=%{buildroot}/%{gopath}:%{gopath} -%endif -%if ! 0%{?gotest:1} -%global gotest go test -%endif +%install +%goinstall -%gotest %{import_path} -%endif -#define license tag if not already defined -%{!?_licensedir:%global license %doc} +%check +# I think some tests need an Internet connection to work +%gochecks -d . -%if 0%{?with_devel} %files devel -f devel.file-list %license LICENSE -%doc README.md -%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} -%endif +%doc README.md CONTRIBUTING.md -%if 0%{?with_unit_test} && 0%{?with_devel} -%files unit-test-devel -f unit-test-devel.file-list -%license LICENSE -%doc README.md -%endif %changelog +* Mon Nov 12 2018 Robert-André Mauchin - 9-1.20181112gitf9ffefc +- bump to commit f9ffefc3facfbe0caee3fea233cbb6e8208f4541 +- Update to new Go packaging + * Fri Jul 13 2018 Fedora Release Engineering - 8-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild @@ -205,3 +76,4 @@ export GOPATH=%{buildroot}/%{gopath}:%{gopath} * Sat Mar 04 2017 Ed Marshall - 6-1 - First package for Fedora + diff --git a/govalidator-8-irc-uri-testfix.patch b/govalidator-8-irc-uri-testfix.patch deleted file mode 100644 index effeda9..0000000 --- a/govalidator-8-irc-uri-testfix.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -urN govalidator-8.orig/validator_test.go govalidator-8/validator_test.go ---- govalidator-8.orig/validator_test.go 2017-11-11 07:10:18.000000000 -0800 -+++ govalidator-8/validator_test.go 2018-01-14 12:29:54.433122224 -0800 -@@ -744,7 +744,7 @@ - {"http://www.foo---bar.com/", true}, - {"mailto:someone@example.com", true}, - {"irc://irc.server.org/channel", true}, -- {"irc://#channel@network", true}, -+ {"irc:///#channel@network", true}, - {"/abs/test/dir", false}, - {"./rel/test/dir", false}, - } -@@ -793,7 +793,7 @@ - {"http://www.foo---bar.com/", true}, - {"mailto:someone@example.com", true}, - {"irc://irc.server.org/channel", true}, -- {"irc://#channel@network", true}, -+ {"irc:///#channel@network", true}, - {"/abs/test/dir", true}, - {"./rel/test/dir", false}, - } diff --git a/sources b/sources index 9f37691..92a6b41 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (govalidator-8.tar.gz) = 63bbfdecdace4f2b73c18facaef2f1f4f3d04836e8ddd56c82a7b25072755b9f6770450c75eb26a873c93969cdf1e7a43ba82c07d9a131245798e2e887c5451e +SHA512 (govalidator-f9ffefc3facfbe0caee3fea233cbb6e8208f4541.tar.gz) = d1abf58f8d2ac7b9a497f274d015839febb2cfdea3c5e48b504125aede6d37f41c0bdb2d6295d7d63c65b447efdce081e633ea80587a172906c3a66ba676815f