def test_command_concat(self): cmd = Command("cd %s" % self.test_project_dir) cmd.append_cmdlines("cmake ..") cmd.append_cmdlines(["make", "make test"]) self.assertRaises(TypeError, cmd.append_cmdlines, 4) expected = "cd %s\ncmake ..\nmake\nmake test" % self.test_project_dir self.assertEqual(expected, str(cmd))
def patched(self, project_dir, spec, sack): if (project_dir / "CMakeLists.txt").is_file(): logging.debug('CMakeLists.txt found') build = Command() build.append_cmdlines("cmake " + str(project_dir)) build.append_cmdlines("make") install = Command("make install DESTDIR=$RPM_BUILD_ROOT") spec.scripts["%build"] = build spec.scripts["%install"] = install