forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-with-pip.file
51 lines (39 loc) · 1.05 KB
/
build-with-pip.file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#File: with-with-pip
%if "%{?pip_name:set}" != "set"
%define pip_name %(echo %n | cut -f2-5 -d-)
%endif
%if "%{?PipDownloadOptions:set}" != "set"
%define PipDownloadOptions --no-deps%%20--no-binary%%3D:all:
%endif
%if "%{?PipBuildOptions:set}" != "set"
%define PipBuildOptions --no-deps
%endif
%if "%{?source0:set}" != "set"
%define source0 pip://%{pip_name}/%{realversion}?pip_options=%{PipDownloadOptions}&output=/source.tar.gz
%endif
Source: %source0
Requires: python
BuildRequires: py2-pip
%prep
%build
mkdir -p %{i}
%if "%{?source_file:set}" != "set"
tar xfz %{_sourcedir}/source.tar.gz
%else
cp %{_sourcedir}/source.tar.gz %{source_file}
echo %{source_file} > files.list
%endif
%{?PipPreBuild:%PipPreBuild}
if [ `cat files.list | wc -l` == "1" ] ; then
export PIPFILE=`cat files.list`
echo ${PIPFILE}
export PYTHONUSERBASE=%i
pip list
pip install --user -v %{PipBuildOptions} $PIPFILE
else
echo "Sorry I don't know how to handle no/multiple install files yet"
cat %{_sourcedir}/files.txt
exit 1
fi
%install
%{?PipPostBuild:%PipPostBuild}