Commit fedec2c8 authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin
Browse files

Merge branch 'develop' into 'master'

Updated to version 0.0.3. Added the slides, english and pt_BR localization.

See merge request !1
parents 9fe8676f daf108a3
Pipeline #8753 passed with stages
in 7 minutes and 22 seconds
build/
package/debian/files
package/debian/debhelper-build-stamp
package/debian/le-ubiquity-slideshow
package/debian/le-ubiquity-slideshow.debhelper.log
package/debian/le-ubiquity-slideshow.substvars
package/debian/le-ubiquity-slideshow.*.debhelper
le-ubiquity-slideshow_*.tar.bz2
le-ubiquity-slideshow_*.tar.xz
le-ubiquity-slideshow_*.tar.gz
le-ubiquity-slideshow_*.build
le-ubiquity-slideshow_*.dsc
le-ubiquity-slideshow_*.changes
le-ubiquity-slideshow*.deb
## Template para empacotamento utilizando o Gitlab-ci.
stages:
- build
- test
- deploy
build:
stage: build
artifacts:
paths:
- build/
tags:
- ubuntu
- regular
script:
- if [ ! -d "package/debian/" ] ; then exit 1; fi
# TODO: find a way to get the dependencies automatically
- apt-get update && apt-get install -y build-essential devscripts dh-make dh-python dh-systemd quilt python-setuptools cdbs po4a python-utidylib
- LINE=$(head -n 1 package/debian/changelog)
- PACKAGE=$(echo $LINE | cut -d' ' -f1)
- VERSION=$(echo $LINE | cut -d' ' -f2 | grep -o -E '[0-9]*\.[0-9]*\.[0-9]*')
- tar --exclude=debian -czf ${PACKAGE}_${VERSION}.orig.tar.gz package/*
- cd package ; debuild -us -uc
- cd ../
- mkdir build/
- mv ${PACKAGE}* build/
- echo "Estágio de Build finalizado."
test:
stage: test
tags:
- ubuntu
- debootstrap
script:
# TODO: find a way to get the dependencies automatically
- apt-get update && apt-get install -y gir1.2-webkit-3.0
- dpkg -i build/*.deb
- echo "Estágio de Teste finalizado"
dependencies:
- build
deploy:
stage: deploy
tags:
- ubuntu
- regular
only:
- master
script:
- echo "Estágio de Deploy"
- apt-get update && apt-get install -y dput ssh
- eval $(ssh-agent -s)
- ssh-add <(echo "$PRIV_KEY")
- dput -u -f --config=dput.cf repo build/*.changes
- echo "Estágio de Deploy finalizado"
dependencies:
- build
[repo]
fqdn = repo.c3sl.ufpr.br
method = scp
incoming = /home/repository/www/le6/incoming
allow_unsigned_uploads = 1
ssh_config_options = User=repository
StrictHostKeyChecking=no
post_upload_command = ssh -l repository -i ~/.ssh/id_rsa repo.c3sl.ufpr.br "reprepro -Vb /home/repository/www/le6 processincoming default"
\ No newline at end of file
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-ubiquity-slideshow
#
# le-ubiquity-slideshow is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# Makefile for le-ubiquity-slideshow
SLIDESHOWS = \
ubuntu \
ubuntu-gnome
SOURCE ?= .
SOURCESLIDES ?= $(SOURCE)/slideshows
BUILD ?= $(SOURCE)/build
PO4A_FLAGS = -M UTF-8 -f xhtml -o attributes="data-translate"
find-slides = $(filter-out %/index.html,$(wildcard $1/*.html))
find-slidenames = $(notdir $(call find-slides,$(SOURCESLIDES)/slides))
find-locales = $(basename $(notdir $(wildcard po/*.po)))
.PHONY: all
all: build.slideshows
.PHONY: pot
.PHONY: clean
clean:
-rm -rf $(_ALL_TMP_DIRS) $(BUILD)
.PHONY: test
test: build
./test-slideshow.sh
# Command for rebuilding and launching a new test
.PHONY: mtest
mtest: clean build test
$(BUILD):
mkdir -p $(BUILD)
.PHONY: build.slideshows
define MAKE-SLIDESHOW
# Per-slideshow build
_SOURCE_FILES := $$(shell find -L $(SOURCESLIDES) -type f)
_BUILD_FILES := $$(patsubst $(SOURCESLIDES)/%,$(BUILD)/%,$$(_SOURCE_FILES))
_ALL_TMP_DIRS += $(BUILD)
build.slideshows: build
.PHONY: build
build: build.base build.l10n
.PHONY: build.base
build.base: $$(_BUILD_FILES)
.PHONY: build.l10n
build.l10n: build.base
./build-directory-jsonp.py $(BUILD)/slides/l10n > $(BUILD)/slides/directory.jsonp
# Per-slideshow pot file creation
_ALL_TMP_DIRS += po/.tmp
pot: po/slideshow.pot
po/slideshow.pot: $(addsuffix .pot,$(addprefix po/.tmp/,$(call find-slidenames)))
msgcat -F $$^ > $$@
po/.tmp/%.pot: $(SOURCESLIDES)/slides/% | po/.tmp
po4a-updatepo $(PO4A_FLAGS) -m $$^ -p $$@
po/.tmp:
mkdir -p po/.tmp
# Per-slideshow test scripts
.PHONY: $(SLIDESHOWS)
$(SLIDESHOWS): %: build.%
.PHONY: test
test: build.base
./Slideshow.py --path="$(BUILD)" --controls
$(foreach p,$(call find-locales),$(eval $(call MAKE-SLIDESHOW-LOCALE,$p)))
endef
define MAKE-SLIDESHOW-LOCALE
# Per-locale per-slideshow build
# By creating a different target for each locale, parallel build works as expected.
build.l10n: build.l10n.$1
.PHONY: build.l10n.$1
build.l10n.$1: $(addprefix $(BUILD)/slides/l10n/$1/,$(call find-slidenames))
rmdir --ignore-fail-on-non-empty $(BUILD)/slides/l10n/$1
$(BUILD)/slides/l10n/$1/%: $(SOURCESLIDES)/slides/% po/$1.po | $(BUILD)/slides/l10n/$1
po4a-translate $(PO4A_FLAGS) --keep=1 --master=$$< --po=po/$1.po --localized=$$@
$(BUILD)/slides/l10n/$1:
# translate all slides inside this locale
mkdir -p $$@
# Per-locale per-slideshow test scripts
test.$1: build.base build.l10n.$1
./build-directory-jsonp.py $(BUILD)/slides/l10n > $(BUILD)/slides/directory.jsonp
./Slideshow.py --path="$(BUILD)" --controls --locale=$1
test.$1.rtl: build.base build.l10n.$1
./build-directory-jsonp.py $(BUILD)/slides/l10n > $(BUILD)/slides/directory.jsonp
./Slideshow.py --path="$(BUILD)" --controls --locale=$1 --rtl
endef
# Build command
$(eval $(call MAKE-SLIDESHOW))
$(BUILD)/%: $(SOURCESLIDES)/% | $(BUILD)
mkdir -p $(@D)
cp $^ $@
$(BUILD)/%.js: $(SOURCESLIDES)/%.js | $(BUILD)
mkdir -p $(@D)
cp $^ $@
DESCRIPTION
===========
This package installs an implementation of ubiquity-slideshow for LE6. Ubiquity-slideshow
is an HTML-based slideshow that shows the meaningful features and changes of an Ubuntu
distribution, meant to run on its installation.
When this package is built, it first runs the Makefile on the root directory and builds a set
of slideshow files for every po localization file found in the po/ directory. If the content
of any slide is changed, the pot file needs to be rebuild by running 'make pot' on the package
root directory. The po files for all localizations must also be updated to reference the pot
file text. For more documentation, see the po4a man page. The original package also built a
different deb file for every linux distribution that was supported. This project only builds
one package, based on the ubiquity-slideshow-ubuntu-gnome layout.
Useful commands (from the package root directory):
-make
Builds the slideshow
-make pot
Updates the slideshow.pot localization file
-make test
Tests the slideshow in an example GUI. The slideshow needs to be built first.
-make test.LOCALE
Tests the slideshow with the specified LOCALE (ex. make test.pt_BR)
-make mtest
Cleans the build folder, rebuilds the slideshow and launches a test for it.
This package is based on ubiquity-slideshow, and its source-code can be found on:
https://code.launchpad.net/ubiquity-slideshow-ubuntu
Requirements
===========
#!/usr/bin/python3
import os
from gi.repository import GLib, Gdk, Gtk, WebKit
from configparser import ConfigParser
import subprocess
import sys
import locale
from optparse import OptionParser
class SlideshowViewer(WebKit.WebView):
'''
A basic GTK widget (WebKit.WebView) which displays a slideshow in the
ubiquity-slideshow format. Feel free to copy and paste this to your application
and customize it as needed.
'''
def __init__(self, path, locale='C', rtl=False, controls=False):
'''
@param path Path to the slideshow, in which the slideshow.conf file is stored.
@param locale Ideal locale to use for the slideshow
@param rtl True if the given locale should be displayed right-to-left
'''
self.path = path
config = ConfigParser()
config.read(os.path.join(self.path, 'slideshow.conf'))
slideshow_main = 'file://' + os.path.join(self.path, 'slides', 'index.html')
parameters = []
slideshow_locale = self._find_available_locale(locale)
parameters.append('locale=%s' % slideshow_locale)
if rtl:
parameters.append('rtl')
if controls:
parameters.append('controls')
WebKit.WebView.__init__(self)
parameters_encoded = '&'.join(parameters)
self.open('%s#%s' % (slideshow_main, parameters_encoded))
settings = self.get_settings()
settings.set_property("enable-default-context-menu", False)
#Recent webkit feature. See <http://trac.WebKit.org/changeset/52087>.
settings.set_property("enable-file-access-from-file-uris", True)
config_width = int(config.get('Slideshow', 'width'))
config_height = int(config.get('Slideshow', 'height'))
self.set_size_request(config_width, config_height)
self.connect('navigation-policy-decision-requested', self._on_navigate_decision)
self.connect('navigation-requested', self._on_navigate)
self.connect('new-window-policy-decision-requested', self._on_new_window_decision)
self.connect('create-web-view', self._on_new_window)
'''
Determines the ideal locale for the slideshow, based on the given locale,
or 'c' if an ideal one is not available.
@param locale The full locale string, for example en_AU.UTF8
@return The available locale which best matches the input.
'''
def _find_available_locale(self, locale):
base_slides_dir = os.path.join(self.path, 'slides', 'l10n')
extra_slides_dir = os.path.join(self.path, 'slides', 'extra')
ll_cc = locale.split('.')[0]
ll = ll_cc.split('_')[0]
for slides_dir in [extra_slides_dir, base_slides_dir]:
for test_locale in [locale, ll_cc, ll]:
locale_dir = os.path.join(slides_dir, test_locale)
if os.path.exists(locale_dir):
return test_locale
return 'C'
def _new_browser_window(self, uri):
subprocess.Popen(['xdg-open', uri], close_fds=True)
def _on_navigate_decision(self, view, frame, req, action, decision):
reason = action.get_reason()
if reason == "link-clicked":
decision.use()
return False
decision.ignore()
return True
def _on_navigate(self, view, frame, req):
uri = req.get_uri()
self._new_browser_window(uri)
return True
def _on_new_window_decision(self, view, frame, req, action, decision):
uri = req.get_uri()
decision.ignore()
self._new_browser_window(uri)
return True
def _on_new_window(self, view, frame):
return True
def progress_increment(progressbar, fraction):
new_fraction = progressbar.get_fraction() + fraction
if new_fraction > 1:
progressbar.set_fraction(1.0)
return False
progressbar.set_fraction(new_fraction)
return True
#Main program
default_path = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])) , 'build', 'ubuntu')
default_locale = locale.getlocale()[0]
parser = OptionParser()
parser.add_option("-l", "--locale", help="LOCALE to use for the slideshow", metavar="LOCALE", default=default_locale)
parser.add_option("-r", "--rtl", action="store_true", help="use output in right-to-left format")
parser.add_option("-c", "--controls", action="store_true", help="Enable controls in the slideshow (you may need to resize the window)")
parser.add_option("-p", "--path", help="path to the SLIDESHOW which will be presented", metavar="SLIDESHOW", default=default_path)
(options, args) = parser.parse_args()
options.path = os.path.abspath(options.path)
if not os.path.exists(options.path):
sys.exit("\033[91m * Please build the slideshow content first by using the make command * \033[0m")
Gdk.threads_init()
# Set default SSL CA file for secure communication with web services.
# This is important, because libsoup is not secure by default.
soup_session = WebKit.get_default_session()
soup_session.set_property('ssl-strict', True)
soup_session.set_property('ssl-use-system-ca-file', True)
slideshow_window = Gtk.Window()
slideshow_window.set_title("Installer slideshow preview")
slideshow_window.connect('destroy', Gtk.main_quit)
slideshow_window.set_resizable(False)
slideshow_container = Gtk.VBox()
slideshow_window.add(slideshow_container)
slideshow = SlideshowViewer(options.path, locale=options.locale, rtl=options.rtl, controls=options.controls)
install_progressbar = Gtk.ProgressBar()
install_progressbar.set_margin_top(8)
install_progressbar.set_margin_right(8)
install_progressbar.set_margin_bottom(8)
install_progressbar.set_margin_left(8)
install_progressbar.set_fraction(0)
slideshow_container.add(slideshow)
slideshow_container.add(install_progressbar)
slideshow_container.set_child_packing(install_progressbar, True, False, 0, 0)
slideshow_window.show_all()
install_timer = GLib.timeout_add_seconds(2, progress_increment, install_progressbar, 0.01)
Gtk.main()
#!/usr/bin/python
import os
import sys
import subprocess
import json
if len(sys.argv) == 2:
l10n_path = sys.argv[1]
else:
sys.exit("Usage: %s <l10n_path>" % sys.argv[0])
if not subprocess.call(["which", "po4a-translate"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0:
sys.exit("Error: po4a is not available.")
def get_subdirs(root):
for fname in os.listdir(root):
fpath = os.path.join(root, fname)
if os.path.isdir(fpath):
yield fname, fpath
directory = {}
for locale_name, locale_path in get_subdirs(l10n_path):
directory[locale_name] = {
'slides' : [slide for slide in os.listdir(locale_path)],
'media' : []
}
directory[locale_name]['slides'].sort()
content = json.dumps(directory)
sys.stdout.write('ubiquitySlideshowDirectoryCb(')
sys.stdout.write(content)
sys.stdout.write(');\n')
le-ubiquity-slideshow (0.0.3) testing; urgency=low
* Updated the slideshow design and content, added pt_BR localization.
-- Levi <lhgs15@inf.ufpr.br> Wed, 15 Feb 2017 10:45:37 -0200
le-ubiquity-slideshow (0.0.2) testing; urgency=low
* Replaced the ubuntu-defaults patching method for an independent package based on ubuntu-slideshow.
-- Levi <lhgs15@inf.ufpr.br> Mon, 30 Jan 2017 10:56:06 -0200
le-ubiquity-slideshow (0.0.1) testing; urgency=low
* Initial release.
-- Levi <lhgs15@inf.ufpr.br> Mon, 30 Jan 2017 10:56:06 -0200
Source: le-ubiquity-slideshow
Section: metapackages
Priority: optional
Maintainer: C3SL <contato@c3sl.ufpr.br>
Build-Depends: cdbs, debhelper (>= 5)
Build-Depends-Indep: po4a, python-utidylib, python
Standards-Version: 3.9.7
Package: le-ubiquity-slideshow
Architecture: all
Provides: ubiquity-slideshow
Conflicts: ubiquity-slideshow
Replaces: ubiquity-slideshow
Depends: ${misc:Depends}, gir1.2-webkit-3.0
Description: Ubiquity slideshow for Ubuntu
A slideshow intended for the Ubiquity installer, designed as a quick
introduction to Linux Educacional 6.
This diff is collapsed.
build/* /usr/share/ubiquity-slideshow
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
\ No newline at end of file
compression = "bzip2"
# Brazilian Portuguese translation for le-ubiquity-slideshow
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
# This file is distributed under the same license as the ubiquity-slideshow-ubuntu package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: le-ubiquity-slideshow\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2016-03-24 23:23+0200\n"
"PO-Revision-Date: 2013-09-23 23:29+0000\n"
"Last-Translator: Levi Gomes<lhgs15@inf.ufpr.br>\n"
"Language-Team: Brazilian Portuguese\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2016-04-12 16:41+0000\n"
"X-Generator: Launchpad (build 17990)\n"
#. type: Content of: <div><h1>
#: slideshows/slides/autoupgrade.html:2
msgid "Automatic upgrade of your software"
msgstr "Atualização automática dos seus programas"
#. type: Content of: <div><div><div><p>
#: slideshows/slides/autoupgrade.html:8
msgid ""
"The software on your system is <strong>upgraded automatically every day</"
"strong>, making sure your applications are always up to date with no need "
"for manual intervention."
msgstr ""
"Os programas do seu sistema são <strong>atualizados automaticamente todo dia, </strong>"
"garantindo que suas aplicações estejam sempre atualizadas sem necessidade de intervenção "
"manual."
#. type: Content of: <div><h1>
#: slideshows/slides/edubar.html:2
msgid "Find educational content"
msgstr "Encontre conteúdo educacional"
#. type: Content of: <div><div><div><p>
#: slideshows/slides/edubar.html:8
msgid ""
"The new version of <strong>EduBar</strong> is integrated with <strong>Portal "
"MEC</strong>, giving you access to a wide range of educational content. The "
"new interface allows you to browse, download and open documents, images and "
"videos with ease."
msgstr ""
"A nova versão da <strong>EduBar</strong> é integrada com o <strong>Portal "
" MEC</strong>, dando acesso a uma grande quantidade de conteúdos educacionais. "
"A nova interface permite pesquisar, baixar e abrir documentos, imagens e vídeos com "
"facilidade."
#. type: Content of: <div><h1>
#: slideshows/slides/interface.html:2
msgid "Updated interface"
msgstr "Nova interface"
#. type: Content of: <div><div><div><p>
#: slideshows/slides/interface.html:8
msgid ""
"<strong>Linux Educacional's interface was redesigned to offer a new, more "
"minimalistic direction. </strong>"
msgstr "<strong>A interface do Linux Educacional foi reformulada para seguir uma direção "
"nova e mais minimalista.</strong>"
#. type: Content of: <div><div><div><p>
#: slideshows/slides/interface.html:9
msgid ""
"The new interface is cleaner and focused on the features you use the most."
msgstr ""
"A nova interface é mais limpa e dá destaque às funções mais utilizadas pelos usuários."
#. type: Content of: <div><div><div><ul><li><p>
#: slideshows/slides/interface.html:16
msgid "Launch and manage <strong>your apps</strong> from the Plank docker menu"
msgstr "<strong>Abra e organize suas aplicações</strong> pelo novo menu Plank."
#. type: Content of: <div><div><div><ul><li><p>
#: slideshows/slides/interface.html:20
msgid ""
"Find <strong>the apps you want to use</strong> easily through the improved "
"overview menu"
msgstr ""