[python-openopt] Initial package

stevetraylen stevetraylen at fedoraproject.org
Tue Aug 27 13:21:41 UTC 2013


commit 416e0e7d7aeaeadc6affa50acaf2e658ffbf72bc
Author: Steve Traylen <steve.traylen at cern.ch>
Date:   Tue Aug 27 13:15:02 2013 +0000

    Initial package

 .gitignore          |    1 +
 python-openopt.spec |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++
 sources             |    1 +
 3 files changed, 116 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..8a30fd5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/openopt-0.5092.tar.gz
diff --git a/python-openopt.spec b/python-openopt.spec
new file mode 100644
index 0000000..44fc236
--- /dev/null
+++ b/python-openopt.spec
@@ -0,0 +1,114 @@
+%if 0%{?fedora} > 12
+%global with_python3 1
+%endif
+
+Name:           python-openopt
+Version:        0.5092
+Release:        1%{?dist}
+Summary:        A python module for numerical optimization
+
+License:        BSD
+URL:            http://openopt.org/
+Source0:        https://pypi.python.org/packages/source/o/openopt/openopt-%{version}.tar.gz
+
+Requires:       numpy
+
+BuildArch:      noarch
+BuildRequires:  python2-devel
+BuildRequires:  python-setproctitle
+BuildRequires:  numpy
+%if 0%{?with_python3}
+BuildRequires:  python-tools
+BuildRequires:  python3-devel
+BuildRequires:  python3-setproctitle
+BuildRequires:  python3-numpy
+BuildRequires:  python3-setuptools
+%endif
+
+%description
+Universal numerical optimization package with several 
+own solvers (e.g. ralg) and connections to tens of 
+other, graphical output of convergence and many other 
+goodies.
+
+%if 0%{?with_python3}
+%package -n python3-openopt
+Summary:        A python module for numerical optimization
+Requires:       python3-numpy
+
+%description -n python3-openopt
+Universal numerical optimization package with several 
+own solvers (e.g. ralg) and connections to tens of 
+other, graphical output of convergence and many other 
+goodies.
+%endif
+
+%prep
+%setup -q -n openopt-%{version}
+
+# Remove some shebangs
+for lib in openopt/solvers/Standalone/tsp.py openopt/__init__.py openopt/kernel/mfa.py ; do
+ sed '1{\@^#!.*@d}' $lib > $lib.new &&
+ touch -r $lib $lib.new &&
+ mv $lib.new $lib
+done
+
+# Remove some executable bits on documentation examples.
+chmod 0644 openopt/examples/snle_1.py openopt/examples/tsp_1.py
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif # with_python3
+
+%build
+%{__python} setup.py build
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+2to3 --write --nobackups .
+%{__python3} setup.py build
+popd
+%endif
+
+
+%install
+rm -rf %{buildroot}
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+rm -rf %{buildroot}%{python3_sitelib}/openopt/examples 
+popd
+%endif
+
+%{__python} setup.py install --skip-build --root %{buildroot}
+rm -rf %{buildroot}%{python_sitelib}/openopt/examples 
+
+%check
+%{__python} setup.py test
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py test
+popd
+%endif
+
+
+%files
+%doc PKG-INFO openopt/examples
+# For noarch packages: sitelib
+%{python_sitelib}/openopt
+%{python_sitelib}/openopt-%{version}-py%{python_version}.egg-info
+
+%if 0%{?with_python3}
+%files -n python3-openopt
+%doc PKG-INFO openopt/examples
+%{python3_sitelib}/openopt
+%{python3_sitelib}/openopt-%{version}-py%{python3_version}.egg-info
+%endif
+
+%changelog
+* Mon Aug 26 2013 Steve Traylen <steve.traylen at cern.ch> - 0.5092-1
+- Initial package
+
diff --git a/sources b/sources
index e69de29..44c4e84 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+1e1eb41ac4a46e0ec80d12245a6555f4  openopt-0.5092.tar.gz


More information about the scm-commits mailing list