/
py2-backports.spec
95 lines (83 loc) · 2.79 KB
/
py2-backports.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
### RPM external py2-backports 1.0
## INITENV +PATH PYTHON27PATH %{i}/${PYTHON_LIB_SITE_PACKAGES}
## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES}
Source: none
Requires: python python3
BuildRequires: py2-backports-functools_lru_cache
%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}"
#try cp instead of rsync as we don't want to overwrite duplicate directories
# rsync -av $SOURCE/ %{i}/${PYTHON_LIB_SITE_PACKAGES}/
cp -r ${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
mkdir -p %{i}/${PYTHON3_LIB_SITE_PACKAGES}
for pkg in %builddirectpkgreqs ; do
SOURCE=%{cmsroot}/%{cmsplatf}/${pkg}/${PYTHON3_LIB_SITE_PACKAGES}
if [ -d $SOURCE ] ; then
echo "Checking for duplicates ...."
for f in $(ls $SOURCE) ; do
if [ -e %{i}/${PYTHON3_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}"
#try cp instead of rsync as we don't want to overwrite duplicate directories
# rsync -av $SOURCE/ %{i}/${PYTHON_LIB_SITE_PACKAGES}/
cp -r ${SOURCE}/* %{i}/${PYTHON3_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