Browse Source

peco 0.3.5-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@9983 ec354946-7b23-47d6-9f5a-488ba84defc7
iwaim 8 years ago
parent
commit
b7895aa21a
2 changed files with 97 additions and 0 deletions
  1. 32 0
      p/peco/peco-0.3.5_make.patch
  2. 65 0
      p/peco/peco-vl.spec

+ 32 - 0
p/peco/peco-0.3.5_make.patch

@@ -0,0 +1,32 @@
+diff --git a/build/make.go b/build/make.go
+index c094249..ac8936b 100644
+--- a/build/make.go
++++ b/build/make.go
+@@ -59,6 +59,9 @@ func main() {
+ 	case "build":
+ 		setupDeps()
+ 		buildBinaries()
++	case "build-single":
++		setupPecoInGopath()
++		buildSingleBinary()
+ 	default:
+ 		panic("Unknown action: " + action)
+ 	}
+@@ -201,6 +204,17 @@ func buildBinaryFor(osname, arch string) {
+ 	run("mv", file, filepath.Join(getBuildDir(), "artifacts"))
+ }
+ 
++func buildSingleBinary() {
++	buildDir := getBuildDir()
++	var goPath = fmt.Sprintf("%s:%s", buildDir, os.Getenv("GOPATH"))
++	os.Setenv("GOPATH", goPath)
++
++	run("go", "build", "-o",
++		filepath.Join("peco", "peco"),
++		filepath.Join("cmd", "peco", "peco.go"),
++	)
++}
++
+ func run(name string, args ...string) error {
+ 	splat := []string{name}
+ 	splat = append(splat, args...)

+ 65 - 0
p/peco/peco-vl.spec

@@ -0,0 +1,65 @@
+%global provider        github
+%global provider_tld    com
+%global project         peco
+%global repo            peco
+# https://github.com/peco/peco
+%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
+%global import_path     %{provider_prefix}
+#%global commit          none
+#%global shortcommit     %(c=%{commit}; echo ${c:0:7})
+
+Name:           peco
+Version:        0.3.5
+Release:        1%{?dist}
+Summary:        Simplistic interactive filtering tool
+License:        MIT
+URL:            https://%{import_path}
+Source0:        https://github.com/peco/peco/archive/v%{version}.tar.gz#/peco-%{version}.tar.gz
+Patch0:         peco-0.3.5_make.patch
+
+BuildRequires:  golang
+BuildRequires:  golang(github.com/google/btree)
+BuildRequires:  golang(github.com/mattn/go-runewidth)
+BuildRequires:  golang(github.com/jessevdk/go-flags)
+BuildRequires:  golang(github.com/nsf/termbox-go)
+
+Vendor: Project Vine
+Distribution: Vine Linux
+Packager: iwaim
+
+# If go_arches not defined fall through to implicit golang archs
+%if 0%{?go_arches:1}
+ExclusiveArch:  %{go_arches}
+%else
+ExclusiveArch:  %{ix86} x86_64 %{arm}
+%endif
+
+%description
+%{summary}.
+
+%prep
+%setup -q -n %{repo}-%{version}
+%patch0 -p1
+
+%build
+export GOPATH=$(pwd):%{gopath}
+%__mkdir_p src/github.com/peco/peco
+%__ln_s $(pwd)/internal src/github.com/peco/peco/
+go build -o make build/make.go
+./make build-single
+
+%install
+rm -rf ${RPM_BUILD_ROOT}
+mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
+
+%__install -m 0755 ./peco/peco ${RPM_BUILD_ROOT}%{_bindir}
+
+%files
+%doc LICENSE
+%doc README.md Changes
+%{_bindir}/peco
+
+%changelog
+* Sun Jan 24 2016 IWAI, Masaharu <iwaim.sub@gmail.com> 0.3.5-1
+- initial build for Vine Linux
+