Skip to content

Commit

Permalink
adds py2-pippkgs to manage pip based python packages
Browse files Browse the repository at this point in the history
  • Loading branch information
iahmad-khan committed Dec 8, 2016
1 parent 42b33d0 commit e9f1a8a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cmssw-tool-conf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Requires: md5-toolfile
Requires: py2-setuptools-toolfile
Requires: madgraph5amcatnlo-toolfile
Requires: histogrammar-toolfile
Requires: py2-rootpy-toolfile
Requires: py2-pippkgs-toolfile
#still a work in progress Requires: py2-notebook

# Only for Linux platform.
Expand Down
22 changes: 22 additions & 0 deletions py2-pippkgs-toolfile.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### RPM external py2-pippkgs-toolfile 1.0
Requires: py2-pippkgs
BuildRequires: python
%prep

%build

%install

mkdir -p %{i}/etc/scram.d
cat << \EOF_TOOLFILE >%{i}/etc/scram.d/py2-pippkgs.xml
<tool name="py2-pippkgs" version="@TOOL_VERSION@">
<client>
<environment name="PY2_PIPPKGS" default="@TOOL_ROOT@"/>
</client>
<runtime name="PYTHONPATH" value="$PY2_PIPPKGS/@PYTHON_LIB_SITE_PACKAGES@" type="path"/>
</tool>
EOF_TOOLFILE

export PYTHON_LIB_SITE_PACKAGES

## IMPORT scram-tools-post
29 changes: 29 additions & 0 deletions py2-pippkgs.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### RPM external py2-pippkgs 1.0
## INITENV +PATH PYTHONPATH %{i}/$PYTHON_LIB_SITE_PACKAGES
Source: none

BuildRequires: py2-rootpy
BuildRequires: py2-configparser
BuildRequires: py2-entrypoints

%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
echo " Duplicate file found: $f"
exit 1
fi
done
echo "Copying $SOURCE in %{pkgrel}"
rsync -av $SOURCE/ %{i}/$PYTHON_LIB_SITE_PACKAGES/
fi
done

22 changes: 0 additions & 22 deletions py2-rootpy-toolfile.spec

This file was deleted.

0 comments on commit e9f1a8a

Please sign in to comment.