pip_package: modularize build script to allow distros to install more flexibly
pip_package: modularize build script to allow distros to install more flexibly

Gentoo Linux handles python modules slightly differently and packaging
wheels is complicated. We prefer to run setup.py directly ourselves
rather than build a wheel and then install from there.

This modularizes build_pip_package.sh to allow running parts separately.
using --src srcdir will prepare the package in a known dir so the distro
package can take it from there. If only dstdir is given (either with
--dst or as the only argument to preserve backwards compat) then
behaviour is the same as before, the sources are prepared and the wheel
is built and placed in dstdir.

Signed-off-by: Jason Zaman <68c46a606457643eab92053c1c05574abb26f861@perfinion.com>

dancingdan/tensorflow,jalexvig/tensorflow,meteorcloudy/tensorflow,theflofly/tensorflow,kobejean/tensorflow,benoitsteiner/tensorflow-xsmm,snnn/tensorflow,ghchinoy/tensorflow,brchiu/tensorflow,apark263/tensorflow,gunan/tensorflow,Bismarrck/tensorflow,dendisuhubdy/tensorflow,ZhangXinNan/tensorflow,Bismarrck/tensorflow,aam-at/tensorflow,kobejean/tensorflow,davidzchen/tensorflow,nburn42/tensorflow,karllessard/tensorflow,lukeiwanski/tensorflow,kobejean/tensorflow,alsrgv/tensorflow,lukeiwanski/tensorflow,dendisuhubdy/tensorflow,drpngx/tensorflow,caisq/tensorflow,jendap/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow,freedomtan/tensorflow,theflofly/tensorflow,Intel-Corporation/tensorflow,ageron/tensorflow,hehongliang/tensorflow,aselle/tensorflow,apark263/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,asimshankar/tensorflow,yanchen036/tensorflow,manipopopo/tensorflow,asimshankar/tensorflow,annarev/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,alshedivat/tensorflow,meteorcloudy/tensorflow,freedomtan/tensorflow,gautam1858/tensorflow,aldian/tensorflow,asimshankar/tensorflow,dancingdan/tensorflow,jhseu/tensorflow,arborh/tensorflow,jalexvig/tensorflow,xodus7/tensorflow,theflofly/tensorflow,theflofly/tensorflow,adit-chandra/tensorflow,annarev/tensorflow,arborh/tensorflow,jalexvig/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-experimental_link_static_libraries_once,jhseu/tensorflow,dendisuhubdy/tensorflow,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,hehongliang/tensorflow,sarvex/tensorflow,DavidNorman/tensorflow,ZhangXinNan/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,lukeiwanski/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,Intel-Corporation/tensorflow,frreiss/tensorflow-fred,renyi533/tensorflow,asimshankar/tensorflow,ageron/tensorflow,DavidNorman/tensorflow,tensorflow/tensorflow,hehongliang/tensorflow,DavidNorman/tensorflow,arborh/tensorflow,alshedivat/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_saved_model,chemelnucfin/tensorflow,dongjoon-hyun/tensorflow,aselle/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_saved_model,AnishShah/tensorflow,alsrgv/tensorflow,girving/tensorflow,jhseu/tensorflow,gunan/tensorflow,dancingdan/tensorflow,DavidNorman/tensorflow,davidzchen/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yanchen036/tensorflow,annarev/tensorflow,hfp/tensorflow-xsmm,jhseu/tensorflow,kobejean/tensorflow,sarvex/tensorflow,kobejean/tensorflow,aselle/tensorflow,ghchinoy/tensorflow,renyi533/tensorflow,Bismarrck/tensorflow,AnishShah/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-pywrap_saved_model,seanli9jan/tensorflow,theflofly/tensorflow,asimshankar/tensorflow,tensorflow/tensorflow,drpngx/tensorflow,alshedivat/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,davidzchen/tensorflow,meteorcloudy/tensorflow,ghchinoy/tensorflow,kevin-coder/tensorflow-fork,theflofly/tensorflow,petewarden/tensorflow,brchiu/tensorflow,karllessard/tensorflow,freedomtan/tensorflow,jhseu/tensorflow,alshedivat/tensorflow,cxxgtxy/tensorflow,dancingdan/tensorflow,ageron/tensorflow,girving/tensorflow,sarvex/tensorflow,lukeiwanski/tensorflow,freedomtan/tensorflow,karllessard/tensorflow,ghchinoy/tensorflow,jhseu/tensorflow,frreiss/tensorflow-fred,dendisuhubdy/tensorflow,yanchen036/tensorflow,alsrgv/tensorflow,chemelnucfin/tensorflow,benoitsteiner/tensorflow-xsmm,arborh/tensorflow,adit-chandra/tensorflow,chemelnucfin/tensorflow,karllessard/tensorflow,gunan/tensorflow,chemelnucfin/tensorflow,renyi533/tensorflow,frreiss/tensorflow-fred,apark263/tensorflow,alshedivat/tensorflow,AnishShah/tensorflow,Bismarrck/tensorflow,kevin-coder/tensorflow-fork,drpngx/tensorflow,caisq/tensorflow,drpngx/tensorflow,manipopopo/tensorflow,gunan/tensorflow,manipopopo/tensorflow,theflofly/tensorflow,asimshankar/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,DavidNorman/tensorflow,tensorflow/tensorflow-pywrap_saved_model,seanli9jan/tensorflow,jbedorf/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-pywrap_saved_model,dongjoon-hyun/tensorflow,freedomtan/tensorflow,ZhangXinNan/tensorflow,gautam1858/tensorflow,snnn/tensorflow,Bismarrck/tensorflow,benoitsteiner/tensorflow-xsmm,dongjoon-hyun/tensorflow,alshedivat/tensorflow,davidzchen/tensorflow,manipopopo/tensorflow,xodus7/tensorflow,jendap/tensorflow,renyi533/tensorflow,jbedorf/tensorflow,Intel-Corporation/tensorflow,karllessard/tensorflow,xzturn/tensorflow,benoitsteiner/tensorflow-xsmm,hfp/tensorflow-xsmm,yongtang/tensorflow,dendisuhubdy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,freedomtan/tensorflow,gojira/tensorflow,ppwwyyxx/tensorflow,manipopopo/tensorflow,yongtang/tensorflow,kevin-coder/tensorflow-fork,chemelnucfin/tensorflow,hfp/tensorflow-xsmm,paolodedios/tensorflow,Intel-Corporation/tensorflow,jendap/tensorflow,ageron/tensorflow,alshedivat/tensorflow,aam-at/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jbedorf/tensorflow,adit-chandra/tensorflow,dancingdan/tensorflow,Intel-Corporation/tensorflow,lukeiwanski/tensorflow,apark263/tensorflow,gautam1858/tensorflow,jbedorf/tensorflow,caisq/tensorflow,jendap/tensorflow,aldian/tensorflow,cxxgtxy/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,kobejean/tensorflow,brchiu/tensorflow,jart/tensorflow,petewarden/tensorflow,dancingdan/tensorflow,alshedivat/tensorflow,freedomtan/tensorflow,ZhangXinNan/tensorflow,drpngx/tensorflow,karllessard/tensorflow,jart/tensorflow,DavidNorman/tensorflow,drpngx/tensorflow,jbedorf/tensorflow,asimshankar/tensorflow,petewarden/tensorflow,chemelnucfin/tensorflow,alsrgv/tensorflow,gautam1858/tensorflow,benoitsteiner/tensorflow-xsmm,Intel-Corporation/tensorflow,jendap/tensorflow,jalexvig/tensorflow,lukeiwanski/tensorflow,girving/tensorflow,adit-chandra/tensorflow,theflofly/tensorflow,xzturn/tensorflow,seanli9jan/tensorflow,kobejean/tensorflow,caisq/tensorflow,Intel-tensorflow/tensorflow,aam-at/tensorflow,gojira/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gunan/tensorflow,tensorflow/tensorflow,Bismarrck/tensorflow,DavidNorman/tensorflow,seanli9jan/tensorflow,jbedorf/tensorflow,drpngx/tensorflow,AnishShah/tensorflow,adit-chandra/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-pywrap_tf_optimizer,davidzchen/tensorflow,AnishShah/tensorflow,paolodedios/tensorflow,jart/tensorflow,xodus7/tensorflow,jalexvig/tensorflow,snnn/tensorflow,frreiss/tensorflow-fred,hfp/tensorflow-xsmm,girving/tensorflow,frreiss/tensorflow-fred,karllessard/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gojira/tensorflow,davidzchen/tensorflow,petewarden/tensorflow,aselle/tensorflow,renyi533/tensorflow,aldian/tensorflow,gautam1858/tensorflow,manipopopo/tensorflow,jhseu/tensorflow,gunan/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,gojira/tensorflow,kobejean/tensorflow,xzturn/tensorflow,Bismarrck/tensorflow,ppwwyyxx/tensorflow,aam-at/tensorflow,seanli9jan/tensorflow,apark263/tensorflow,caisq/tensorflow,AnishShah/tensorflow,drpngx/tensorflow,aselle/tensorflow,jart/tensorflow,Bismarrck/tensorflow,dancingdan/tensorflow,jbedorf/tensorflow,jendap/tensorflow,girving/tensorflow,gunan/tensorflow,frreiss/tensorflow-fred,dongjoon-hyun/tensorflow,jendap/tensorflow,tensorflow/tensorflow,Bismarrck/tensorflow,ghchinoy/tensorflow,lukeiwanski/tensorflow,snnn/tensorflow,nburn42/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,meteorcloudy/tensorflow,jalexvig/tensorflow,dongjoon-hyun/tensorflow,jbedorf/tensorflow,chemelnucfin/tensorflow,xodus7/tensorflow,jbedorf/tensorflow,paolodedios/tensorflow,dancingdan/tensorflow,ghchinoy/tensorflow,dongjoon-hyun/tensorflow,caisq/tensorflow,ageron/tensorflow,davidzchen/tensorflow,snnn/tensorflow,jhseu/tensorflow,asimshankar/tensorflow,aam-at/tensorflow,snnn/tensorflow,kevin-coder/tensorflow-fork,nburn42/tensorflow,freedomtan/tensorflow,Intel-tensorflow/tensorflow,kevin-coder/tensorflow-fork,renyi533/tensorflow,davidzchen/tensorflow,ppwwyyxx/tensorflow,paolodedios/tensorflow,Intel-Corporation/tensorflow,girving/tensorflow,dongjoon-hyun/tensorflow,frreiss/tensorflow-fred,aam-at/tensorflow,tensorflow/tensorflow,brchiu/tensorflow,tensorflow/tensorflow,dongjoon-hyun/tensorflow,jalexvig/tensorflow,freedomtan/tensorflow,alshedivat/tensorflow,aldian/tensorflow,frreiss/tensorflow-fred,manipopopo/tensorflow,yanchen036/tensorflow,yongtang/tensorflow,DavidNorman/tensorflow,nburn42/tensorflow,AnishShah/tensorflow,yanchen036/tensorflow,frreiss/tensorflow-fred,xzturn/tensorflow,hfp/tensorflow-xsmm,tensorflow/tensorflow-pywrap_saved_model,caisq/tensorflow,arborh/tensorflow,alsrgv/tensorflow,annarev/tensorflow,Bismarrck/tensorflow,dancingdan/tensorflow,kevin-coder/tensorflow-fork,yanchen036/tensorflow,hfp/tensorflow-xsmm,aam-at/tensorflow,AnishShah/tensorflow,seanli9jan/tensorflow,annarev/tensorflow,arborh/tensorflow,adit-chandra/tensorflow,arborh/tensorflow,alsrgv/tensorflow,kobejean/tensorflow,jendap/tensorflow,ghchinoy/tensorflow,ppwwyyxx/tensorflow,jhseu/tensorflow,chemelnucfin/tensorflow,aldian/tensorflow,ppwwyyxx/tensorflow,ghchinoy/tensorflow,jbedorf/tensorflow,brchiu/tensorflow,AnishShah/tensorflow,annarev/tensorflow,brchiu/tensorflow,renyi533/tensorflow,caisq/tensorflow,aselle/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gojira/tensorflow,jalexvig/tensorflow,paolodedios/tensorflow,AnishShah/tensorflow,renyi533/tensorflow,benoitsteiner/tensorflow-xsmm,benoitsteiner/tensorflow-xsmm,tensorflow/tensorflow-pywrap_tf_optimizer,hehongliang/tensorflow,davidzchen/tensorflow,chemelnucfin/tensorflow,cxxgtxy/tensorflow,jart/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gojira/tensorflow,dancingdan/tensorflow,petewarden/tensorflow,cxxgtxy/tensorflow,xodus7/tensorflow,gunan/tensorflow,lukeiwanski/tensorflow,jart/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,dendisuhubdy/tensorflow,apark263/tensorflow,alshedivat/tensorflow,alsrgv/tensorflow,nburn42/tensorflow,ageron/tensorflow,gojira/tensorflow,aselle/tensorflow,aselle/tensorflow,theflofly/tensorflow,aam-at/tensorflow,alsrgv/tensorflow,drpngx/tensorflow,annarev/tensorflow,apark263/tensorflow,dongjoon-hyun/tensorflow,ageron/tensorflow,ghchinoy/tensorflow,alsrgv/tensorflow,gautam1858/tensorflow,hfp/tensorflow-xsmm,Intel-tensorflow/tensorflow,annarev/tensorflow,frreiss/tensorflow-fred,DavidNorman/tensorflow,xzturn/tensorflow,ageron/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_saved_model,sarvex/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,benoitsteiner/tensorflow-xsmm,yongtang/tensorflow,jendap/tensorflow,nburn42/tensorflow,apark263/tensorflow,jart/tensorflow,chemelnucfin/tensorflow,asimshankar/tensorflow,benoitsteiner/tensorflow-xsmm,jalexvig/tensorflow,freedomtan/tensorflow,renyi533/tensorflow,girving/tensorflow,nburn42/tensorflow,jbedorf/tensorflow,brchiu/tensorflow,asimshankar/tensorflow,renyi533/tensorflow,manipopopo/tensorflow,gunan/tensorflow,arborh/tensorflow,aam-at/tensorflow,asimshankar/tensorflow,xzturn/tensorflow,dancingdan/tensorflow,yongtang/tensorflow,apark263/tensorflow,aselle/tensorflow,meteorcloudy/tensorflow,cxxgtxy/tensorflow,kobejean/tensorflow,arborh/tensorflow,gautam1858/tensorflow,jalexvig/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,dendisuhubdy/tensorflow,manipopopo/tensorflow,meteorcloudy/tensorflow,manipopopo/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,xzturn/tensorflow,nburn42/tensorflow,petewarden/tensorflow,xodus7/tensorflow,jalexvig/tensorflow,seanli9jan/tensorflow,girving/tensorflow,apark263/tensorflow,DavidNorman/tensorflow,arborh/tensorflow,brchiu/tensorflow,meteorcloudy/tensorflow,hfp/tensorflow-xsmm,Intel-Corporation/tensorflow,jart/tensorflow,davidzchen/tensorflow,yongtang/tensorflow,arborh/tensorflow,tensorflow/tensorflow-pywrap_saved_model,adit-chandra/tensorflow,ageron/tensorflow,annarev/tensorflow,Intel-tensorflow/tensorflow,brchiu/tensorflow,theflofly/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,adit-chandra/tensorflow,meteorcloudy/tensorflow,yanchen036/tensorflow,manipopopo/tensorflow,ZhangXinNan/tensorflow,caisq/tensorflow,dendisuhubdy/tensorflow,aam-at/tensorflow,alsrgv/tensorflow,ZhangXinNan/tensorflow,aldian/tensorflow,xzturn/tensorflow,jhseu/tensorflow,AnishShah/tensorflow,DavidNorman/tensorflow,aldian/tensorflow,xodus7/tensorflow,caisq/tensorflow,Intel-tensorflow/tensorflow,petewarden/tensorflow,karllessard/tensorflow,petewarden/tensorflow,gautam1858/tensorflow,sarvex/tensorflow,ageron/tensorflow,gojira/tensorflow,xzturn/tensorflow,yongtang/tensorflow,hfp/tensorflow-xsmm,dongjoon-hyun/tensorflow,aselle/tensorflow,ZhangXinNan/tensorflow,sarvex/tensorflow,brchiu/tensorflow,snnn/tensorflow,sarvex/tensorflow,seanli9jan/tensorflow,gojira/tensorflow,aselle/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,ppwwyyxx/tensorflow,Intel-tensorflow/tensorflow,seanli9jan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gojira/tensorflow,snnn/tensorflow,alsrgv/tensorflow,ZhangXinNan/tensorflow,adit-chandra/tensorflow,karllessard/tensorflow,nburn42/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,renyi533/tensorflow,ZhangXinNan/tensorflow,ghchinoy/tensorflow,dongjoon-hyun/tensorflow,dendisuhubdy/tensorflow,cxxgtxy/tensorflow,lukeiwanski/tensorflow,benoitsteiner/tensorflow-xsmm,ageron/tensorflow,alsrgv/tensorflow,hfp/tensorflow-xsmm,snnn/tensorflow,jendap/tensorflow,ghchinoy/tensorflow,xzturn/tensorflow,hehongliang/tensorflow,kevin-coder/tensorflow-fork,adit-chandra/tensorflow,xzturn/tensorflow,arborh/tensorflow,jbedorf/tensorflow,davidzchen/tensorflow,meteorcloudy/tensorflow,xodus7/tensorflow,aldian/tensorflow,jart/tensorflow,petewarden/tensorflow,yongtang/tensorflow,seanli9jan/tensorflow,hehongliang/tensorflow,girving/tensorflow,apark263/tensorflow,gojira/tensorflow,adit-chandra/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,jendap/tensorflow,gunan/tensorflow,gautam1858/tensorflow,adit-chandra/tensorflow,ppwwyyxx/tensorflow,xodus7/tensorflow,freedomtan/tensorflow,jhseu/tensorflow,petewarden/tensorflow,alshedivat/tensorflow,petewarden/tensorflow,annarev/tensorflow,girving/tensorflow,meteorcloudy/tensorflow,davidzchen/tensorflow,karllessard/tensorflow,nburn42/tensorflow,sarvex/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,theflofly/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,snnn/tensorflow,nburn42/tensorflow,Bismarrck/tensorflow,brchiu/tensorflow,benoitsteiner/tensorflow-xsmm,yanchen036/tensorflow,ZhangXinNan/tensorflow,girving/tensorflow,snnn/tensorflow,annarev/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,gunan/tensorflow,DavidNorman/tensorflow,gautam1858/tensorflow,hfp/tensorflow-xsmm,ZhangXinNan/tensorflow,ageron/tensorflow,paolodedios/tensorflow,ghchinoy/tensorflow,drpngx/tensorflow,renyi533/tensorflow,jart/tensorflow,freedomtan/tensorflow,cxxgtxy/tensorflow,seanli9jan/tensorflow,theflofly/tensorflow,xodus7/tensorflow,dendisuhubdy/tensorflow,kobejean/tensorflow,xodus7/tensorflow,hehongliang/tensorflow,lukeiwanski/tensorflow