diff --git a/mambabase/FinishPage.ui b/mambabase/FinishPage.ui new file mode 100644 index 0000000..aefc13f --- /dev/null +++ b/mambabase/FinishPage.ui @@ -0,0 +1,118 @@ + + + Form + + + + 0 + 0 + 552 + 392 + + + + + 0 + 0 + + + + Form + + + + + 0 + 0 + 551 + 391 + + + + + + + + 0 + 0 + + + + background-color: rgb(239, 240, 241); +background-color: rgb(255, 255, 255); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 511 + 31 + + + + <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Installation completed.</span></p></body></html> + + + true + + + + + + 26 + 130 + 501 + 21 + + + + + + + + + + 20 + 100 + 511 + 271 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 20 + 40 + 511 + 51 + + + + <html><head/><body><p>If you ran into problems, please check the installation log below for warnings or errors and send the report to the openmamba community at <a href="https://openmamba.org"><span style=" text-decoration: underline; color:#2980b9;">openmamba.org</span></a>.</p></body></html> + + + true + + + + + + + + + + diff --git a/mambabase/InstallationPage.ui b/mambabase/InstallationPage.ui new file mode 100644 index 0000000..50b5c64 --- /dev/null +++ b/mambabase/InstallationPage.ui @@ -0,0 +1,125 @@ + + + Form + + + + 0 + 0 + 552 + 392 + + + + + 0 + 0 + + + + Form + + + + + 0 + 0 + 551 + 391 + + + + + + + + 0 + 0 + + + + background-color: rgb(239, 240, 241); +background-color: rgb(255, 255, 255); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 531 + 31 + + + + <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Installation in progress...</span></p></body></html> + + + true + + + + + + 20 + 70 + 511 + 41 + + + + 0 + + + + + + 20 + 120 + 511 + 21 + + + + + + + + + + 20 + 170 + 511 + 201 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 491 + 181 + + + + + + + + + + + + diff --git a/mambabase/SelectExtraPage.ui b/mambabase/SelectExtraPage.ui new file mode 100644 index 0000000..39a2e29 --- /dev/null +++ b/mambabase/SelectExtraPage.ui @@ -0,0 +1,274 @@ + + + Form + + + + 0 + 0 + 552 + 392 + + + + + 0 + 0 + + + + Form + + + + + 0 + 0 + 551 + 391 + + + + + + + + 0 + 0 + + + + background-color: rgb(239, 240, 241); +background-color: rgb(255, 255, 255); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 511 + 31 + + + + <html><head/><body><p><span style=" font-weight:600;">Please, select from the boxes below the components that you want to install or update from network.</span></p></body></html> + + + true + + + + + + 10 + 50 + 531 + 331 + + + + background-color: rgb(239, 240, 241); + + + Proprietary software installatios/updates + + + + + 20 + 30 + 491 + 21 + + + + NVIDIA proprietary video driver /autodetected) from openmamba.org + + + false + + + + + + 20 + 50 + 491 + 21 + + + + AMD/ATI proprietary video driver from openmamba.org + + + + + + 20 + 70 + 491 + 21 + + + + AMD/ATI proprietary video driver (legacy) from openmamba.org + + + + + + 20 + 90 + 491 + 21 + + + + Broadcom-sta proprietary wireless driver from openmamba.org + + + + + + 20 + 110 + 491 + 21 + + + + Broadcom B43 proprietary firmarwe from openwrt.org + + + + + + 20 + 130 + 491 + 21 + + + + Flash plugin from adobe.com + + + + + + 20 + 170 + 491 + 21 + + + + MS TrueType core fonts from sourceforge + + + + + + 20 + 190 + 491 + 21 + + + + Win32 codecs from mplayerhq.hu + + + + + + 20 + 210 + 491 + 21 + + + + Oracle Java from oracle.com + + + + + + 20 + 150 + 491 + 21 + + + + Pepper-Flash plugin for chromium from google.com + + + + + + 20 + 230 + 491 + 21 + + + + Skype from skype.com + + + + + + 20 + 250 + 491 + 21 + + + + Spotify from spotify.com + + + + + + 20 + 270 + 491 + 21 + + + + VirtualBox extension pack from virtualbox.org + + + + + + 20 + 290 + 491 + 21 + + + + Widevine extension from google.com + + + + + + + + + + + diff --git a/mambabase/SelectGroupsPage.ui b/mambabase/SelectGroupsPage.ui new file mode 100644 index 0000000..a5192ed --- /dev/null +++ b/mambabase/SelectGroupsPage.ui @@ -0,0 +1,222 @@ + + + Form + + + + 0 + 0 + 552 + 392 + + + + + 0 + 0 + + + + Form + + + + + 0 + 0 + 551 + 391 + + + + + + + + 0 + 0 + + + + background-color: rgb(239, 240, 241); +background-color: rgb(255, 255, 255); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 511 + 31 + + + + <html><head/><body><p><span style=" font-weight:600;">Please, select from the boxes below the components that you want to install or update from network.</span></p></body></html> + + + true + + + + + + 10 + 50 + 531 + 331 + + + + background-color: rgb(239, 240, 241); + + + openmamba installations/updates + + + + + 20 + 30 + 491 + 21 + + + + System base packages (recommended) + + + true + + + + + + 20 + 60 + 491 + 21 + + + + Office packages (OpenOffice, ...) + + + + + + 20 + 90 + 491 + 21 + + + + Audio and Video players (VLC, kaffeine, ...) + + + + + + 20 + 120 + 491 + 21 + + + + Multimedia editing and production (kino, audacity, rosegarden, mixxx, ...) + + + + + + 20 + 150 + 491 + 21 + + + + Internet communication and p2p + + + + + + 20 + 180 + 491 + 21 + + + + Graphics software (gimp, digikam, blender, krita) + + + + + + 20 + 240 + 491 + 21 + + + + Emulation and virtualization (VirtualBox, wine) + + + + + + 20 + 270 + 491 + 21 + + + + Base server packages (Apache, PHP, MariaDB, ...) + + + + + + 20 + 300 + 491 + 21 + + + + Base development packages (gcc, glibc-devel, kernel headers, ...) + + + + + + 20 + 210 + 491 + 21 + + + + Games (tuxracer, pingus, ksudoku, ...) + + + + + + + + + + + diff --git a/mambabase/WelcomePage.ui b/mambabase/WelcomePage.ui new file mode 100644 index 0000000..1118a67 --- /dev/null +++ b/mambabase/WelcomePage.ui @@ -0,0 +1,167 @@ + + + Form + + + + 0 + 0 + 552 + 380 + + + + + 0 + 0 + + + + Form + + + + + 0 + 0 + 551 + 381 + + + + + + + + 0 + 0 + + + + + 0 + 160 + + + + background-color: rgb(255, 255, 255); + + + QFrame::Box + + + QFrame::Raised + + + + + 20 + 10 + 491 + 61 + + + + + 0 + 0 + + + + + + + openmamba.png + + + Qt::AlignCenter + + + + + + 10 + 80 + 511 + 72 + + + + + + + <html><head/><body><p><span style=" font-style:italic;">Copyright (c) 2007-2019 by Silvan Calarco<br/>Released under the terms of the GNU GPL v3 license</span></p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + <html><head/><body><p><a href="https://openmamba.org"><span style=" text-decoration: underline; color:#2980b9;">openmamba.org</span></a></p></body></html> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + 0 + 0 + + + + background-color: rgb(239, 240, 241); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 511 + 81 + + + + <html><head/><body><p>This program will complete the installation by adding the minimum recommended set of packages to the system. Additionally it will let you install, upon selection, macro-group of packages and proprietary software components.</p><p><span style=" font-weight:600;">TIP</span>: you may run this program later from the <span style=" font-style:italic;">openmamba control center</span> on the tray icon bar.</p></body></html> + + + true + + + + + + 10 + 180 + 321 + 20 + + + + <html><head/><body><p><span style=" font-weight:600;">Please, press the Next button to continue.</span></p></body></html> + + + + + + + + + + diff --git a/mambabase/mambabase-pkggroups-parser.sh b/mambabase/mambabase-pkggroups-parser.sh new file mode 100755 index 0000000..42c0ad6 --- /dev/null +++ b/mambabase/mambabase-pkggroups-parser.sh @@ -0,0 +1,28 @@ +#!/bin/bash +. /usr/share/openmamba/pkggroups.db + +echo kernel_mamba=$KERNEL_MAMBA_PKGS +echo kernel_mamba_64gb=$KERNEL_MAMBA_64GB_PKGS +echo kernel_mamba_x86_64=$KERNEL_MAMBA_X86_64_PKGS +echo kernel_mamba_arm=$KERNEL_MAMBA_ARM_PKGS +echo base=$BASE_PKGS +echo base_extras=$BASE_PKGS_EXTRAS +echo office=$OFFICE_PKGS +echo office_extras=$OFFICE_EXTRA_PKGS +echo multimedia_players=$MULTIMEDIA_PLAYERS_PKGS +echo multimedia_players_extras=$MULTIMEDIA_PLAYERS_EXTRA_PKGS +echo multimedia_editing=$MULTIMEDIA_EDITING_PKGS +echo multimedia_editing_extras=$MULTIMEDIA_EDITING_EXTRA_PKGS +echo audio=$AUDIO_PKGS +echo audio_prof=$AUDIO_PROF_PKGS +echo video=$VIDEO_PKGS +echo internet=$INTERNET_PKGS +echo internet_extra=$INTERNET_EXTRA_PKGS +echo graphics=$GRAPHICS_PKGS +echo graphics_extras=$GRAPHICS_EXTRA_PKGS +echo scientific=$SCIENTIFIC_PKGS +echo games=$GAMES_PKGS +echo games_extra=$GAMES_EXTRA_PKGS +echo virtualization=$VIRTUALIZATION_PKGS +echo server=$SERVER_PKGS +echo devel=$DEVEL_PKGS diff --git a/mambabase/mambabase.py b/mambabase/mambabase.py new file mode 100755 index 0000000..3183893 --- /dev/null +++ b/mambabase/mambabase.py @@ -0,0 +1,255 @@ +#!/usr/bin/env python3 +# Copyright (c) 2019 by Silvan Calarco +# Release under the terms of the GPL version 3 license + +from PyQt5 import QtCore +from PyQt5 import QtGui +from PyQt5.QtCore import pyqtProperty +from PyQt5 import QtCore, QtWidgets +from PyQt5 import QtWidgets, uic +from pathlib import Path +import gettext +import subprocess +import os + +import gi +gi.require_version('PackageKitGlib', '1.0') +from gi.repository import PackageKitGlib as packagekit + + +class InstallThread(QtCore.QThread): + parent = None + doneSignal = QtCore.pyqtSignal() + updateProgressSignal = QtCore.pyqtSignal(dict) + pkggroups = {} + + def __init__(self, parent=None): + super(InstallThread, self).__init__(parent) + self.parent = parent + self.doneSignal.connect(parent.installationPage.completeChanged) + self.updateProgressSignal.connect( + parent.installationPage.updateProgressSlot) + # Load packages group db into a dict + result = subprocess.run(['/usr/libexec/mambabase-pkggroups-parser.sh'], + stdout=subprocess.PIPE) + lines = result.stdout.decode('UTF-8').splitlines() + for line in lines: + if line: + (key, val) = line.split("=") + self.pkggroups[key] = val + + def run(self): + install = {} + parent = self.parent + + # Disable back and next buttons + parent.installationPage.done = False + self.doneSignal.emit() + self.updateProgressSignal.emit( + { 'value': 1, 'label': _("Starting installation...")}) + + # Groups + install['base'] = \ + parent.selectGroupsPage.inst_base.isChecked() + install['office'] = \ + parent.selectGroupsPage.inst_office.isChecked() + install['players'] = \ + parent.selectGroupsPage.inst_players.isChecked() + install['multimedia_editing'] = \ + parent.selectGroupsPage.inst_multimedia_editing.isChecked() + install['internet'] = \ + parent.selectGroupsPage.inst_internet.isChecked() + install['graphics'] = \ + parent.selectGroupsPage.inst_graphics.isChecked() + install['games'] = \ + parent.selectGroupsPage.inst_games.isChecked() + install['virtualization'] = \ + parent.selectGroupsPage.inst_virtualization.isChecked() + install['server'] = \ + parent.selectGroupsPage.inst_server.isChecked() + install['devel'] = \ + parent.selectGroupsPage.inst_devel.isChecked() + # Extra proprietary + install['nvidia'] = \ + parent.selectExtraPage.inst_nvidia.isChecked() + install['fglrx'] = \ + parent.selectExtraPage.inst_fglrx.isChecked() + install['fglrx_legacy'] = \ + parent.selectExtraPage.inst_fglrx_legacy.isChecked() + install['broadcom_sta'] = \ + parent.selectExtraPage.inst_broadcom_sta.isChecked() + install['b43'] = \ + parent.selectExtraPage.inst_b43.isChecked() + install['flash'] = \ + parent.selectExtraPage.inst_flash.isChecked() + install['pepperflash'] = \ + parent.selectExtraPage.inst_pepperflash.isChecked() + install['msttcf'] = \ + parent.selectExtraPage.inst_msttcf.isChecked() + install['codecs'] = \ + parent.selectExtraPage.inst_codecs.isChecked() + install['java'] = \ + parent.selectExtraPage.inst_java.isChecked() + install['skype'] = \ + parent.selectExtraPage.inst_skype.isChecked() + install['spotify'] = \ + parent.selectExtraPage.inst_spotify.isChecked() + install['virtualbox'] = \ + parent.selectExtraPage.inst_virtualbox.isChecked() + install['widevine'] = \ + parent.selectExtraPage.inst_widevine.isChecked() + + # Update packages list + self.updateProgressSignal.emit({ 'value': 5, + 'label': _("Updating packages list...")}) + + result = subprocess.run(['pkcon', 'refresh', 'force'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if result.returncode == 0: + if result.stdout: + self.updateProgressSignal.emit({ + 'details': result.stdout.decode('UTF-8')}) + else: + if result.stderr: + self.updateProgressSignal.emit({ + 'details': result.stderr.decode('UTF-8')}) + + # Perform system update + self.updateProgressSignal.emit({ 'value': 10, + 'label': _("Updating installed packages...")}) + + result = subprocess.run(['pkcon', 'update'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if result.returncode == 0: + if result.stdout: + self.updateProgressSignal.emit({ + 'details': result.stdout.decode('UTF-8')}) + else: + if result.stderr: + self.updateProgressSignal.emit({ + 'details': result.stderr.decode('UTF-8')}) + + self.updateProgressSignal.emit({ 'value': 20 }) + + # Install requested packages + arch = os.uname()[4] + if arch == 'i686': + arch = 'i586' + elif arch[:3] == 'arm': + arch = 'arm' + client = packagekit.Client() + for inst in install: + if install[inst]: + parent.installationPage.progressLabel.setText( + _("Installing %s packages..." % inst)) + for p in self.pkggroups[inst].split(): + result =client.resolve(0, (p,), None, + self.packagekit_progress_cb, None) + pkgs = result.get_package_array() + for p in pkgs: + if 'installed' in p.get_data().split(':'): + break + if p.get_arch() != arch: + continue + packageid = p.get_name() + ';' + p.get_version() + ';' \ + + p.get_arch() + ';' + p.get_data() + client.install_packages(False, (packageid, ), None, + self.packagekit_progress_cb, p.get_name()) + + self.updateProgressSignal.emit({ 'value': 100, + 'label': _("Installation finished!")}) + + # Enable back and next buttons + parent.installationPage.done = True + self.doneSignal.emit() + + def packagekit_progress_cb(self, status, typ, data=None): + if status.get_property('package'): + self.updateProgressSignal.emit({ + 'label': _("Installing %s package (%s)..." % + (status.get_property('package').get_name(), + str(status.get_percentage())))}) + + +class MambabaseWizard(QtWidgets.QWizard): + def __init__(self, parent=None): + super(MambabaseWizard, self).__init__(parent) + self.addPage(WelcomePage(self)) + self.selectGroupsPage = SelectGroupsPage(self) + self.addPage(self.selectGroupsPage) + self.selectExtraPage = SelectExtraPage(self) + self.addPage(self.selectExtraPage) + self.installationPage = InstallationPage(self) + self.addPage(self.installationPage) + self.finishPage = FinishPage(self) + self.addPage(self.finishPage) + self.setWindowTitle("openmamba base network installations - openmamba.org") + self.setFixedSize(571,465) + self.currentIdChanged.connect(self.currentIdChangedSlot) + self.installThread = InstallThread(self) + + def currentIdChangedSlot(self, currentId): + if currentId == 3: + self.installThread.start() + + +class WelcomePage(QtWidgets.QWizardPage): + def __init__(self, parent=None): + super(WelcomePage, self).__init__(parent) + uic.loadUi('WelcomePage.ui', self) + self.show() + + +class SelectGroupsPage(QtWidgets.QWizardPage): + def __init__(self, parent=None): + super(SelectGroupsPage, self).__init__(parent) + uic.loadUi('SelectGroupsPage.ui', self) + self.show() + + +class SelectExtraPage(QtWidgets.QWizardPage): + def __init__(self, parent=None): + super(SelectExtraPage, self).__init__(parent) + uic.loadUi('SelectExtraPage.ui', self) + self.setCommitPage(True) + self.show() + + +class InstallationPage(QtWidgets.QWizardPage): + done = False + parent = None + + def __init__(self, parent=None): + super(InstallationPage, self).__init__(parent) + uic.loadUi('InstallationPage.ui', self) + self.parent = parent + self.show() + + def isComplete(self): + return self.done + + @QtCore.pyqtSlot(dict) + def updateProgressSlot(self, dict): + if 'value' in dict: + self.progressBar.setValue(dict['value']) + if 'label' in dict: + self.progressLabel.setText(dict['label']) + if 'details' in dict: + self.progressDetails.setText(dict['details']) + + +class FinishPage(QtWidgets.QWizardPage): + def __init__(self, parent=None): + super(FinishPage, self).__init__(parent) + uic.loadUi('FinishPage.ui', self) + self.show() + + +if __name__ == '__main__': + import sys + app = QtWidgets.QApplication(sys.argv) + app.setWindowIcon(QtGui.QIcon("mamba-128x128.png")) + wizard = MambabaseWizard() + gettext.install('mambabase', '/usr/share/locale') + wizard.show() + sys.exit(app.exec_()) diff --git a/mambabase/openmamba.png b/mambabase/openmamba.png new file mode 100644 index 0000000..ff941ba Binary files /dev/null and b/mambabase/openmamba.png differ