Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • fix_opensuse_package_build
  • develop
  • release-1.0.0
  • release-1.0.1
  • release-2.0.0
  • release-2.0.1
  • release-2.0.2
  • release-2.0.3
  • release-3.0.0
  • release-3.0.1
  • release-3.0.2
  • release-3.0.3
  • release-3.1.0
14 results

Target

Select target project
  • akiraohgaki / ocs-url
  • ab3875o / ocs-url
  • dembego3 / ocs-url
  • arakun / ocs-url
  • longviauroy / ocs-url
  • rolfen / ocs-url
  • hemm / ocs-url
  • simonsvw0000 / ocs-url
  • DFN2 / ocs-url
  • rws77 / ocs-url
  • bitwalk / ocs-url
  • visdom / ocs-url
  • ricatfarker / ocs-url
  • mussah / ocs-url
  • tigefa / ocs-url
  • cobalt2727 / ocs-url
  • ammark226 / ocs-url
  • violethaze74 / ocs-url
  • armedssault / ocs-url
  • billflick / ocs-url
20 results
Select Git revision
  • master
  • fix_opensuse_package_build
  • develop
  • release-1.0.0
  • release-1.0.1
  • release-2.0.0
  • release-2.0.1
  • release-2.0.2
  • release-2.0.3
  • release-3.0.0
  • release-3.0.1
  • release-3.0.2
  • release-3.0.3
  • release-3.1.0
14 results
Show changes

Commits on Source 180

80 additional commits have been omitted to prevent performance issues.
53 files
+ 1499
775
Compare changes
  • Side-by-side
  • Inline

Files

+1 −1
Original line number Diff line number Diff line
*.pro.user
build_*/
lib/qtlib/
lib/qtil/

.gitlab-ci.yml

0 → 100644
+54 −0
Original line number Diff line number Diff line
stages:
  - build

ubuntu_deb:
  stage: build
  image: ubuntu:14.04
  only:
    - master
    - /^release\-.+/
  script:
    - ./scripts/package ubuntu_deb
  artifacts:
    paths:
    - build_*/ocs-url*.deb
    expire_in: 2 days

fedora_rpm:
  stage: build
  image: fedora:20
  only:
    - master
    - /^release\-.+/
  script:
    - ./scripts/package fedora_rpm
  artifacts:
    paths:
    - build_*/RPMS/x86_64/ocs-url*.rpm
    expire_in: 2 days

opensuse_rpm:
  stage: build
  image: opensuse/leap:42.3
  only:
    - master
    - /^release\-.+/
  script:
    - ./scripts/package opensuse_rpm
  artifacts:
    paths:
    - build_*/RPMS/x86_64/ocs-url*.rpm
    expire_in: 2 days

archlinux_pkg:
  stage: build
  image: archlinux/base:latest
  only:
    - master
    - /^release\-.+/
  script:
    - ./scripts/package archlinux_pkg
  artifacts:
    paths:
    - build_*/ocs-url*.pkg.tar.xz
    expire_in: 2 days
+6 −6
Original line number Diff line number Diff line
# ocs-url

An install helper program for items served on OpenCollaborationServices (OCS).
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

Copyright: 2016-2017, Akira Ohgaki
An install helper program for items served via OpenCollaborationServices (ocs://).

Copyright: 2016-2019, Opendesktop.org

License: GPL-3+

Download Linux package from:

https://www.linux-apps.com/p/1136805/

And please check the ocs-url wiki for more information.
https://www.opendesktop.org/p/1136805/

https://github.com/ocs-url/ocs-url/wiki
And please see docs/* for more information.
+4 −0
Original line number Diff line number Diff line
CONFIG += c++11

QT += \
    core \
    gui \
    widgets \
    qml \
    quick \
    svg
@@ -16,6 +19,7 @@ SOURCES += \

RESOURCES += \
    $${PWD}/configs/configs.qrc \
    $${PWD}/images/images.qrc \
    $${PWD}/qml/qml.qrc

INCLUDEPATH += $${PWD}/src
Original line number Diff line number Diff line
{
    "id": "ocs-url",
    "name": "ocs-url",
    "version": "2.0.3",
    "organization": "ocs-url",
    "domain": "com.ocs-url.ocs-url",
    "version": "3.1.0",
    "organization": "Opendesktop.org",
    "domain": "org.opendesktop.ocs-url",
    "icon": ":/desktop/ocs-url.svg",
    "description": "An install helper program for items served on OpenCollaborationServices (OCS).",
    "description": "An install helper program for items served via OpenCollaborationServices (ocs://).",
    "license": "GPL-3+",
    "author": "Akira Ohgaki",
    "contact": "akiraohgaki@gmail.com",
    "homepage": "https://github.com/ocs-url/ocs-url"
    "author": "Opendesktop.org",
    "contact": "contact@opendesktop.org",
    "homepage": "https://git.opendesktop.org/akiraohgaki/ocs-url"
}
Original line number Diff line number Diff line
{
    "bin": {
        "name": "Softwares",
        "name": "Software",
        "destination": "$HOME/.local/bin",
        "generic_destination": "$APP_DATA/bin"
    },
    "downloads": {
        "name": "Downloads",
        "destination": "$HOME/Downloads",
        "destination": "$XDG_DOWNLOAD_DIR",
        "generic_destination": "$APP_DATA/downloads"
    },
    "documents": {
        "name": "Documents",
        "destination": "$HOME/Documents",
        "destination": "$XDG_DOCUMENTS_DIR",
        "generic_destination": "$APP_DATA/documents"
    },
    "pictures": {
        "name": "Pictures",
        "destination": "$HOME/Pictures",
        "destination": "$XDG_PICTURES_DIR",
        "generic_destination": "$APP_DATA/pictures"
    },
    "music": {
        "name": "Music",
        "destination": "$HOME/Music",
        "destination": "$XDG_MUSIC_DIR",
        "generic_destination": "$APP_DATA/music"
    },
    "videos": {
        "name": "Videos",
        "destination": "$HOME/Videos",
        "destination": "$XDG_VIDEOS_DIR",
        "generic_destination": "$APP_DATA/videos"
    },
    "wallpapers": {
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="128" height="128" viewBox="0, 0, 128, 128">
  <g id="icon">
    <path d="M64,8 C33.072,8 8,33.072 8,64 C8,94.928 33.072,120 64,120 C94.928,120 120,94.928 120,64 C120,33.072 94.928,8 64,8 z M64,24 C68.418,24 72,27.582 72,32 C72,36.418 68.418,40 64,40 C59.582,40 56,36.418 56,32 C56,27.582 59.582,24 64,24 z M48,48 L72,48 L72,96 L80,96 L80,104 L48,104 L48,96 L56,96 L56,56 L48,56 L48,48 z" fill="#000000" id="dialog-information"/>
  </g>
</svg>
+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="128" height="128" viewBox="0, 0, 128, 128">
  <g id="icon">
    <path d="M64,16 L8,112 L120,112 L64,16 z M56,48 L72,48 L72,80 L56,80 L56,48 z M64,88 C68.418,88 72,91.582 72,96 C72,100.418 68.418,104 64,104 C59.582,104 56,100.418 56,96 C56,91.582 59.582,88 64,88 z" fill="#000000" id="dialog-warning"/>
  </g>
</svg>
+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="128" height="128" viewBox="0, 0, 128, 128">
  <g id="icon">
    <path d="M64,8 C33.072,8 8,33.072 8,64 C8,94.928 33.072,120 64,120 C94.928,120 120,94.928 120,64 C120,33.072 94.928,8 64,8 z M80,32 L104,32 L56,104 L32,80 L32,56 L56,80 L80,32 z" fill="#000000" id="emblem-default"/>
  </g>
</svg>
+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="128" height="128" viewBox="0, 0, 128, 128">
  <g id="icon">
    <path d="M40,8 L40,48 L16,48 L64,96 L112,48 L88,48 L88,8 L40,8 z M8,72 L8,120 L120,120 L120,72 L104,72 L104,104 L24,104 L24,72 L8,72 z" fill="#000000" id="emblem-downloads"/>
  </g>
</svg>

app/images/images.qrc

0 → 100644
+8 −0
Original line number Diff line number Diff line
<RCC>
    <qresource prefix="/images">
        <file>icons/dialog-information.svg</file>
        <file>icons/dialog-warning.svg</file>
        <file>icons/emblem-default.svg</file>
        <file>icons/emblem-downloads.svg</file>
    </qresource>
</RCC>
+58 −32
Original line number Diff line number Diff line
// Still support Qt 5.2, so doesn't use QtQuick.Dialogs 1.2
import QtQuick 2.0
import QtQuick.Window 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0

@@ -8,23 +6,25 @@ import "ui" as Ui

import "scripts/Utility.js" as Utility

Window {
ApplicationWindow {
    id: app

    title: configHandler.getAppConfigApplication().name

    visible: true
    width: 400
    minimumWidth: width
    maximumWidth: width
    height: 200
    minimumWidth: 400
    minimumHeight: 200
    maximumWidth: 800
    maximumHeight: 400
    visible: true
    minimumHeight: height
    maximumHeight: height

    function init() {
        var metadata = ocsUrlHandler.metadata();

        var primaryMessages = {
            "success_download": qsTr("Download successfull"),
            "success_install": qsTr("Installation successfull"),
            "success_download": qsTr("Download successful"),
            "success_install": qsTr("Installation successful"),
            "error_validation": qsTr("Validation error"),
            "error_network": qsTr("Network error"),
            "error_save": qsTr("Saving file failed"),
@@ -40,7 +40,7 @@ Window {
            progressDialog.close();
            infoDialog.primaryText = primaryMessages[result.status];
            infoDialog.informativeText = metadata.filename;
            //infoDialog.detailedText = result.message;
            infoDialog.detailedText = result.message;
            infoDialog.open();
        });

@@ -48,15 +48,15 @@ Window {
            progressDialog.close();
            errorDialog.primaryText = primaryMessages[result.status];
            errorDialog.informativeText = metadata.filename;
            //errorDialog.detailedText = result.message;
            errorDialog.detailedText = result.message;
            errorDialog.open();
        });

        ocsUrlHandler.downloadProgress.connect(function(id, bytesReceived, bytesTotal) {
            progressDialog.primaryText = qsTr("Downloading");
            progressDialog.informativeText = metadata.filename;
            progressDialog.progress = bytesReceived / bytesTotal;
            progressDialog.progressText
            progressDialog.detailedContentLoader.item.progressBar = bytesReceived / bytesTotal;
            progressDialog.detailedContentLoader.item.progressText
                    = Utility.convertByteToHumanReadable(bytesReceived)
                    + " / " + Utility.convertByteToHumanReadable(bytesTotal);
        });
@@ -69,33 +69,45 @@ Window {
                confirmDialog.primaryText = qsTr("Do you want to install?");
            }
            confirmDialog.informativeText = metadata.filename;
            /*
            confirmDialog.detailedText
                    = qsTr("URL") + ": " + metadata.url + "\n\n"
                    + qsTr("File") + ": " + metadata.filename + "\n\n"
                    = qsTr("URL") + ": " + metadata.url + "\n"
                    + qsTr("File") + ": " + metadata.filename + "\n"
                    + qsTr("Type") + ": " + configHandler.getAppConfigInstallTypes()[metadata.type].name;
            */
            confirmDialog.open();
        }
        else {
            errorDialog.primaryText = primaryMessages["error_validation"];
            errorDialog.informativeText = qsTr("Invalid OCS-URL");
            errorDialog.detailedText = qsTr("Invalid OCS-URL");
            errorDialog.open();
        }
    }

    function fixWindowSize(dialog) {
        if (dialog.visible) {
            app.height = dialog.implicitHeight + (dialog.anchors.margins * 2);
            app.minimumHeight = app.height;
            app.maximumHeight = app.height;
        }
    }

    Ui.Dialog {
        id: confirmDialog
        //icon: StandardIcon.Question
        icon: "qrc:/images/icons/dialog-information.svg"
        actionButton.text: qsTr("Details")
        actionButton.onClicked: toggleDetails()
        acceptButton.text: qsTr("OK")
        acceptButton.onClicked: ocsUrlHandler.process()
        rejectButton.text: qsTr("Cancel")
        rejectButton.onClicked: Qt.quit()
        onVisibleChanged: app.fixWindowSize(confirmDialog)
        onImplicitHeightChanged: app.fixWindowSize(confirmDialog)
    }

    Ui.Dialog {
        id: infoDialog
        //icon: StandardIcon.Information
        icon: "qrc:/images/icons/emblem-default.svg"
        actionButton.text: qsTr("Details")
        actionButton.onClicked: toggleDetails()
        acceptButton.text: qsTr("Open")
        acceptButton.onClicked: {
            ocsUrlHandler.openDestination();
@@ -103,25 +115,28 @@ Window {
        }
        rejectButton.text: qsTr("Close")
        rejectButton.onClicked: Qt.quit()
        onVisibleChanged: app.fixWindowSize(infoDialog)
        onImplicitHeightChanged: app.fixWindowSize(infoDialog)
    }

    Ui.Dialog {
        id: errorDialog
        //icon: StandardIcon.Warning
        icon: "qrc:/images/icons/dialog-warning.svg"
        actionButton.text: qsTr("Details")
        actionButton.onClicked: toggleDetails()
        rejectButton.text: qsTr("Close")
        rejectButton.onClicked: Qt.quit()
        onVisibleChanged: app.fixWindowSize(errorDialog)
        onImplicitHeightChanged: app.fixWindowSize(errorDialog)
    }

    Ui.Dialog {
        id: progressDialog
        //icon: StandardIcon.NoIcon
        rejectButton.text: qsTr("Cancel")
        rejectButton.onClicked: Qt.quit()
        property alias progress: progressBar.value
    Component {
        id: progressComponent
        ColumnLayout {
            property alias progressBar: progressBar.value
            property alias progressText: progressText.text
        content: ColumnLayout {
            anchors.fill: parent
            spacing: 8
            spacing: 4
            ProgressBar {
                id: progressBar
                minimumValue: 0
@@ -132,11 +147,22 @@ Window {
            Label {
                id: progressText
                text: ""
                anchors.right: parent.right
                Layout.alignment: Qt.AlignRight
            }
        }
    }

    Ui.Dialog {
        id: progressDialog
        icon: "qrc:/images/icons/emblem-downloads.svg"
        detailsVisible: true
        detailedContentLoader.sourceComponent: progressComponent
        rejectButton.text: qsTr("Cancel")
        rejectButton.onClicked: Qt.quit()
        onVisibleChanged: app.fixWindowSize(progressDialog)
        onImplicitHeightChanged: app.fixWindowSize(progressDialog)
    }

    Component.onCompleted: {
        app.init();
    }
Original line number Diff line number Diff line
@@ -5,16 +5,20 @@ import QtQuick.Controls 1.0
ColumnLayout {
    id: dialog

    visible: false
    anchors.fill: parent
    anchors.margins: 12
    spacing: 8
    visible: false
    spacing: 12

    property alias icon: icon.source
    property alias primaryText: primaryText.text
    property alias informativeText: informativeText.text

    property alias detailsVisible: details.visible
    property alias detailedText: detailedText.text
    property alias content: content.children
    property alias detailedContentLoader: detailedContentLoader

    property alias actionButton: actionButton
    property alias acceptButton: acceptButton
    property alias rejectButton: rejectButton

@@ -26,47 +30,72 @@ ColumnLayout {
        dialog.visible = false;
    }

    function toggleDetails() {
        details.visible = details.visible ? false : true;
    }

    RowLayout {
        Layout.fillWidth: true
        Layout.fillHeight: true
        spacing: parent.spacing
        spacing: 12
        Image {
            id: icon
            source: ""
            Layout.implicitWidth: 32
            Layout.implicitHeight: 32
            visible: source.toString() ? true : false
            Layout.preferredWidth: 48
            Layout.preferredHeight: 48
            sourceSize.width: 128
            sourceSize.height: 128
        }
        ColumnLayout {
            Layout.fillWidth: true
            spacing: parent.spacing
            spacing: 4
            Label {
                id: primaryText
                text: ""
                font.bold: true
                visible: text ? true : false
                Layout.fillWidth: true
                wrapMode: Text.WrapAnywhere
                font.bold: true
                font.pixelSize: 14
            }
            Label {
                id: informativeText
                text: ""
                visible: text ? true : false
                Layout.fillWidth: true
                wrapMode: Text.WrapAnywhere
            }
        }
    }

    ColumnLayout {
        id: details
        visible: false
        Layout.fillWidth: true
        Layout.fillHeight: true
        spacing: 12
        Label {
            id: detailedText
            text: ""
            visible: text ? true : false
            }
            Item {
                id: content
            Layout.fillWidth: true
                Layout.fillHeight: true
            wrapMode: Text.WrapAnywhere
        }
        Loader {
            id: detailedContentLoader
            visible: (source.toString() || sourceComponent) ? true : false
            Layout.fillWidth: true
        }
    }

    RowLayout {
        Layout.fillWidth: true
        spacing: parent.spacing
        spacing: 4
        Button {
            id: actionButton
            text: ""
            visible: text ? true : false
        }
        Item {
            Layout.fillWidth: true
        }
Original line number Diff line number Diff line
#include "confighandler.h"

#include <QStringList>
#include <QStandardPaths>

#include "qtlib_dir.h"
#include "qtil_dir.h"

ConfigHandler::ConfigHandler(QObject *parent)
    : QObject(parent)
{
    appConfig_ = qtlib::Config(":/configs");
    appConfig_ = Qtil::Config(":/configs");
    importAppConfigApplication();
    importAppConfigInstallTypes();
}

QJsonObject ConfigHandler::getAppConfigApplication()
QJsonObject ConfigHandler::getAppConfigApplication() const
{
    if (appConfigApplication_.isEmpty()) {
        appConfigApplication_ = appConfig_.get("application");
    }
    return appConfigApplication_;
}

QJsonObject ConfigHandler::getAppConfigInstallTypes()
QJsonObject ConfigHandler::getAppConfigInstallTypes() const
{
    if (appConfigInstallTypes_.isEmpty()) {
        QJsonObject installTypes = appConfig_.get("install_types");
        foreach (const QString &key, installTypes.keys()) {
            QJsonObject installtype = installTypes[key].toObject();
    return appConfigInstallTypes_;
}

void ConfigHandler::importAppConfigApplication()
{
    appConfigApplication_ = appConfig_.get("application");
}

void ConfigHandler::importAppConfigInstallTypes()
{
    auto installTypes = appConfig_.get("install_types");
    for (const auto &key : installTypes.keys()) {
        auto installtype = installTypes[key].toObject();
        installtype["destination"] = convertPathString(installtype["destination"].toString());
        installtype["generic_destination"] = convertPathString(installtype["generic_destination"].toString());
        installTypes[key] = installtype;
    }
        QJsonObject installTypesAlias = appConfig_.get("install_types_alias");
        foreach (const QString &key, installTypesAlias.keys()) {
            QJsonObject installTypeAlias = installTypesAlias[key].toObject();
            QString baseKey = installTypeAlias["base"].toString();
    auto installTypesAlias = appConfig_.get("install_types_alias");
    for (const auto &key : installTypesAlias.keys()) {
        auto installTypeAlias = installTypesAlias[key].toObject();
        auto baseKey = installTypeAlias["base"].toString();
        if (installTypes.contains(baseKey)) {
                QJsonObject installType = installTypes[baseKey].toObject();
            auto installType = installTypes[baseKey].toObject();
            installType["base"] = baseKey;
            installType["name"] = installTypeAlias["name"].toString();
            installTypes[key] = installType;
@@ -41,23 +50,36 @@ QJsonObject ConfigHandler::getAppConfigInstallTypes()
    }
    appConfigInstallTypes_ = installTypes;
}
    return appConfigInstallTypes_;
}

QString ConfigHandler::convertPathString(const QString &path)
QString ConfigHandler::convertPathString(const QString &path) const
{
    QString newPath = path;
    auto newPath = path;
    if (newPath.contains("$HOME")) {
        newPath.replace("$HOME", qtlib::Dir::homePath());
        newPath.replace("$HOME", Qtil::Dir::homePath());
    }
    else if (newPath.contains("$XDG_DOCUMENTS_DIR")) {
        newPath.replace("$XDG_DOCUMENTS_DIR", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
    }
    else if (newPath.contains("$XDG_DOWNLOAD_DIR")) {
        newPath.replace("$XDG_DOWNLOAD_DIR", QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
    }
    else if (newPath.contains("$XDG_PICTURES_DIR")) {
        newPath.replace("$XDG_PICTURES_DIR", QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
    }
    else if (newPath.contains("$XDG_MUSIC_DIR")) {
        newPath.replace("$XDG_MUSIC_DIR", QStandardPaths::writableLocation(QStandardPaths::MusicLocation));
    }
    else if (newPath.contains("$XDG_VIDEOS_DIR")) {
        newPath.replace("$XDG_VIDEOS_DIR", QStandardPaths::writableLocation(QStandardPaths::MoviesLocation));
    }
    else if (newPath.contains("$XDG_DATA_HOME")) {
        newPath.replace("$XDG_DATA_HOME", qtlib::Dir::genericDataPath());
        newPath.replace("$XDG_DATA_HOME", Qtil::Dir::genericDataPath());
    }
    else if (newPath.contains("$KDEHOME")) {
        newPath.replace("$KDEHOME", qtlib::Dir::kdehomePath());
        newPath.replace("$KDEHOME", Qtil::Dir::kdehomePath());
    }
    else if (newPath.contains("$APP_DATA")) {
        newPath.replace("$APP_DATA", qtlib::Dir::genericDataPath() + "/" + getAppConfigApplication()["id"].toString());
        newPath.replace("$APP_DATA", Qtil::Dir::genericDataPath() + "/" + getAppConfigApplication()["id"].toString());
    }
    return newPath;
}
Original line number Diff line number Diff line
@@ -3,23 +3,25 @@
#include <QObject>
#include <QJsonObject>

#include "qtlib_config.h"
#include "qtil_config.h"

class ConfigHandler : public QObject
{
    Q_OBJECT

public:
    explicit ConfigHandler(QObject *parent = 0);
    explicit ConfigHandler(QObject *parent = nullptr);

public slots:
    QJsonObject getAppConfigApplication();
    QJsonObject getAppConfigInstallTypes();
    QJsonObject getAppConfigApplication() const;
    QJsonObject getAppConfigInstallTypes() const;

private:
    QString convertPathString(const QString &path);
    void importAppConfigApplication();
    void importAppConfigInstallTypes();
    QString convertPathString(const QString &path) const;

    qtlib::Config appConfig_;
    Qtil::Config appConfig_;
    QJsonObject appConfigApplication_;
    QJsonObject appConfigInstallTypes_;
};
Original line number Diff line number Diff line
@@ -3,10 +3,10 @@
#include <QUrlQuery>
#include <QDesktopServices>

#include "qtlib_file.h"
#include "qtlib_dir.h"
#include "qtlib_networkresource.h"
#include "qtlib_package.h"
#include "qtil_file.h"
#include "qtil_dir.h"
#include "qtil_networkresource.h"
#include "qtil_package.h"

#include "handlers/confighandler.h"

@@ -39,15 +39,15 @@ void OcsUrlHandler::process()
        return;
    }

    QString url = metadata_["url"].toString();
    qtlib::NetworkResource *resource = new qtlib::NetworkResource(url, QUrl(url), true, this);
    connect(resource, &qtlib::NetworkResource::downloadProgress, this, &OcsUrlHandler::downloadProgress);
    connect(resource, &qtlib::NetworkResource::finished, this, &OcsUrlHandler::networkResourceFinished);
    auto url = metadata_["url"].toString();
    auto *resource = new Qtil::NetworkResource(url, QUrl(url), true, this);
    connect(resource, &Qtil::NetworkResource::downloadProgress, this, &OcsUrlHandler::downloadProgress);
    connect(resource, &Qtil::NetworkResource::finished, this, &OcsUrlHandler::networkResourceFinished);
    resource->get();
    emit started();
}

bool OcsUrlHandler::isValid()
bool OcsUrlHandler::isValid() const
{
    QString scheme = metadata_["scheme"].toString();
    QString command = metadata_["command"].toString();
@@ -55,8 +55,7 @@ bool OcsUrlHandler::isValid()
    QString type = metadata_["type"].toString();
    QString filename = metadata_["filename"].toString();

    // Still support xdg and xdgs schemes for backward compatibility
    if ((scheme == "ocs" || scheme == "ocss" || scheme == "xdg" || scheme == "xdgs")
    if ((scheme == "ocs" || scheme == "ocss")
            && (command == "download" || command == "install")
            && QUrl(url).isValid()
            && configHandler_->getAppConfigInstallTypes().contains(type)
@@ -66,13 +65,13 @@ bool OcsUrlHandler::isValid()
    return false;
}

void OcsUrlHandler::openDestination()
void OcsUrlHandler::openDestination() const
{
    QString type = metadata_["type"].toString();
    auto type = metadata_["type"].toString();
    QDesktopServices::openUrl(QUrl("file://" + configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString()));
}

void OcsUrlHandler::networkResourceFinished(qtlib::NetworkResource *resource)
void OcsUrlHandler::networkResourceFinished(Qtil::NetworkResource *resource)
{
    if (!resource->isFinishedWithNoError()) {
        QJsonObject result;
@@ -127,14 +126,14 @@ void OcsUrlHandler::parse()
    }
}

void OcsUrlHandler::saveDownloadedFile(qtlib::NetworkResource *resource)
void OcsUrlHandler::saveDownloadedFile(Qtil::NetworkResource *resource)
{
    QJsonObject result;

    QString type = metadata_["type"].toString();
    qtlib::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
    auto type = metadata_["type"].toString();
    Qtil::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
    destDir.make();
    qtlib::File destFile(destDir.path() + "/" + metadata_["filename"].toString());
    Qtil::File destFile(destDir.path() + "/" + metadata_["filename"].toString());

    if (!resource->saveData(destFile.path())) {
        result["status"] = QString("error_save");
@@ -151,11 +150,11 @@ void OcsUrlHandler::saveDownloadedFile(qtlib::NetworkResource *resource)
    resource->deleteLater();
}

void OcsUrlHandler::installDownloadedFile(qtlib::NetworkResource *resource)
void OcsUrlHandler::installDownloadedFile(Qtil::NetworkResource *resource)
{
    QJsonObject result;

    qtlib::File tempFile(qtlib::Dir::tempPath() + "/" + metadata_["filename"].toString());
    Qtil::File tempFile(Qtil::Dir::tempPath() + "/" + metadata_["filename"].toString());

    if (!resource->saveData(tempFile.path())) {
        result["status"] = QString("error_save");
@@ -165,11 +164,11 @@ void OcsUrlHandler::installDownloadedFile(qtlib::NetworkResource *resource)
        return;
    }

    qtlib::Package package(tempFile.path());
    QString type = metadata_["type"].toString();
    qtlib::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
    Qtil::Package package(tempFile.path());
    auto type = metadata_["type"].toString();
    Qtil::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
    destDir.make();
    qtlib::File destFile(destDir.path() + "/" + metadata_["filename"].toString());
    Qtil::File destFile(destDir.path() + "/" + metadata_["filename"].toString());

    if (type == "bin"
            && package.installAsProgram(destFile.path())) {
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
#include <QObject>
#include <QJsonObject>

namespace qtlib {
namespace Qtil {
class NetworkResource;
}

@@ -14,7 +14,7 @@ class OcsUrlHandler : public QObject
    Q_OBJECT

public:
    explicit OcsUrlHandler(const QString &ocsUrl, ConfigHandler *configHandler, QObject *parent = 0);
    explicit OcsUrlHandler(const QString &ocsUrl, ConfigHandler *configHandler, QObject *parent = nullptr);

signals:
    void started();
@@ -27,16 +27,16 @@ public slots:
    QJsonObject metadata() const;

    void process();
    bool isValid();
    void openDestination();
    bool isValid() const;
    void openDestination() const;

private slots:
    void networkResourceFinished(qtlib::NetworkResource *resource);
    void networkResourceFinished(Qtil::NetworkResource *resource);

private:
    void parse();
    void saveDownloadedFile(qtlib::NetworkResource *resource);
    void installDownloadedFile(qtlib::NetworkResource *resource);
    void saveDownloadedFile(Qtil::NetworkResource *resource);
    void installDownloadedFile(Qtil::NetworkResource *resource);

    QString ocsUrl_;
    ConfigHandler *configHandler_;
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ int main(int argc, char *argv[])
    // Init
    QApplication app(argc, argv);

    ConfigHandler *configHandler = new ConfigHandler();
    QJsonObject appConfigApplication = configHandler->getAppConfigApplication();
    auto *configHandler = new ConfigHandler();
    auto appConfigApplication = configHandler->getAppConfigApplication();

    app.setApplicationName(appConfigApplication["name"].toString());
    app.setApplicationVersion(appConfigApplication["version"].toString());
@@ -41,17 +41,17 @@ int main(int argc, char *argv[])
    clParser.addPositionalArgument("OCS-URL", "OCS-URL that starts with ocs://");
    clParser.process(app);

    QStringList args = clParser.positionalArguments();
    auto args = clParser.positionalArguments();

    if (args.size() != 1) {
        clParser.showHelp(1);
    }

    QString ocsUrl = args.at(0);
    auto ocsUrl = QString(args.at(0));

    // Setup QML
    QQmlApplicationEngine qmlAppEngine;
    QQmlContext *qmlContext = qmlAppEngine.rootContext();
    auto *qmlContext = qmlAppEngine.rootContext();
    configHandler->setParent(&qmlAppEngine);
    qmlContext->setContextProperty("configHandler", configHandler);
    qmlContext->setContextProperty("ocsUrlHandler", new OcsUrlHandler(ocsUrl, configHandler, &qmlAppEngine));

bitbucket-pipelines.yml

deleted100644 → 0
+0 −65
Original line number Diff line number Diff line
pipelines:
  custom:
    build-ubuntu:
      - step:
          image: ubuntu:14.04
          script:
            - apt update -qq
            - apt -y install sudo git curl
            - apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
            - apt -y install devscripts debhelper fakeroot
            - useradd -m pkgbuilder
            - export HOME=/home/pkgbuilder
            - chown -R pkgbuilder:pkgbuilder $(pwd)
            - sudo -u pkgbuilder sh scripts/build.sh ubuntu
    build-fedora:
      - step:
          image: fedora:20
          script:
            # dnf >= fedora:22
            - yum -y install sudo git curl
            - yum -y install make automake gcc gcc-c++ libtool qt5-qtbase-devel qt5-qtsvg-devel qt5-qtdeclarative-devel
            - yum -y install rpm-build
            - useradd -m pkgbuilder
            - export HOME=/home/pkgbuilder
            - chown -R pkgbuilder:pkgbuilder $(pwd)
            - sudo -u pkgbuilder sh scripts/build.sh fedora
    build-archlinux:
      - step:
          image: finalduty/archlinux:latest
          script:
            - pacman -Syu --noconfirm
            - pacman -S --noconfirm sudo git curl
            - pacman -S --noconfirm base-devel qt5-base qt5-svg qt5-declarative qt5-quickcontrols
            - useradd -m pkgbuilder
            - export HOME=/home/pkgbuilder
            - chown -R pkgbuilder:pkgbuilder $(pwd)
            - sudo -u pkgbuilder sh scripts/build.sh archlinux
    build-snap:
      - step:
          image: ubuntu:16.04
          script:
            - apt update -qq
            - apt -y install sudo git curl
            - apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
            - apt -y install snapcraft
            - useradd -m pkgbuilder
            - export HOME=/home/pkgbuilder
            - chown -R pkgbuilder:pkgbuilder $(pwd)
            - sudo -u pkgbuilder sh scripts/build.sh snap
    build-appimage:
      - step:
          image: ubuntu:14.04
          script:
            # Require docker run with --cap-add SYS_ADMIN --device /dev/fuse
            - echo 'appimage build is disabled currently'
            - exit 1
            - apt update -qq
            - apt -y install sudo git curl
            - apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
            - apt -y install fuse zsync desktop-file-utils
            #- modprobe fuse
            - useradd -m pkgbuilder
            - export HOME=/home/pkgbuilder
            - chown -R pkgbuilder:pkgbuilder $(pwd)
            - sudo -u pkgbuilder sh scripts/build.sh appimage
Original line number Diff line number Diff line
@@ -6,4 +6,4 @@ Type=Application
Terminal=false
NoDisplay=true
Categories=Network;Utility;
MimeType=x-scheme-handler/ocs;x-scheme-handler/ocss;x-scheme-handler/xdg;x-scheme-handler/xdgs;
MimeType=x-scheme-handler/ocs;x-scheme-handler/ocss;

docs/How-to-install.md

0 → 100644
+57 −0
Original line number Diff line number Diff line
# How to install


## Install from package

Download Linux package from: https://www.opendesktop.org/p/1136805/

Then click the downloaded package and continue to installation with package manager.

Or install the downloaded package using terminal:

Ubuntu 14.04

    $ sudo apt install libqt5svg5 qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin qtdeclarative5-controls-plugin
    $ sudo dpkg -i /path/to/ocs-url*.deb

Ubuntu 16.04

    $ sudo apt install libqt5svg5 qml-module-qtquick-controls
    $ sudo dpkg -i /path/to/ocs-url*.deb

Fedora 20

    # yum insall qt5-qtbase qt5-qtbase-gui qt5-qtsvg qt5-qtdeclarative qt5-qtquickcontrols
    # rpm -i /path/to/ocs-url*.rpm

Fedora 22

    # dnf insall qt5-qtbase qt5-qtbase-gui qt5-qtsvg qt5-qtdeclarative qt5-qtquickcontrols
    # rpm -i /path/to/ocs-url*.rpm

openSUSE 42.1

    # zypper install libQt5Svg5 libqt5-qtquickcontrols
    # rpm -i /path/to/ocs-url*.rpm

Arch Linux

    # pacman -S qt5-base qt5-svg qt5-declarative qt5-quickcontrols
    # pacman -U /path/to/ocs-url*.pkg.tar.xz


## Install from source

Make git clone, or download the source archive and extract it.

Build and install

    $ cd /path/to/ocs-url
    $ ./scripts/prepare
    $ qmake PREFIX=/usr
    $ make
    $ sudo make install

Uninstall

    $ sudo make uninstall

docs/How-to-use.md

0 → 100644
+19 −0
Original line number Diff line number Diff line
# How to use


## Web browser

Just click a OCS-URL (ocs://) links, or type OCS-URL in browser's address bar.

If you use Firefox, a program selection window opens the first time you open OCS-URL,
and you can choose "ocs-url" as custom URL handler.

If you don't get the program selection window or you are using another browser,
please set the ocs-url program as custom URL handler for ocs:// scheme in the browser's settings.


## Command-line

Execute ocs-url program with argument OCS-URL.

    $ ocs-url "ocs://install?url=http%3A%2F%2Fexample.com%2Ficons.tar.gz&type=icons"
+28 −0
Original line number Diff line number Diff line
# Internationalization

ocs-url/i18n/ is sub project for program internationalization.


## Localization for program

Using two tools lupdate and lrelease to make translation.

Text is gathered from program source files and included in QM files for translation along with other resource files.

### Creating TS (Translation Source) files

To generate TS files, sets TS file name to definition TRANSLATIONS in i18n.pro and run lupdate with i18n.pro.

    $ cd /path/to/ocs-url/i18n/
    $ lupdate i18n.pro

Then adds translations to the generated TS files using Qt Linguist or text editor.

### Creating QM (Qt Message) files

To generate QM files, run lrelease with i18n.pro.

    $ cd /path/to/ocs-url/i18n/
    $ lrelease i18n.pro

Then adds the path of the generated QM files to i18n.qrc.
+113 −0
Original line number Diff line number Diff line
# OCS-URL specification

OCS-URL is a custom URL that represent the installation method of items served on OpenCollaborationServices (OCS).


## URL structure

    [scheme]://[command]?[query string]

For example:

    ocs://install?url=http%3A%2F%2Fexample.com%2Ficons.tar.gz&type=icons


## Scheme

Scheme | Description
-------|------------
ocs | ocs scheme
ocss | ocs scheme for secure protocol

"ocss" scheme is the same of the ocs scheme for now,
it's a reserved name for secure protocol in the future.


## Command

Command | Description
--------|------------
download | Download the file from specified URL to the installation destination of specified install-type.
install | Make file downloading and trigger installation process.


## Query string

OCS-URL's query string is an option of command.

*All query string values should be urlencoded.*

Parameter | Required | Default | Description
----------|----------|---------|------------
url | Yes | - | File URL
type | - | downloads | Install-type
filename | - | File name from URL | Alternative file name

"filename" option is useful if the file URL does not represent a file name.

### Install-type

Available install-type:

Install-type | Installation destination
-------------|------------------
bin | $HOME/.local/bin
downloads | $HOME/Downloads
documents | $HOME/Documents
pictures | $HOME/Pictures
music | $HOME/Music
videos | $HOME/Videos
wallpapers | $XDG_DATA_HOME/wallpapers
fonts | $HOME/.fonts
cursors | $HOME/.icons
icons | $XDG_DATA_HOME/icons
emoticons | $XDG_DATA_HOME/emoticons
themes | $HOME/.themes
emerald_themes | $HOME/.emerald/themes
enlightenment_themes | $HOME/.e/e/themes
enlightenment_backgrounds | $HOME/.e/e/backgrounds
fluxbox_styles | $HOME/.fluxbox/styles
pekwm_themes | $HOME/.pekwm/themes
icewm_themes | $HOME/.icewm/themes
plasma_plasmoids | $XDG_DATA_HOME/plasma/plasmoids
plasma_look_and_feel | $XDG_DATA_HOME/plasma/look-and-feel
plasma_desktopthemes | $XDG_DATA_HOME/plasma/desktoptheme
kwin_effects | $XDG_DATA_HOME/kwin/effects
kwin_scripts | $XDG_DATA_HOME/kwin/scripts
kwin_tabbox | $XDG_DATA_HOME/kwin/tabbox
aurorae_themes | $XDG_DATA_HOME/aurorae/themes
dekorator_themes | $XDG_DATA_HOME/deKorator/themes
qtcurve | $XDG_DATA_HOME/QtCurve
color_schemes | $XDG_DATA_HOME/color-schemes
gnome_shell_extensions | $XDG_DATA_HOME/gnome-shell/extensions
cinnamon_applets | $XDG_DATA_HOME/cinnamon/applets
cinnamon_desklets | $XDG_DATA_HOME/cinnamon/desklets
cinnamon_extensions | $XDG_DATA_HOME/cinnamon/extensions
nautilus_scripts | $XDG_DATA_HOME/nautilus/scripts
amarok_scripts | $KDEHOME/share/apps/amarok/scripts
yakuake_skins | $KDEHOME/share/apps/yakuake/skins
cairo_clock_themes | $HOME/.cairo-clock/themes
books | $APP_DATA/books
comics | $APP_DATA/comics

$APP_DATA is not environment variable, it's internal variable in the program and expressed to $XDG_DATA_HOME/{application ID or name}.

Available alias name of the install-type:

Alias | Install-type
------|-------------
gnome_shell_themes | themes
cinnamon_themes | themes
gtk2_themes | themes
gtk3_themes | themes
metacity_themes | themes
xfwm4_themes | themes
openbox_themes | themes
kvantum_themes | themes
compiz_themes | emerald_themes
beryl_themes | emerald_themes
plasma4_plasmoids | plasma_plasmoids
plasma5_plasmoids | plasma_plasmoids
plasma5_look_and_feel | plasma_look_and_feel
plasma5_desktopthemes | plasma_desktopthemes
plasma_color_schemes | color_schemes
+7 −4
Original line number Diff line number Diff line
SOURCES += $$system(find ../app -type f -name "*.cpp" -or -name "*.qml" -or -name "*.js")
SOURCES += $$system(find $${PWD}/../app -type f -name "*.cpp" -or -name "*.qml" -or -name "*.js")

TRANSLATIONS += \
    messages.ts \
    messages.en_US.ts
    $${PWD}/messages.ts \
    $${PWD}/messages.en_US.ts \
    $${PWD}/messages.ja_JP.ts \
    $${PWD}/messages.tr_TR.ts \
    $${PWD}/messages.zh_TW.ts

include(i18n.pri)
include($${PWD}/i18n.pri)
+3 −0
Original line number Diff line number Diff line
@@ -2,5 +2,8 @@
    <qresource prefix="/i18n">
        <file>messages.qm</file>
        <file>messages.en_US.qm</file>
        <file>messages.ja_JP.qm</file>
        <file>messages.tr_TR.qm</file>
        <file>messages.zh_TW.qm</file>
    </qresource>
</RCC>
Original line number Diff line number Diff line
@@ -6,142 +6,165 @@
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
        <source>Invalid OCS-URL</source>
        <translation type="unfinished"></translation>
        <translation>Invalid OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
        <source>Failed to save data</source>
        <translation type="unfinished"></translation>
        <translation>Failed to save data</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
        <source>The file has been downloaded</source>
        <translation type="unfinished"></translation>
        <translation>The file has been downloaded</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
        <source>The file has been installed as program</source>
        <translation type="unfinished"></translation>
        <translation>The file has been installed as program</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
        <source>The plasmoid has been installed</source>
        <translation type="unfinished"></translation>
        <translation>The plasmoid has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
        <source>The plasma look and feel has been installed</source>
        <translation type="unfinished"></translation>
        <translation>The plasma look and feel has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
        <source>The plasma desktop theme has been installed</source>
        <translation type="unfinished"></translation>
        <translation>The plasma desktop theme has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
        <source>The KWin effect has been installed</source>
        <translation type="unfinished"></translation>
        <translation>The KWin effect has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
        <source>The KWin script has been installed</source>
        <translation type="unfinished"></translation>
        <translation>The KWin script has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
        <source>The KWin window switcher has been installed</source>
        <translation type="unfinished"></translation>
        <translation>The KWin window switcher has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
        <source>The archive file has been extracted</source>
        <translation type="unfinished"></translation>
        <translation>The archive file has been extracted</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
        <source>The file has been installed</source>
        <translation type="unfinished"></translation>
        <translation>The file has been installed</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
        <source>Failed to installation</source>
        <translation type="unfinished"></translation>
        <translation>Failed to installation</translation>
    </message>
</context>
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="94"/>
        <source>Cancel</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="105"/>
        <source>Download successfull</source>
        <translation type="unfinished"></translation>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation>Download successful</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="106"/>
        <source>Installation successfull</source>
        <translation type="unfinished"></translation>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation>Installation successful</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="107"/>
        <location filename="../app/qml/main.qml" line="155"/>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation type="unfinished"></translation>
        <translation>Validation error</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="108"/>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation type="unfinished"></translation>
        <translation>Network error</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation type="unfinished"></translation>
        <translation>Saving file failed</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="110"/>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation type="unfinished"></translation>
        <translation>Installation failed</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="134"/>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation type="unfinished"></translation>
        <translation>Downloading</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="143"/>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation type="unfinished"></translation>
        <translation>Do you want to download?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="146"/>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation type="unfinished"></translation>
        <translation>Do you want to install?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="149"/>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation type="unfinished"></translation>
        <translation>URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="150"/>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation type="unfinished"></translation>
        <translation>File</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="151"/>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation type="unfinished"></translation>
        <translation>Type</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="156"/>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation type="unfinished"></translation>
        <translation>Invalid OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation>Details</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation>OK</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation>Cancel</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation>Open</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation>Close</translation>
    </message>
</context>
</TS>

i18n/messages.ja_JP.ts

0 → 100644
+170 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ja_JP">
<context>
    <name>OcsUrlHandler</name>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
        <source>Invalid OCS-URL</source>
        <translation>無効なOCS-URL</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
        <source>Failed to save data</source>
        <translation>ファイルの保存に失敗</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
        <source>The file has been downloaded</source>
        <translation>ファイルがダウンロードされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
        <source>The file has been installed as program</source>
        <translation>ファイルがプログラムとしてインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
        <source>The plasmoid has been installed</source>
        <translation>plasmoidがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
        <source>The plasma look and feel has been installed</source>
        <translation>plasma look and feelがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
        <source>The plasma desktop theme has been installed</source>
        <translation>plasma desktop themeがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
        <source>The KWin effect has been installed</source>
        <translation>KWin effectがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
        <source>The KWin script has been installed</source>
        <translation>KWin scriptがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
        <source>The KWin window switcher has been installed</source>
        <translation>KWin window switcherがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
        <source>The archive file has been extracted</source>
        <translation>圧縮ファイルが展開されました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
        <source>The file has been installed</source>
        <translation>ファイルがインストールされました</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
        <source>Failed to installation</source>
        <translation>インストールに失敗</translation>
    </message>
</context>
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation>ダウンロード成功</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation>インストール成功</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation>検証エラー</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation>通信エラー</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation>ファイル保存失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation>インストール失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation>ダウンロード中</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation>ダウンロードしますか?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation>インストールしますか?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation>URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation>ファイル</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation>タイプ</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation>無効なOCS-URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation>詳細</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation>OK</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation>キャンセル</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation>開く</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation>閉じる</translation>
    </message>
</context>
</TS>

i18n/messages.tr_TR.ts

0 → 100644
+170 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="tr_TR">
<context>
    <name>OcsUrlHandler</name>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
        <source>Invalid OCS-URL</source>
        <translation>Geçersiz OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
        <source>Failed to save data</source>
        <translation>Veri kaydedilemedi</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
        <source>The file has been downloaded</source>
        <translation>Dosya indirildi</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
        <source>The file has been installed as program</source>
        <translation>Dosya program olarak kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
        <source>The plasmoid has been installed</source>
        <translation>Plasmoid kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
        <source>The plasma look and feel has been installed</source>
        <translation>Plasma görünüş ve işleyişi kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
        <source>The plasma desktop theme has been installed</source>
        <translation>Plasma masaüstü teması kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
        <source>The KWin effect has been installed</source>
        <translation>KWin efekti kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
        <source>The KWin script has been installed</source>
        <translation>KWin betiği kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
        <source>The KWin window switcher has been installed</source>
        <translation>KWin pencere seçicisi kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
        <source>The archive file has been extracted</source>
        <translation>Arşiv açıldı</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
        <source>The file has been installed</source>
        <translation>Dosya kuruldu</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
        <source>Failed to installation</source>
        <translation>Kurulum başarısız oldu</translation>
    </message>
</context>
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation>Başarıyla indirildi</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation>Başarıyla kuruldu</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation>Doğrulama hatası</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation> hatası</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation>Dosya kaydedilemedi</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation>Kurulum başarısız oldu</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation>İndiriliyor</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation>İndirmek istiyor musunuz?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation>Kurmak istiyor musunuz?</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation>Bağlantı Adresi</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation>Dosya</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation>Tür</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation>Geçersiz OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation>Ayrıntılar</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation>Tamam</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation>İptal</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation>Kapat</translation>
    </message>
</context>
</TS>
+44 −21
Original line number Diff line number Diff line
@@ -73,75 +73,98 @@
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="94"/>
        <source>Cancel</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="105"/>
        <source>Download successfull</source>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="106"/>
        <source>Installation successfull</source>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="107"/>
        <location filename="../app/qml/main.qml" line="155"/>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="108"/>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="110"/>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="134"/>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="143"/>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="146"/>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="149"/>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="150"/>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="151"/>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="156"/>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation type="unfinished"></translation>
    </message>
</context>
</TS>

i18n/messages.zh_TW.ts

0 → 100644
+170 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_TW">
<context>
    <name>OcsUrlHandler</name>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="37"/>
        <source>Invalid OCS-URL</source>
        <translation>無效的 OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="141"/>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="162"/>
        <source>Failed to save data</source>
        <translation>儲存資料失敗</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="148"/>
        <source>The file has been downloaded</source>
        <translation>檔案已被下載</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="176"/>
        <source>The file has been installed as program</source>
        <translation>檔案已被安裝為程式</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="180"/>
        <source>The plasmoid has been installed</source>
        <translation>Plasmoid 已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="184"/>
        <source>The plasma look and feel has been installed</source>
        <translation>Plasma 外觀與感覺已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="188"/>
        <source>The plasma desktop theme has been installed</source>
        <translation>Plasma 桌面主題已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="192"/>
        <source>The KWin effect has been installed</source>
        <translation>KWin 特效已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="196"/>
        <source>The KWin script has been installed</source>
        <translation>KWin 指令稿已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="200"/>
        <source>The KWin window switcher has been installed</source>
        <translation>KWin 視窗切換器已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="203"/>
        <source>The archive file has been extracted</source>
        <translation>封存檔已被解壓縮</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="206"/>
        <source>The file has been installed</source>
        <translation>檔案已被安裝</translation>
    </message>
    <message>
        <location filename="../app/src/handlers/ocsurlhandler.cpp" line="210"/>
        <source>Failed to installation</source>
        <translation>安裝失敗</translation>
    </message>
</context>
<context>
    <name>main</name>
    <message>
        <location filename="../app/qml/main.qml" line="26"/>
        <source>Download successful</source>
        <translation>下載成功</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="27"/>
        <source>Installation successful</source>
        <translation>安裝成功</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="28"/>
        <source>Validation error</source>
        <translation>驗證失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="29"/>
        <source>Network error</source>
        <translation>網路錯誤</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="30"/>
        <source>Saving file failed</source>
        <translation>儲存檔案失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="31"/>
        <source>Installation failed</source>
        <translation>安裝失敗</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="56"/>
        <source>Downloading</source>
        <translation>正在下載</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="66"/>
        <source>Do you want to download?</source>
        <translation>您想要下載嗎</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="69"/>
        <source>Do you want to install?</source>
        <translation>您想要安裝嗎</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="73"/>
        <source>URL</source>
        <translation>URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="74"/>
        <source>File</source>
        <translation>檔案</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="75"/>
        <source>Type</source>
        <translation>類型</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="80"/>
        <source>Invalid OCS-URL</source>
        <translation>無效的 OCS-URL</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="96"/>
        <location filename="../app/qml/main.qml" line="109"/>
        <location filename="../app/qml/main.qml" line="125"/>
        <source>Details</source>
        <translation>詳細資訊</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="98"/>
        <source>OK</source>
        <translation>確定</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="100"/>
        <location filename="../app/qml/main.qml" line="160"/>
        <source>Cancel</source>
        <translation>取消</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="111"/>
        <source>Open</source>
        <translation>開啟</translation>
    </message>
    <message>
        <location filename="../app/qml/main.qml" line="116"/>
        <location filename="../app/qml/main.qml" line="127"/>
        <source>Close</source>
        <translation>關閉</translation>
    </message>
</context>
</TS>
+1 −1
Original line number Diff line number Diff line
include($${PWD}/qtlib/qtlib.pri)
include($${PWD}/qtil/qtil.pri)
+8 −11
Original line number Diff line number Diff line
@@ -2,17 +2,14 @@ TARGET = ocs-url

TEMPLATE = app

CONFIG += c++11

DEFINES += QT_DEPRECATED_WARNINGS

DISTFILES += README.md

include(lib/lib.pri)
include(app/app.pri)
include(desktop/desktop.pri)
include(i18n/i18n.pri)
include(pkg/pkg.pri)
include(scripts/scripts.pri)
DISTFILES += $${PWD}/README.md

include(deployment.pri)
include($${PWD}/lib/lib.pri)
include($${PWD}/app/app.pri)
include($${PWD}/desktop/desktop.pri)
include($${PWD}/i18n/i18n.pri)
include($${PWD}/pkg/pkg.pri)
include($${PWD}/scripts/scripts.pri)
include($${PWD}/deployment.pri)
+0 −208
Original line number Diff line number Diff line
#!/bin/bash

# The purpose of this script is to provide lightweight desktop integration
# into the host system without special help from the host system.
# If you want to have fuller and automatic desktop integration, you might
# consider to use the optional appimaged daemon instead.

# Exit on errors
set -e

# Be verbose if $DEBUG=1 is set
if [ ! -z "$DEBUG" ] ; then
  env
  set -x
fi

THIS="$0"
args=("$@") # http://stackoverflow.com/questions/3190818/
NUMBER_OF_ARGS="$#"

# Please do not change $VENDORPREFIX as it will allow for desktop files
# belonging to AppImages to be recognized by future AppImageKit components
# such as desktop integration daemons
VENDORPREFIX=appimagekit

APPDIR="$(dirname "$(readlink -f "${THIS}")")"

BIN="${APPDIR}/ocs-url"
export PATH="${APPDIR}/usr/bin:$PATH"

trap atexit EXIT

# Note that the following handles 0, 1 or more arguments (file paths)
# which can include blanks but uses a bashism; can the same be achieved
# in POSIX-shell? (FIXME)
# http://stackoverflow.com/questions/3190818
atexit()
{
if [ $NUMBER_OF_ARGS -eq 0 ] ; then
  exec "${BIN}"
else
  exec "${BIN}" "${args[@]}"
fi
}

error()
{
  if [ -x /usr/bin/zenity ] ; then
    LD_LIBRARY_PATH="" zenity --error --text "${1}" 2>/dev/null
  elif [ -x /usr/bin/kdialog ] ; then
    LD_LIBRARY_PATH="" kdialog --msgbox "${1}" 2>/dev/null
  elif [ -x /usr/bin/Xdialog ] ; then
    LD_LIBRARY_PATH="" Xdialog --msgbox "${1}" 2>/dev/null
  else
    echo "${1}"
  fi
  exit 1
}

yesno()
{
  TITLE=$1
  TEXT=$2
  if [ -x /usr/bin/zenity ] ; then
    LD_LIBRARY_PATH="" zenity --question --title="$TITLE" --text="$TEXT" 2>/dev/null || exit 0
  elif [ -x /usr/bin/kdialog ] ; then
    LD_LIBRARY_PATH="" kdialog --caption "" --title "$TITLE" -yesno "$TEXT" || exit 0
  elif [ -x /usr/bin/Xdialog ] ; then
    LD_LIBRARY_PATH="" Xdialog --title "$TITLE" --clear --yesno "$TEXT" 10 80 || exit 0
  else
    echo "zenity, kdialog, Xdialog missing. Skipping ${THIS}."
    exit 0
  fi
}

check_prevent()
{
  FILE=$1
  if [ -e "$FILE" ] ; then
    exit 0
  fi
}

# Exit immediately of one of these files is present
# (e.g., because the desktop environment wants to handle desktop integration itself)
check_prevent "$HOME/.local/share/$VENDORPREFIX/no_desktopintegration"
check_prevent "/usr/share/$VENDORPREFIX/no_desktopintegration"
check_prevent "/etc/$VENDORPREFIX/no_desktopintegration"

# Exit immediately if appimaged is running
pidof appimaged 2>/dev/null && exit 0

# Exit immediately if $DESKTOPINTEGRATION is not empty
if [ ! -z "$DESKTOPINTEGRATION" ] ; then
  exit 0
fi

check_dep()
{
  DEP=$1
  if [ -z $(which $DEP) ] ; then
    echo "$DEP is missing. Skipping ${THIS}."
    exit 0
  fi
}

DIRNAME="$APPDIR"

# Check whether dependencies are present in base system (we do not bundle these)
# http://cgit.freedesktop.org/xdg/desktop-file-utils/
check_dep desktop-file-validate
check_dep update-desktop-database
check_dep desktop-file-install
check_dep xdg-icon-resource
check_dep xdg-mime
check_dep xdg-desktop-menu

DESKTOPFILE=$(find "$APPDIR" -maxdepth 1 -name "*.desktop" | head -n 1)
# echo "$DESKTOPFILE"
DESKTOPFILE_NAME=$(basename "${DESKTOPFILE}")

if [ ! -f "$DESKTOPFILE" ] ; then
  echo "Desktop file is missing. Please run ${THIS} from within an AppImage."
  exit 0
fi

if [ -z "$APPIMAGE" ] ; then
  APPIMAGE="$APPDIR/AppRun"
  # Not running from within an AppImage; hence using the AppRun for Exec=
fi

ABS_APPIMAGE=$(readlink -e "$APPIMAGE")
ICONFILE="$APPDIR/.DirIcon"

# $XDG_DATA_DIRS contains the default paths /usr/local/share:/usr/share
# desktop file has to be installed in an applications subdirectory
# of one of the $XDG_DATA_DIRS components
if [ -z "$XDG_DATA_DIRS" ] ; then
  XDG_DATA_DIRS=/usr/local/share:/usr/share
fi

# Determine where the desktop file should be installed
if [[ $EUID -ne 0 ]]; then
   DESTINATION_DIR_DESKTOP="$HOME/.local/share/applications"
   SYSTEM_WIDE=""
else
   # TODO: Check $XDG_DATA_DIRS
   DESTINATION_DIR_DESKTOP="/usr/local/share/applications"
   SYSTEM_WIDE="--mode system" # for xdg-mime and xdg-icon-resource
fi

# Check if the desktop file is already there
# and if so, whether it points to the same AppImage
if [ -e "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" ] ; then
  # echo "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME already there"
  EXEC=$(grep "^Exec=" "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" | head -n 1 | cut -d " " -f 1)
  # echo $EXEC
  if [ "Exec=\"$APPIMAGE\"" == "$EXEC" ] ; then
    exit 0
  fi
fi

# We ask the user only if we have found no reason to skip until here
if [ -z "$SKIP" ] ; then
  yesno "Install" "Would you like to integrate $APPIMAGE with your system?\n\nThis will add it to your applications menu and install icons.\nIf you don't do this you can still launch the application by double-clicking on the AppImage."
fi

APP=$(echo "$DESKTOPFILE_NAME" | sed -e 's/.desktop//g')

# If the user has agreed, rewrite and install the desktop file, and the MIME information
if [ -z "$SKIP" ] ; then
  # desktop-file-install is supposed to install .desktop files to the user's
  # applications directory when run as a non-root user,
  # and to /usr/share/applications if run as root
  # but that does not really work for me...
  #
  # For Exec we must use quotes
  # For TryExec quotes is not supported, so, space must be replaced to \s
  # https://askubuntu.com/questions/175404/how-to-add-space-to-exec-path-in-a-thumbnailer-descrption/175567
  desktop-file-install --rebuild-mime-info-cache \
    --vendor=$VENDORPREFIX --set-key=Exec --set-value="\"${APPIMAGE}\" %u" \
    --set-key=X-AppImage-Comment --set-value="Generated by ${THIS}" \
    --set-icon="$ICONFILE" --set-key=TryExec --set-value=${APPIMAGE// /\\s} "$DESKTOPFILE" \
    --dir "$DESTINATION_DIR_DESKTOP"
  chmod a+x "$DESTINATION_DIR_DESKTOP/"*
  RESOURCE_NAME=$(echo "$VENDORPREFIX-$DESKTOPFILE_NAME" | sed -e 's/.desktop//g')
  # echo $RESOURCE_NAME

  # Install the icon files for the application; TODO: scalable
  ICONS=$(find "${APPDIR}/usr/share/icons/" -wholename "*/apps/${APP}.png" 2>/dev/null || true)
  for ICON in $ICONS ; do
    ICON_SIZE=$(echo "${ICON}" | rev | cut -d "/" -f 3 | rev | cut -d "x" -f 1)
    xdg-icon-resource install --context apps --size ${ICON_SIZE} "${ICON}" "${RESOURCE_NAME}"
  done

  # Install mime type
  find "${APPDIR}/usr/share/mime/" -type f -name *xml -exec xdg-mime install $SYSTEM_WIDE --novendor {} \; 2>/dev/null || true

  # Install the icon files for the mime type; TODO: scalable
  ICONS=$(find "${APPDIR}/usr/share/icons/" -wholename "*/mimetypes/*.png" 2>/dev/null || true)
  for ICON in $ICONS ; do
    ICON_SIZE=$(echo "${ICON}" | rev | cut -d "/" -f 3 | rev | cut -d "x" -f 1)
    xdg-icon-resource install --context mimetypes --size ${ICON_SIZE} "${ICON}" $(basename $ICON | sed -e 's/.png//g')
  done

  xdg-desktop-menu forceupdate
  gtk-update-icon-cache # for MIME
fi
Original line number Diff line number Diff line
# Maintainer: Akira Ohgaki <akiraohgaki@gmail.com>

pkgname='ocs-url'
pkgver='2.0.3'
pkgver='3.1.0'
pkgrel='1'
pkgdesc='An install helper program for items served on OpenCollaborationServices (OCS).'
pkgdesc='An install helper program for items served via OpenCollaborationServices (ocs://).'
arch=('i686' 'x86_64')
url='https://github.com/ocs-url/ocs-url'
url='https://git.opendesktop.org/akiraohgaki/ocs-url'
license=('GPL3')
depends=('qt5-base>=5.2.0' 'qt5-svg>=5.2.0' 'qt5-declarative>=5.2.0' 'qt5-quickcontrols>=5.2.0')
#source=("https://github.com/ocs-url/ocs-url/archive/release-${pkgver}.tar.gz")
makedepends=('git')
#source=("https://git.opendesktop.org/akiraohgaki/ocs-url/-/archive/release-${pkgver}/ocs-url-release-${pkgver}.tar.gz")
source=("${pkgname}.tar.gz")
md5sums=() #autofill using updpkgsums

prepare() {
    #cd "${pkgname}-release-${pkgver}"
    cd "${pkgname}"
    sh scripts/import.sh
    ./scripts/prepare
}

build() {
    #cd "${pkgname}-release-${pkgver}"
    cd "${pkgname}"
    qmake PREFIX="/usr"
    qmake PREFIX=/usr
    make
}

Original line number Diff line number Diff line
Summary: OCS-URL
Name: ocs-url
Version: 2.0.3
Version: 3.1.0
Release: 1%{?dist}
License: GPLv3+
Group: Applications/Internet
URL: https://github.com/ocs-url/ocs-url
URL: https://git.opendesktop.org/akiraohgaki/ocs-url

#Source0: https://github.com/ocs-url/ocs-url/archive/release-%{version}.tar.gz
#Source0: https://git.opendesktop.org/akiraohgaki/ocs-url/-/archive/release-%{version}/ocs-url-release-%{version}.tar.gz
Source0: %{name}.tar.gz

Requires: qt5-qtbase >= 5.2.0, qt5-qtbase-gui >= 5.2.0, qt5-qtsvg >= 5.2.0, qt5-qtdeclarative >= 5.2.0, qt5-qtquickcontrols >= 5.2.0
BuildRequires: make, automake, gcc, gcc-c++, libtool, qt5-qtbase-devel, qt5-qtsvg-devel, qt5-qtdeclarative-devel, rpm-build
BuildRequires: git, make, automake, gcc, gcc-c++, libtool, qt5-qtbase-devel >= 5.2.0, qt5-qtsvg-devel >= 5.2.0, qt5-qtdeclarative-devel >= 5.2.0, rpm-build

%description
An install helper program for items served on OpenCollaborationServices (OCS).
An install helper program for items served via OpenCollaborationServices (ocs://).

%prep
#%%autosetup -n %{name}-release-%{version}
%autosetup -n %{name}
sh scripts/import.sh
./scripts/prepare

%build
%define debug_package %{nil}
qmake-qt5 PREFIX="/usr"
qmake-qt5 PREFIX=/usr
make

%install
@@ -38,6 +38,36 @@ make INSTALL_ROOT="%{buildroot}" install
rm -rf %{buildroot}

%changelog
* Thu Jul 05 2018 Akira Ohgaki <akiraohgaki@gmail.com> - 3.1.0-1
- Drop old xdg:// and xdgs:// schemes
- Update library

* Tue Feb 06 2018 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.3-1
- Update library
- Fix spelling

* Fri Jun 23 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.2-1
- Add zh_TW translations (by s8321414)

* Mon Jun 05 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.1-1
- Update qtlib
- Fix for C++11
- Fix installation/download destination
- Fix translation messages (by otsoga)

* Sun Mar 05 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.0-1
- Rename xdgurl to ocs-url
- Add ocs:// and ocss:// schemes
- xdg:// and xdgs:// schemes still available for backward compatibile
- New app icon
- New dialog window
- Labels and messages are translatable
- Qt 5.2 support
- Use the same configs of install-types with ocsstore
- Add en_US translation
- Add ja_JP translation
- Add tr_TR translation (by tarakbumba)

* Wed Jan 25 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.3-1
- Change installation destination of type bin
- Update qtlib
@@ -57,7 +87,7 @@ rm -rf %{buildroot}
- Add install-type "bin"

* Fri Jul 15 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 1.0.1-1
- Clean successfull message
- Clean successful message
- Return exit code

* Wed Jul 06 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 1.0.0-1
+94 −0
Original line number Diff line number Diff line
Summary: OCS-URL
Name: ocs-url
Version: 3.1.0
Release: 1%{?dist}
License: GPLv3+
Group: Applications/Internet
URL: https://git.opendesktop.org/akiraohgaki/ocs-url

#Source0: https://git.opendesktop.org/akiraohgaki/ocs-url/-/archive/release-%{version}/ocs-url-release-%{version}.tar.gz
Source0: %{name}.tar.gz

Requires: libQt5Svg5 >= 5.2.0, libqt5-qtquickcontrols >= 5.2.0
BuildRequires: git, make, automake, gcc, gcc-c++, libtool, libqt5-qtbase-devel >= 5.2.0, libqt5-qtsvg-devel >= 5.2.0, libqt5-qtdeclarative-devel >= 5.2.0, rpm-build

%description
An install helper program for items served via OpenCollaborationServices (ocs://).

%prep
#%%autosetup -n %{name}-release-%{version}
%autosetup -n %{name}
./scripts/prepare

%build
%define debug_package %{nil}
qmake-qt5 PREFIX=/usr
make

%install
make INSTALL_ROOT="%{buildroot}" install

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg

%clean
rm -rf %{buildroot}

%changelog
* Thu Jul 05 2018 Akira Ohgaki <akiraohgaki@gmail.com> - 3.1.0-1
- Drop old xdg:// and xdgs:// schemes
- Update library

* Tue Feb 06 2018 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.3-1
- Update library
- Fix spelling

* Fri Jun 23 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.2-1
- Add zh_TW translations (by s8321414)

* Mon Jun 05 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.1-1
- Update qtlib
- Fix for C++11
- Fix installation/download destination
- Fix translation messages (by otsoga)

* Sun Mar 05 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 3.0.0-1
- Rename xdgurl to ocs-url
- Add ocs:// and ocss:// schemes
- xdg:// and xdgs:// schemes still available for backward compatibile
- New app icon
- New dialog window
- Labels and messages are translatable
- Qt 5.2 support
- Use the same configs of install-types with ocsstore
- Add en_US translation
- Add ja_JP translation
- Add tr_TR translation (by tarakbumba)

* Wed Jan 25 2017 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.3-1
- Change installation destination of type bin
- Update qtlib
- Fix for dialog

* Thu Nov 17 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.2-1
- Update qtlibs
- Small fix

* Mon Nov 14 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.1-1
- Update library
- Fix download/installation process

* Fri Oct 28 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 2.0.0-1
- Re-implemented xdgurl as Qt program
- Download progress bar
- Add install-type "bin"

* Fri Jul 15 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 1.0.1-1
- Clean successful message
- Return exit code

* Wed Jul 06 2016 Akira Ohgaki <akiraohgaki@gmail.com> - 1.0.0-1
- Initial release
+2 −4
Original line number Diff line number Diff line
@@ -6,7 +6,5 @@ DISTFILES += \
    $${PWD}/ubuntu/debian/rules \
    $${PWD}/ubuntu/debian/ocs-url.install \
    $${PWD}/fedora/ocs-url.spec \
    $${PWD}/archlinux/PKGBUILD \
    $${PWD}/snap/snapcraft.yaml \
    $${PWD}/snap/snap/gui/ocs-url.desktop \
    $${PWD}/appimage/appimage-desktopintegration_ocs-url
    $${PWD}/opensuse/ocs-url.spec \
    $${PWD}/archlinux/PKGBUILD

pkg/snap/snap/gui/ocs-url.desktop

deleted100644 → 0
+0 −9
Original line number Diff line number Diff line
[Desktop Entry]
Name=ocs-url
Exec=ocs-url.ocs-url %u
Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/ocs-url.svg
Type=Application
Terminal=false
NoDisplay=true
Categories=Network;Utility;
MimeType=x-scheme-handler/ocs;x-scheme-handler/ocss;x-scheme-handler/xdg;x-scheme-handler/xdgs;

pkg/snap/snapcraft.yaml

deleted100644 → 0
+0 −41
Original line number Diff line number Diff line
name: ocs-url
version: '0.0.0'
summary: OCS-URL
description: |
  An install helper program for items served on OpenCollaborationServices (OCS).

grade: devel
confinement: strict

#icon: desktop/ocs-url.svg

parts:
  ocs-url:
    prepare: |
      sh scripts/import.sh
    plugin: qmake
    source: ./
    qt-version: qt5
    options:
      - PREFIX="/usr"
    build-packages:
      - build-essential
      - qt5-default
      - libqt5svg5-dev
      - qtdeclarative5-dev
      - snapcraft
    stage-packages:
      - libqt5svg5
      - qml-module-qtquick-controls
    after:
      - desktop-qt5

apps:
  ocs-url:
    command: usr/bin/ocs-url
    plugs:
      - home
      - network
      - opengl
      - x11
      - unity7
Original line number Diff line number Diff line
ocs-url (3.1.0-0ubuntu1) trusty; urgency=low

  * Drop old xdg:// and xdgs:// schemes
  * Update library

 -- Akira Ohgaki <akiraohgaki@gmail.com>  Thu, 05 Jul 2018 05:43:18 +0000

ocs-url (3.0.3-0ubuntu1) trusty; urgency=low

  * Update library
  * Fix spelling

 -- Akira Ohgaki <akiraohgaki@gmail.com>  Tue, 06 Feb 2018 12:00:06 +0000

ocs-url (3.0.2-0ubuntu1) trusty; urgency=low

  * Add zh_TW translations (by s8321414)

 -- Akira Ohgaki <akiraohgaki@gmail.com>  Fri, 23 Jun 2017 13:20:37 +0000

ocs-url (3.0.1-0ubuntu1) trusty; urgency=low

  * Update qtlib
  * Fix for C++11
  * Fix installation/download destination
  * Fix translation messages (by otsoga)

 -- Akira Ohgaki <akiraohgaki@gmail.com>  Mon, 05 Jun 2017 04:33:07 +0000

ocs-url (3.0.0-0ubuntu1) trusty; urgency=low

  * Rename xdgurl to ocs-url
  * Add ocs:// and ocss:// schemes
  * xdg:// and xdgs:// schemes still available for backward compatibile
  * New app icon
  * New dialog window
  * Labels and messages are translatable
  * Qt 5.2 support
  * Use the same configs of install-types with ocsstore
  * Add en_US translation
  * Add ja_JP translation
  * Add tr_TR translation (by tarakbumba)

 -- Akira Ohgaki <akiraohgaki@gmail.com>  Sun, 05 Mar 2017 16:53:43 +0000

ocs-url (2.0.3-0ubuntu1) trusty; urgency=low

  * Change installation destination of type bin
@@ -31,7 +76,7 @@ ocs-url (2.0.0-0ubuntu1) trusty; urgency=low

ocs-url (1.0.1-0ubuntu1) trusty; urgency=low

  * Clean successfull message
  * Clean successful message
  * Return exit code

 -- Akira Ohgaki <akiraohgaki@gmail.com>  Fri, 15 Jul 2016 18:55:06 +0000
Original line number Diff line number Diff line
@@ -2,11 +2,11 @@ Source: ocs-url
Section: web
Priority: optional
Maintainer: Akira Ohgaki <akiraohgaki@gmail.com>
Build-Depends: build-essential (>= 11), qt5-default (>= 5.2.0), libqt5svg5-dev (>= 5.2.0), qtdeclarative5-dev (>= 5.2.0), devscripts (>= 2.14), debhelper (>= 9), fakeroot (>= 1.20)
Build-Depends: git, build-essential, qt5-default (>= 5.2.0), libqt5svg5-dev (>= 5.2.0), qtdeclarative5-dev (>= 5.2.0), devscripts, debhelper, fakeroot
Standards-Version: 3.9.4

Package: ocs-url
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libqt5svg5 (>= 5.2.0), qml-module-qtquick2 (>= 5.2.0) | qtdeclarative5-qtquick2-plugin (>= 5.2.0), qml-module-qtquick-window2 (>= 5.2.0) | qtdeclarative5-window-plugin (>= 5.2.0), qml-module-qtquick-controls (>= 5.2.0) | qtdeclarative5-controls-plugin (>= 5.2.0)
Description: OCS-URL
 An install helper program for items served on OpenCollaborationServices (OCS).
 An install helper program for items served via OpenCollaborationServices (ocs://).
Original line number Diff line number Diff line
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ocs-url
Upstream-Contact: Akira Ohgaki <akiraohgaki@gmail.com>
Source: https://github.com/ocs-url/ocs-url
Upstream-Contact: Opendesktop.org <contact@opendesktop.org>
Source: https://git.opendesktop.org/akiraohgaki/ocs-url

Files: *
Copyright: 2016-2017, Akira Ohgaki
Copyright: 2016-2019, Opendesktop.org
License: GPL-3+
 On Debian systems, the full text of the GNU General Public License version 3
 can be found in the `/usr/share/common-licenses/GPL-3' file.
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@
	dh $@

override_dh_auto_configure:
	sh scripts/import.sh
	qmake PREFIX="/usr"
	./scripts/prepare
	qmake PREFIX=/usr

override_dh_auto_install:
	make INSTALL_ROOT="$(CURDIR)/debian/tmp" install

scripts/build.sh

deleted100644 → 0
+0 −182
Original line number Diff line number Diff line
#!/bin/bash

################################################################################
# This is utility script to make distribution packages
################################################################################

PKGNAME='ocs-url'

BUILDTYPE=''
if [ "${1}" ]; then
    BUILDTYPE="${1}"
fi

TREEISH='HEAD'
if [ "${2}" ]; then
    TREEISH="${2}"
fi

PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"

BUILDVER="$(cd "${PROJDIR}" && git describe --always)"

BUILDDIR="${PROJDIR}/build_${PKGNAME}_${BUILDVER}_${BUILDTYPE}"

SRCARCHIVE="${BUILDDIR}/${PKGNAME}.tar.gz"

################################################################################
# Utility functions
################################################################################
export_srcarchive() {
    filepath="${1}"
    $(cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${filepath}" "${TREEISH}")
}

transfer_file() {
    filepath="${1}"
    if [ -f "${filepath}" ]; then
        filename="$(basename "${filepath}")"
        curl -T "${filepath}" "https://transfer.sh/${filename}"
    fi
}

################################################################################
# ubuntu
################################################################################
pre_ubuntu() {
    cd "${PROJDIR}"
    mkdir -p "${BUILDDIR}"
    export_srcarchive "${SRCARCHIVE}"
}

build_ubuntu() {
    tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}"
    cp -r "${PROJDIR}/pkg/ubuntu/debian" "${BUILDDIR}/${PKGNAME}"
    cd "${BUILDDIR}/${PKGNAME}"
    debuild -uc -us -b
}

post_ubuntu() {
    transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.deb")"
}

################################################################################
# fedora
################################################################################
pre_fedora() {
    cd "${PROJDIR}"
    mkdir -p "${BUILDDIR}"
    export_srcarchive "${SRCARCHIVE}"
}

build_fedora() {
    mkdir "${BUILDDIR}/SOURCES"
    mkdir "${BUILDDIR}/SPECS"
    mv "${SRCARCHIVE}" "${BUILDDIR}/SOURCES"
    cp "${PROJDIR}/pkg/fedora/${PKGNAME}.spec" "${BUILDDIR}/SPECS"
    rpmbuild --define "_topdir ${BUILDDIR}" -bb "${BUILDDIR}/SPECS/${PKGNAME}.spec"
}

post_fedora() {
    transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.rpm")"
}

################################################################################
# archlinux
################################################################################
pre_archlinux() {
    cd "${PROJDIR}"
    mkdir -p "${BUILDDIR}"
    export_srcarchive "${SRCARCHIVE}"
}

build_archlinux() {
    cp "${PROJDIR}/pkg/archlinux/PKGBUILD" "${BUILDDIR}"
    cd "${BUILDDIR}"
    updpkgsums
    makepkg -s
}

post_archlinux() {
    transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.pkg.tar.xz")"
}

################################################################################
# snap
################################################################################
pre_snap() {
    cd "${PROJDIR}"
    mkdir -p "${BUILDDIR}"
    export_srcarchive "${SRCARCHIVE}"
}

build_snap() {
    tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}"
    cp "${PROJDIR}/pkg/snap/snapcraft.yaml" "${BUILDDIR}/${PKGNAME}"
    cp -r "${PROJDIR}/pkg/snap/setup" "${BUILDDIR}/${PKGNAME}"
    cd "${BUILDDIR}/${PKGNAME}"
    snapcraft
}

post_snap() {
    transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.snap")"
}

################################################################################
# appimage
################################################################################
pre_appimage() {
    cd "${PROJDIR}"
    mkdir -p "${BUILDDIR}"
    export_srcarchive "${SRCARCHIVE}"
}

build_appimage() {
    tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}"
    cd "${BUILDDIR}/${PKGNAME}"
    qmake
    make
    strip "${PKGNAME}"

    cd "${BUILDDIR}"

    # Replace linuxdeployqt download URL to official download URL when the stable version released
    curl -L -o linuxdeployqt https://dl.dropboxusercontent.com/u/150776/temp/linuxdeployqt-799f704-x86-64.appimage
    chmod 755 linuxdeployqt

    mkdir -p "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin"
    install -m 755 -p "${BUILDDIR}/${PKGNAME}/${PKGNAME}" "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}"
    install -m 644 -p "${BUILDDIR}/${PKGNAME}/desktop/${PKGNAME}.desktop" "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}.desktop"
    install -m 644 -p "${BUILDDIR}/${PKGNAME}/desktop/${PKGNAME}.svg" "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}.svg"
    install -m 755 -p /usr/bin/update-desktop-database "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin/update-desktop-database"
    install -m 755 -p /usr/bin/desktop-file-validate "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin/desktop-file-validate"
    install -m 755 -p /usr/bin/desktop-file-install "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin/desktop-file-install"
    ./linuxdeployqt "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}" -qmldir="${BUILDDIR}/${PKGNAME}/app/qml" -verbose=2 -bundle-non-qt-libs # https://github.com/probonopd/linuxdeployqt/issues/25
    ./linuxdeployqt "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}" -qmldir="${BUILDDIR}/${PKGNAME}/app/qml" -verbose=2 -bundle-non-qt-libs # twice because of #25
    rm "${BUILDDIR}/${PKGNAME}.AppDir/AppRun"
    install -m 755 -p "${BUILDDIR}/${PKGNAME}/pkg/appimage/appimage-desktopintegration_${PKGNAME}" "${BUILDDIR}/${PKGNAME}.AppDir/AppRun"
    ./linuxdeployqt --appimage-extract
    ./squashfs-root/usr/bin/appimagetool "${BUILDDIR}/${PKGNAME}.AppDir"
}

post_appimage() {
    transfer_file "$(find ${BUILDDIR} -type f -name "${PKGNAME}*.AppImage")"
}

################################################################################
# Make package
################################################################################
if [ "${BUILDTYPE}" = 'ubuntu' ]; then
    pre_ubuntu && build_ubuntu && post_ubuntu
elif [ "${BUILDTYPE}" = 'fedora' ]; then
    pre_fedora && build_fedora && post_fedora
elif [ "${BUILDTYPE}" = 'archlinux' ]; then
    pre_archlinux && build_archlinux && post_archlinux
elif [ "${BUILDTYPE}" = 'snap' ]; then
    pre_snap && build_snap && post_snap
elif [ "${BUILDTYPE}" = 'appimage' ]; then
    pre_appimage && build_appimage && post_appimage
else
    echo "sh $(basename "${0}") [ubuntu|fedora|archlinux|snap|appimage] [tree_ish]"
    exit 1
fi

scripts/import.sh

deleted100644 → 0
+0 −11
Original line number Diff line number Diff line
#!/bin/bash

################################################################################
# This is utility script to import build dependencies
################################################################################

PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"

if [ ! -d "${PROJDIR}/lib/qtlib" ]; then
    git clone https://github.com/akiraohgaki/qtlib.git -b master --single-branch --depth=1 "${PROJDIR}/lib/qtlib"
fi

scripts/package

0 → 100755
+117 −0
Original line number Diff line number Diff line
#!/bin/bash

PKGNAME='ocs-url'

PKGUSER='pkgbuilder'

PKGSCRIPT="${0}"

PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"

BUILDDIR="${PROJDIR}/build_${PKGNAME}"

ubuntu_deb() { # docker-image: ubuntu:14.04
    install_build_deps_ubuntu_deb
    add_pkguser
    su -c "export HOME=/home/${PKGUSER} && "${PKGSCRIPT}" build_ubuntu_deb" ${PKGUSER}
}

install_build_deps_ubuntu_deb() {
    apt update -qq
    apt -y install curl git
    apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
    apt -y install devscripts debhelper fakeroot
}

build_ubuntu_deb() {
    rm -rf "${BUILDDIR}"
    mkdir -p "${BUILDDIR}"
    export_srcarchive "${BUILDDIR}/${PKGNAME}.tar.gz"
    tar -xzf "${BUILDDIR}/${PKGNAME}.tar.gz" -C "${BUILDDIR}"
    cp -r "${PROJDIR}/pkg/ubuntu/debian" "${BUILDDIR}/${PKGNAME}"
    cd "${BUILDDIR}/${PKGNAME}"
    debuild -uc -us -b
}

fedora_rpm() { # docker-image: fedora:20
    install_build_deps_fedora_rpm
    add_pkguser
    su -c "export HOME=/home/${PKGUSER} && "${PKGSCRIPT}" build_fedora_rpm" ${PKGUSER}
}

install_build_deps_fedora_rpm() {
    yum -y install curl git
    yum -y install make automake gcc gcc-c++ libtool qt5-qtbase-devel qt5-qtsvg-devel qt5-qtdeclarative-devel
    yum -y install rpm-build
}

build_fedora_rpm() {
    rm -rf "${BUILDDIR}"
    mkdir -p "${BUILDDIR}"
    mkdir "${BUILDDIR}/SOURCES"
    mkdir "${BUILDDIR}/SPECS"
    export_srcarchive "${BUILDDIR}/SOURCES/${PKGNAME}.tar.gz"
    cp "${PROJDIR}/pkg/fedora/${PKGNAME}.spec" "${BUILDDIR}/SPECS"
    rpmbuild --define "_topdir ${BUILDDIR}" -bb "${BUILDDIR}/SPECS/${PKGNAME}.spec"
}

opensuse_rpm() { # docker-image: opensuse:42.3
    install_build_deps_opensuse_rpm
    add_pkguser
    su -c "export HOME=/home/${PKGUSER} && "${PKGSCRIPT}" build_opensuse_rpm" ${PKGUSER}
}

install_build_deps_opensuse_rpm() {
    zypper --non-interactive refresh
    zypper --non-interactive install curl git
    zypper --non-interactive install make automake gcc gcc-c++ libtool libqt5-qtbase-devel libqt5-qtsvg-devel libqt5-qtdeclarative-devel
    zypper --non-interactive install rpm-build
}

build_opensuse_rpm() {
    rm -rf "${BUILDDIR}"
    mkdir -p "${BUILDDIR}"
    mkdir "${BUILDDIR}/SOURCES"
    mkdir "${BUILDDIR}/SPECS"
    export_srcarchive "${BUILDDIR}/SOURCES/${PKGNAME}.tar.gz"
    cp "${PROJDIR}/pkg/opensuse/${PKGNAME}.spec" "${BUILDDIR}/SPECS"
    rpmbuild --define "_topdir ${BUILDDIR}" -bb "${BUILDDIR}/SPECS/${PKGNAME}.spec"
}

archlinux_pkg() { # docker-image: archlinux/base:latest
    install_build_deps_archlinux_pkg
    add_pkguser
    su -c "export HOME=/home/${PKGUSER} && "${PKGSCRIPT}" build_archlinux_pkg" ${PKGUSER}
}

install_build_deps_archlinux_pkg() {
    pacman -Syu --noconfirm
    pacman -S --noconfirm curl git
    pacman -S --noconfirm base-devel qt5-base qt5-svg qt5-declarative qt5-quickcontrols
    pacman -S --noconfirm pacman-contrib
}

build_archlinux_pkg() {
    rm -rf "${BUILDDIR}"
    mkdir -p "${BUILDDIR}"
    export_srcarchive "${BUILDDIR}/${PKGNAME}.tar.gz"
    cp "${PROJDIR}/pkg/archlinux/PKGBUILD" "${BUILDDIR}"
    cd "${BUILDDIR}"
    updpkgsums
    makepkg -s
}

add_pkguser() {
    useradd -m ${PKGUSER}
    chown -R ${PKGUSER} "${PROJDIR}"
}

export_srcarchive() {
    if [ "${1}" ]; then
        (cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${1}" HEAD)
    fi
}

if [ "${1}" ]; then
    ${1}
fi

scripts/prepare

0 → 100755
+7 −0
Original line number Diff line number Diff line
#!/bin/bash

PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"

if [ ! -d "${PROJDIR}/lib/qtil" ]; then
    git clone https://github.com/akiraohgaki/qtil.git -b release-0.4.0 --single-branch --depth=1 "${PROJDIR}/lib/qtil"
fi
Original line number Diff line number Diff line
DISTFILES += \
    $${PWD}/build.sh \
    $${PWD}/import.sh
    $${PWD}/package \
    $${PWD}/prepare