forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
py2-pippkgs_depscipy.spec
52 lines (44 loc) · 1.34 KB
/
py2-pippkgs_depscipy.spec
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
50
51
### RPM external py2-pippkgs_depscipy 1.0
## INITENV +PATH PYTHONPATH %{i}/$PYTHON_LIB_SITE_PACKAGES
Source: none
Requires: root curl python py2-scipy
BuildRequires: py2-Keras
BuildRequires: py2-Theano
%prep
%build
%install
mkdir -p %{i}/$PYTHON_LIB_SITE_PACKAGES
for pkg in %builddirectpkgreqs ; do
SOURCE=%{cmsroot}/%{cmsplatf}/${pkg}/$PYTHON_LIB_SITE_PACKAGES
if [ -d $SOURCE ] ; then
echo "Checking for duplicates ...."
for f in $(ls $SOURCE) ; do
if [ -e %{i}/$PYTHON_LIB_SITE_PACKAGES/$f ] ; then
# https://github.com/jupyter/jupyter_core/issues/55 - now I delete jupyter.py from one of the providers
#backports is an example directory that can have multiple packages inside
if [ $f != "backports" ] ; then
echo " Duplicate file found: $f"
exit 1
fi
fi
done
echo "Copying $SOURCE in %{pkgrel}"
rsync -av $SOURCE/ %{i}/$PYTHON_LIB_SITE_PACKAGES/
fi
done
#and for bin
mkdir -p %{i}/bin
for pkg in %builddirectpkgreqs ; do
SOURCE=%{cmsroot}/%{cmsplatf}/${pkg}/bin
if [ -d $SOURCE ] ; then
echo "Checking for duplicates ...."
for f in $(ls $SOURCE) ; do
if [ -e %{i}/bin/$f ] ; then
echo " Duplicate file found: $f"
exit 1
fi
done
echo "Copying $SOURCE in %{pkgrel}"
rsync -av $SOURCE/ %{i}/bin/
fi
done