From b24d5877f8476bc24c7ab43eacb32a6ddb43df54 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Jan 11 2018 19:05:29 +0000 Subject: initial package + macro cleanups --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d21a86d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/uranium-lulzbot-2.6.63.tar.gz diff --git a/python-uranium-lulzbot.spec b/python-uranium-lulzbot.spec new file mode 100644 index 0000000..666b806 --- /dev/null +++ b/python-uranium-lulzbot.spec @@ -0,0 +1,188 @@ +%global shortname uranium-lulzbot + +Name: python-%{shortname} +Version: 2.6.63 +Release: 3%{?dist} +Summary: A Python framework for building desktop applications (Lulzbot fork) +# UM/SortedList.py is ASL 2.0 +# Everything else is AGPLv3+ +License: AGPLv3+ and ASL 2.0 +URL: https://code.alephobjects.com/diffusion/U/repository/master/ +# git clone https://code.alephobjects.com/diffusion/U/uranium.git +# cd uranium +# git checkout v2.6.63 +# git archive --format=tar.gz --prefix=uranium-lulzbot-%%{version}/ v2.6.63 > ../uranium-lulzbot-%%{version}.tar.gz +Source0: %{shortname}-%{version}.tar.gz + +# Cannot conflict +Patch1: %{shortname}-2.6.19-system.patch +# Fix tests +Patch2: %{shortname}-2.6.63-fix-test.patch + +BuildRequires: python3-devel +BuildRequires: /usr/bin/doxygen +BuildRequires: /usr/bin/msgmerge +BuildRequires: cmake +BuildRequires: git + +# Tests +BuildRequires: python3-arcus >= 2.6 +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-%{shortname} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{shortname}} +Requires: python3-arcus >= 2.6 +Requires: python3-numpy +Requires: python3-scipy +Requires: python3-qt5 +Recommends: python3-numpy-stl + +%description -n python3-%{shortname} +Uranium is a Python framework for building 3D printing related applications. +This is the Lulzbot fork. + +%package doc +Summary: Documentation for %{name} package + +%description doc +Documentation for Uranium, a Python framework for building 3D printing +related applications. This is for the Lulzbot fork. + +%prep +%setup -q -n %{shortname}-%{version} +%patch1 -p1 -b .system +%patch2 -p1 -b .fixtest + +# 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 + +%install +make install DESTDIR=%{buildroot} + +# Move the cmake files +mv %{buildroot}%{_datadir}/cmake* %{buildroot}%{_datadir}/cmake + +# remove conflict +mv %{buildroot}%{_datadir}/cmake/Modules/UraniumTranslationTools.cmake %{buildroot}%{_datadir}/cmake/Modules/LulzbotUraniumTranslationTools.cmake + +# Sanitize the location of locale files +pushd %{buildroot}%{_datadir} +mv %{shortname}/resources/i18n locale +ln -s ../../locale %{shortname}/resources/i18n +rm locale/uranium.pot +rm locale/*/uranium.po +for i in locale/*/LC_MESSAGES; do + pushd $i + mv uranium.mo %{shortname}.mo + popd +done +popd + +%find_lang %{shortname} + +%check +pip3 freeze + +# The failing tests are reported at: +# https://github.com/Ultimaker/Uranium/issues/225 +# Skipping +%{__python3} -m pytest -v -k "not getMimeTypeForFile" + +%files -n python3-%{shortname} -f %{shortname}.lang +%license LICENSE +%doc README.md +%dir %{python3_sitelib}/CuraLulzbot +%{python3_sitelib}/CuraLulzbot/UM +%{_datadir}/%{shortname} +# Own the dir not to depend on cmake: +%{_datadir}/cmake +%{_prefix}/lib/%{shortname} + +%files doc +%license LICENSE +%doc html + +%changelog +* Thu Jan 11 2018 Tom Callaway - 2.6.63-3 +- use shortname macro consistently + +* Wed Jan 10 2018 Tom Callaway - 2.6.63-2 +- add explicit text to summaries/descriptions to make clear this is a fork +- own %%{python3_sitelib}/CuraLulzbot +- correct license tag +- rename translation files to avoid conflict + +* Wed Jan 3 2018 Tom Callaway - 2.6.63-1 +- update to 2.6.63 + +* Fri Dec 8 2017 Tom Callaway - 2.6.52-1 +- update to 2.6.52 + +* Fri Oct 27 2017 Tom Callaway - 2.6.43-1 +- update to 2.6.43 + +* Fri Oct 27 2017 Tom Callaway - 2.6.29-1 +- update to 2.6.29 + +* Wed Aug 23 2017 Tom Callaway - 2.6.23-1 +- update to 2.6.23 + +* Wed Aug 16 2017 Tom Callaway - 2.6.22-2 +- fix python 3 version hardcoding in patch + +* Mon Aug 14 2017 Tom Callaway - 2.6.22-1 +- update to 2.6.22 + +* Tue Aug 8 2017 Tom Callaway - 2.6.21-2 +- fix namespacing (thanks to Miro Hrončok) + +* Tue Aug 8 2017 Tom Callaway - 2.6.21-1 +- update to 2.6.21 + +* Thu Jul 27 2017 Tom Callaway - 2.6.19-1 +- make lulzbot specific package + +* Wed Jun 28 2017 Miro Hrončok - 2.6.1-2 +- Fix the test_uniqueName test failure + +* Wed Jun 28 2017 Miro Hrončok - 2.6.1-1 +- Update to 2.6.1 +- Skip test_uniqueName test (reported) + +* Tue Jun 27 2017 Miro Hrončok - 2.6.0-1 +- Update to 2.6.0 + +* Wed May 03 2017 Miro Hrončok - 2.5.0-2 +- Actually include the cmake files (needed for cura) + +* Wed Apr 26 2017 Miro Hrončok - 2.5.0-1 +- Initial package + diff --git a/sources b/sources new file mode 100644 index 0000000..93e4bbf --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (uranium-lulzbot-2.6.63.tar.gz) = fb6237c2dbd7c432b814f3f99837f7347de4dbe8fd5db216b4383fd6e405cae7f403276acdeda96d661f7c45e7f33f21718582b9970a6297833b44e75db208b5 diff --git a/uranium-lulzbot-2.6.19-system.patch b/uranium-lulzbot-2.6.19-system.patch new file mode 100644 index 0000000..0ce43d5 --- /dev/null +++ b/uranium-lulzbot-2.6.19-system.patch @@ -0,0 +1,50 @@ +diff -up uranium-lulzbot-2.6.22/CMakeLists.txt.system uranium-lulzbot-2.6.22/CMakeLists.txt +--- uranium-lulzbot-2.6.22/CMakeLists.txt.system 2017-08-02 05:46:28.000000000 -0400 ++++ uranium-lulzbot-2.6.22/CMakeLists.txt 2017-08-16 15:08:37.749062107 -0400 +@@ -1,4 +1,4 @@ +-project(uranium NONE) ++project(uranium-lulzbot NONE) + + cmake_minimum_required(VERSION 2.8.12) + +@@ -64,15 +64,15 @@ if(NOT PYTHON_SITE_PACKAGES_DIR) + set(URANIUM_INSTALL_MODULES_PATH + ${CMAKE_INSTALL_DATADIR}/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Modules/ ) + set(URANIUM_INSTALL_PLUGINS_PATH +- lib/uranium) ++ lib/uranium-lulzbot) + else() + set(URANIUM_INSTALL_MODULES_PATH ${CMAKE_INSTALL_DATADIR}/cmake/Modules/) +- set(URANIUM_INSTALL_PLUGINS_PATH ${CMAKE_INSTALL_LIBDIR}/uranium ) ++ set(URANIUM_INSTALL_PLUGINS_PATH ${CMAKE_INSTALL_LIBDIR}/uranium-lulzbot ) + endif() +-install(DIRECTORY UM DESTINATION ${PYTHON_SITE_PACKAGES_DIR}) ++install(DIRECTORY UM DESTINATION ${PYTHON_SITE_PACKAGES_DIR}/CuraLulzbot) + + install(FILES ${CMAKE_SOURCE_DIR}/cmake/UraniumTranslationTools.cmake DESTINATION ${URANIUM_INSTALL_MODULES_PATH}) +-install(DIRECTORY resources DESTINATION ${CMAKE_INSTALL_DATADIR}/uranium) ++install(DIRECTORY resources DESTINATION ${CMAKE_INSTALL_DATADIR}/uranium-lulzbot) + install(DIRECTORY plugins DESTINATION ${URANIUM_INSTALL_PLUGINS_PATH} ) + + include(CPackConfig.cmake) +diff -up uranium-lulzbot-2.6.22/UM/Application.py.system uranium-lulzbot-2.6.22/UM/Application.py +--- uranium-lulzbot-2.6.22/UM/Application.py.system 2017-08-02 05:46:28.000000000 -0400 ++++ uranium-lulzbot-2.6.22/UM/Application.py 2017-08-16 15:08:13.878701303 -0400 +@@ -61,7 +61,7 @@ class Application: + Resources.ApplicationVersion = version + + Resources.addSearchPath(os.path.join(os.path.dirname(sys.executable), "resources")) +- Resources.addSearchPath(os.path.join(Application.getInstallPrefix(), "share", "uranium", "resources")) ++ Resources.addSearchPath(os.path.join(Application.getInstallPrefix(), "share", "uranium-lulzbot", "resources")) + Resources.addSearchPath(os.path.join(Application.getInstallPrefix(), "Resources", "uranium", "resources")) + Resources.addSearchPath(os.path.join(Application.getInstallPrefix(), "Resources", self.getApplicationName(), "resources")) + if hasattr(sys, "frozen"): +@@ -108,7 +108,7 @@ class Application: + + self._plugin_registry = PluginRegistry.getInstance() + +- self._plugin_registry.addPluginLocation(os.path.join(Application.getInstallPrefix(), "lib", "uranium")) ++ self._plugin_registry.addPluginLocation(os.path.join(Application.getInstallPrefix(), "lib", "uranium-lulzbot")) + self._plugin_registry.addPluginLocation(os.path.join(os.path.dirname(sys.executable), "plugins")) + self._plugin_registry.addPluginLocation(os.path.join(Application.getInstallPrefix(), "Resources", "uranium", "plugins")) + self._plugin_registry.addPluginLocation(os.path.join(Application.getInstallPrefix(), "Resources", self.getApplicationName(), "plugins")) diff --git a/uranium-lulzbot-2.6.63-fix-test.patch b/uranium-lulzbot-2.6.63-fix-test.patch new file mode 100644 index 0000000..dfe52a0 --- /dev/null +++ b/uranium-lulzbot-2.6.63-fix-test.patch @@ -0,0 +1,15 @@ +diff -up uranium-lulzbot-2.6.63/tests/Settings/TestSettingInstance.py.fixtest uranium-lulzbot-2.6.63/tests/Settings/TestSettingInstance.py +--- uranium-lulzbot-2.6.63/tests/Settings/TestSettingInstance.py.fixtest 2017-12-07 09:48:23.000000000 -0500 ++++ uranium-lulzbot-2.6.63/tests/Settings/TestSettingInstance.py 2018-01-03 13:26:20.668585222 -0500 +@@ -18,6 +18,11 @@ class MockContainer(): + + self._instances = [] + ++ ## We do not really care about the metadataEntry here ++ # We just return "user". ++ def getMetaDataEntry(self, entry, default = None): ++ return "user" ++ + def getProperty(self, key, property_name): + for instance in self._instances: + if instance.definition.key == key: