SPECS/pcstat/pcstat.spec
0c1e075e
 Summary:        A tool that inspect which pages of a file or files are being cached by the Linux kernel
 Name:           pcstat 
 Version:        1
743bd259
 Release:        6%{?dist}
0c1e075e
 License:        Apache 
 URL:            https://github.com/tobert/pcstat
 Group:          Development/Debuggers
 Vendor:         VMware, Inc.
 Distribution:   Photon
 Source0:        https://github.com/tobert/pcstat/archive/pcstat-1.zip
 %define sha1    pcstat=cd67c42d291763597dbe3fb19e8e367c54a4a898
8bbf4fc0
 Source1:        https://github.com/golang/sys/golang-sys-08-02-2017.zip
 %define sha1    golang-sys=7f713451011d127755448c6603c15dc907bc47bc
743bd259
 Patch0:         pcstat-aarch64-support.patch
0c1e075e
 BuildRequires:  unzip go audit git
 Requires:       go
240fe8c8
 %description
 A tool that inspect which pages of a file or files are being cached by the Linux kernel
 
 %prep
 %setup -qn pcstat-master
743bd259
 %patch0 -p1
 
240fe8c8
 %build
0c1e075e
 cd ..
8bbf4fc0
 unzip %{SOURCE1}
0c1e075e
 mkdir -p build/src/github.com/tobert/pcstat
8bbf4fc0
 mkdir -p build/src/golang.org/x/sys
0c1e075e
 mkdir -p build/bin
 cp -r pcstat-master/* build/src/github.com/tobert/pcstat/.
8bbf4fc0
 cp -r sys-master/* build/src/golang.org/x/sys
0c1e075e
 cd build
 export GOPATH=`pwd`
 cd bin
 export GOBIN=`pwd`
 export PATH=$PATH:$GOBIN
 cd ../src/github.com/tobert/pcstat
240fe8c8
 go build
0c1e075e
 cd pcstat
 go build
 go install
240fe8c8
 
 %install
9d454a1f
 mkdir -p %{buildroot}/%{_bindir}
 cp ../build/bin/pcstat %{buildroot}/%{_bindir}
240fe8c8
 
 %clean
 rm -rf %{buildroot}/*
 
0c1e075e
 %files
240fe8c8
 %defattr(-,root,root)
9d454a1f
 %{_bindir}/pcstat
240fe8c8
 
 %changelog
743bd259
 *   Wed Jan 03 2018 Alexey Makhalov <amakhalov@vmware.com> 1-6
 -   Aarch64 support
8bbf4fc0
 *   Wed Aug 02 2017 Dheeraj Shetty <dheerajs@vmware.com> 1-5
 -   Remove the build time dependencies and avoid downloading from github
9d454a1f
 *   Tue Mar 07 2017 XIaolin Li <xiaolinl@vmware.com> 1-4
 -   Moved executable from /usr/local/bin to /usr/bin.
0c1e075e
 *   Fri Feb 10 2017 Xiaolin Li <xiaolinl@vmware.com> 1-3
 -   Fix the build.
 *   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1-2
 -   GA - Bump release of all rpms
 *   Wed Nov 25 2015 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 0.7.3-1
 -   Initial build.  First version