From 5d3ee74583a0f4d4030197c6ef3ff7339e935674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 1 May 2017 21:13:15 +0200 Subject: [PATCH] Initial import (#1435914) --- .gitignore | 1 + python-uranium.spec | 112 ++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 114 insertions(+) create mode 100644 python-uranium.spec diff --git a/.gitignore b/.gitignore index e69de29..33f0cf6 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/Uranium-2.5.0.tar.gz diff --git a/python-uranium.spec b/python-uranium.spec new file mode 100644 index 0000000..204f6f0 --- /dev/null +++ b/python-uranium.spec @@ -0,0 +1,112 @@ +Name: python-uranium +Version: 2.5.0 +Release: 1%{?dist} +Summary: A Python framework for building desktop applications +License: AGPLv3+ +URL: https://github.com/Ultimaker/Uranium +Source0: %{url}/archive/%{version}.tar.gz#/Uranium-%{version}.tar.gz + +BuildRequires: python3-devel +BuildRequires: /usr/bin/doxygen +BuildRequires: /usr/bin/msgmerge +BuildRequires: cmake +BuildRequires: git + +# Tests +BuildRequires: python3-arcus == %{version} +BuildRequires: python3-numpy +BuildRequires: python3-scipy +BuildRequires: python3-qt5 +BuildRequires: python3-pytest + +BuildArch: noarch + +# There are Python plugins in /usr/lib/uranium +# We need to byte-compile it with Python 3 +%global __python %{__python3} + +%description +Uranium is a Python framework for building 3D printing related applications. + +%package -n python3-uranium +Summary: %{summary} +Provides: uranium = %{version}-%{release} +%{?python_provide:%python_provide python3-uranium} + +Requires: python3-arcus == %{version} +Requires: python3-numpy +Requires: python3-scipy +Requires: python3-qt5 +Recommends: python3-numpy-stl + +%description -n python3-uranium +Uranium is a Python framework for building 3D printing related applications. + +%package doc +Summary: Documentation for %{name} package + +%description doc +Documentation for Uranium, a Python framework for building 3D printing +related applications. + +%prep +%autosetup -n Uranium-%{version} -p1 -S git + +# Upstream installs to lib/python3/dist-packages +# We want to install to %%{python3_sitelib} +sed -i 's|lib/python${PYTHON_VERSION_MAJOR}/dist-packages|%(echo %{python3_sitelib} | sed -e s@%{_prefix}/@@)|g' CMakeLists.txt + +# Invalid locale name ptbr +# https://github.com/Ultimaker/Uranium/issues/246 +mv resources/i18n/{ptbr,pt_BR} +sed -i 's/"Language: ptbr\n"/"Language: pt_BR\n"/' resources/i18n/pt_BR/*.po + +# empty file. appending to the end to make sure we are not overriding +# a non empty file in the future +echo '# empty' >> UM/Settings/ContainerRegistryInterface.py + +%build +%{cmake} . +make %{?_smp_mflags} +make doc + +%check +# The failing test is reported at https://github.com/Ultimaker/Uranium/issues/225 +# Skipping +%{__python3} -m pytest -v -k "not getMimeTypeForFile" + + +%install +make install DESTDIR=%{buildroot} + +# We don't really need those +rm -rf %{buildroot}%{_datadir}/cmake* + +# Sanitize the location of locale files +pushd %{buildroot}%{_datadir} +mv uranium/resources/i18n locale +ln -s ../../locale uranium/resources/i18n +rm locale/uranium.pot +rm locale/*/uranium.po +popd + +%find_lang uranium + + +%files -n python3-uranium -f uranium.lang +%license LICENSE +%doc README.md +%{python3_sitelib}/UM +%{_datadir}/uranium +%{_prefix}/lib/uranium + + +%files doc +%license LICENSE +%doc html + + +%changelog +* Wed Apr 26 2017 Miro HronĨok - 2.5.0-1 +- Initial package + diff --git a/sources b/sources index e69de29..00b873d 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (Uranium-2.5.0.tar.gz) = 80ad5270fb43545cfcd43a001bd18d620c9ce4d084c39c1dfcc02f74a7bc687a9939ee1da7f98366debb0b0a88ba645f7bea3659dd97489780d31c62a72c8c29