Commit 0d761be6 authored by Daniel Bissani Furlin's avatar Daniel Bissani Furlin
Browse files

SCRUM#365: Remove warnings about missing source files

parent efb980fc
Pipeline #14558 passed with stages
in 8 minutes and 2 seconds
#!/bin/bash #!/bin/bash
# This script generates a .deb package # This script generates a .deb package
BUILD_DEPS=$(grep 'Build-Depends' package/debian/control | cut -d' ' -f2- | tr ', ' ' ' | sed -E "s/ \((>|<|=)+[0-9]\)//g")
apt-get update && apt-get install -y devscripts apt-get update && apt-get install -y devscripts ${BUILD_DEPS}
CHANGELOG="package/debian/changelog" CHANGELOG="package/debian/changelog"
LINE=$(head -n 1 $CHANGELOG) LINE=$(head -n 1 $CHANGELOG)
......
...@@ -23,10 +23,8 @@ test: ...@@ -23,10 +23,8 @@ test:
- regular - regular
script: script:
# TODO: find a way to get the dependencies automatically # TODO: find a way to get the dependencies automatically
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y udev
- locale-gen pt_BR.UTF-8 - DEBIAN_FRONTEND=noninteractive apt-get -y -q install $(pwd)/build/*.deb
- export LANG=pt_BR.UTF-8
- DEBIAN_FRONTEND=noninteractive apt-get -y install $(pwd)/build/*.deb
dependencies: dependencies:
- build - build
......
le-multiterminal (0.0.7ubuntu1) testing; urgency=medium
* Remove warnings and fix dependencies.
-- Daniel Bissani Furlin <dbf15@inf.ufpr.br> Fri, 23 Feb 2018 17:34:10 -0300
le-multiterminal (0.0.7) testing; urgency=medium le-multiterminal (0.0.7) testing; urgency=medium
* Adds copyright and credits to all files * Adds copyright and credits to all files
......
...@@ -3,11 +3,18 @@ Section: misc ...@@ -3,11 +3,18 @@ Section: misc
Priority: optional Priority: optional
Maintainer: C3SL <contato@c3sl.ufpr.br> Maintainer: C3SL <contato@c3sl.ufpr.br>
Uploaders: Stephanie Briere Americo <sba16@c3sl.ufpr.br> Uploaders: Stephanie Briere Americo <sba16@c3sl.ufpr.br>
Build-Depends: debhelper (>=9) Build-Depends: debhelper (>=9), libx11-dev, libcairo2-dev
Standards-Version: 3.9.7 Standards-Version: 3.9.7
Vcs-Git: https://gitlab.c3sl.ufpr.br/le6/le-multiterminal.git Vcs-Git: https://gitlab.c3sl.ufpr.br/le6/le-multiterminal.git
Package: le-multiterminal Package: le-multiterminal
Architecture: amd64 Architecture: amd64
Depends: ${misc:Depends}, ${shlibs:Depends}, curl, xserver-xorg-video-siliconmotion-hwe-16.04, compton,numlockx, xserver-xephyr-hwe-16.04, lightdm, udev, systemd, policykit-1-gnome, libcairo2 Pre-Depends: lightdm
Description: Configura multiterminal para funcionar com o LE Depends: ${misc:Depends}, ${shlibs:Depends}, curl, xserver-xorg-video-siliconmotion-hwe-16.04, compton, numlockx, xserver-xephyr-hwe-16.04, systemd, policykit-1-gnome, libcairo2, pciutils
Description: Multiterminal Solution compatible with the system Linux Educational 6
Multi-terminal solution compatible with Linux Educational system 6.
The multi-terminal system configures up to three monitors simultaneously on
the same machine.
The solution relies heavily on the TN-502 video card and the Thinnetworks
Hubs, available on the 83/2008 and 71/2010 sessions of the Brazilian federal
government.
...@@ -2,9 +2,9 @@ etc/X11/xorg.conf.d/97-proinfo-monitores.conf etc/X11/xorg.conf.d/ ...@@ -2,9 +2,9 @@ etc/X11/xorg.conf.d/97-proinfo-monitores.conf etc/X11/xorg.conf.d/
etc/X11/xorg.conf.d/98-proinfo-urbano.conf etc/X11/xorg.conf.d/ etc/X11/xorg.conf.d/98-proinfo-urbano.conf etc/X11/xorg.conf.d/
etc/le-multiterminal/readme etc/le-multiterminal/ etc/le-multiterminal/readme etc/le-multiterminal/
etc/polkit-1/localauthority/50-local.d/90-restrict-guest-permissions.pkla etc/polkit-1/localauthority/50-local.d/ etc/polkit-1/localauthority/50-local.d/90-restrict-guest-permissions.pkla etc/polkit-1/localauthority/50-local.d/
etc/systemd/system/le-multiterminal.service etc/systemd/system/ lib/systemd/system/le-multiterminal.service lib/systemd/system/
etc/systemd/system/xorg-daemon.service etc/systemd/system/ lib/systemd/system/xorg-daemon.service lib/systemd/system/
etc/systemd/system/xorg-daemon.socket etc/systemd/system/ lib/systemd/system/xorg-daemon.socket lib/systemd/system/
etc/xdg/lightdm/lightdm.conf.d/97-no-screen-blanking.conf etc/xdg/lightdm/lightdm.conf.d/ etc/xdg/lightdm/lightdm.conf.d/97-no-screen-blanking.conf etc/xdg/lightdm/lightdm.conf.d/
lib/udev/rules.d/71-seat-usb.rules lib/udev/rules.d/ lib/udev/rules.d/71-seat-usb.rules lib/udev/rules.d/
lib/udev/rules.d/73-seat-attach-assistant.rules lib/udev/rules.d/ lib/udev/rules.d/73-seat-attach-assistant.rules lib/udev/rules.d/
......
binary-without-manpage
systemd-service-file-missing-documentation-key
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
# postinst script for le-multiterminal # postinst script for le-multiterminal
#DEBHELPER# #DEBHELPER#
set -e set -e
update-xorg-conf "Silicon.Motion" /etc/X11/xorg.conf.d/98-proinfo-*.conf update-xorg-conf "Silicon.Motion" /etc/X11/xorg.conf.d/98-proinfo-*.conf
systemctl daemon-reload if [ ! -f /.dockerenv ]; then
deb-systemctl-helper enable le-multiterminal systemctl daemon-reload
deb-systemd-helper enable le-multiterminal.service
# habilita e roda o xorg-daemon # habilita e roda o xorg-daemon
deb-systemctl-helper enable xorg-daemon.socket deb-systemd-helper enable xorg-daemon.socket
deb-systemctl-invoke start xorg-daemon.socket deb-systemd-invoke start xorg-daemon.socket
udevadm trigger udevadm trigger
fi
echo "Por favor reinicie o sistema para o multiterminal ser reconfigurado!" echo "Por favor reinicie o sistema para o multiterminal ser reconfigurado!"
exit 0 exit 0
#!/usr/bin/make -f #!/usr/bin/make -f
%: %:
dh $@ dh $@
override_dh_usrlocal: #override_dh_usrlocal:
build: build-arch build-indep
$(MAKE) -C src/
dh_testdir
dh_auto_configure
dh_auto_build
dh_auto_test
clean:
$(MAKE) -C src/ clean
dh_testdir
dh_auto_clean
dh_clean
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CC = gcc
CFLAGSS = -O2 -Wall -fPIC -pie $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
SRC=.
DST = ../usr/sbin
all:
$(CC) $(CFLAGSS) $(SRC)/read-devices.c -o $(DST)/read-devices
$(CC) $(CFLAGSS) $(SRC)/write-message.c -o $(DST)/write-message `pkg-config --libs --cflags cairo x11`
$(CC) $(CFLAGSS) $(SRC)/seat-parent-window.c -o $(DST)/seat-parent-window `pkg-config --libs --cflags x11`
clean:
rm -f $(DST)/read-devices
rm -f $(DST)/write-message
rm -f $(DST)/seat-parent-window
/*
* Copyright (C) 2004-2007 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This program 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.
*
*
* This program monitors evdev device nodes passed as parameters to detect the
* F1...F12, ENTER or ESC keys pressed or the left mouse button.
*
* The first argument is the key that we need to check.
* - If between f1 and f12, the argument must be between 1 and 12
* - If it's the left mouse button, the argument is 13
* - If it's enter or esc, the argument is 14
* The other arguments are the device node file paths
*
* The timeout is 20 seconds.
* If "enter" or "esc" is requested, the timeout is 5 seconds.
*
* The output is:
* - "detect=|device/node/path" for f1..f12 and mouse button
* - "detect=|enter" or "detect=|esc" for enter and esc keys (no device path)
*/
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <linux/input.h>
/* No, linux/input.h doesn't have these... */
#define EV_PRESS 1
#define EV_RELEASE 0
void read_node(unsigned char* buffer, int sock, int how_many);
int main(int argc, char* argv[]) {
fd_set rfds;
struct input_event ev;
int retval, i;
int biggest_so_far = 0;
int fd_array[30];
int expected_key;
struct timeval tv;
#ifdef DEBUG
for (i = 0; i < argc; i++)
fprintf(stderr, "argv[%d] = %s\n", i, argv[i]);
#endif
/* Basic checking */
if (argc > 31) {
fprintf(stderr, "read_devices: maximum is 30 arguments\n");
fprintf(stderr, "usage: %s key files...\n",argv[0]);
exit(1);
}
if (argc <= 2) {
fprintf(stderr, "read_devices: few arguments\n");
fprintf(stderr, "usage: %s key files...\n",argv[0]);
exit(1);
}
expected_key = atoi(argv[1]);
/* Timeout is different for ESC/ENTER */
if (expected_key != 14)
tv.tv_sec = 20;
else
tv.tv_sec = 5;
tv.tv_usec = 0;
/* Open the file and store at biggest_so_far the biggest FD between the
* files */
for (i = 2; i < argc; i++) {
fd_array[i] = open(argv[i], O_RDONLY);
if (fd_array[i] == -1) {
perror("select (ERROR)");
exit(1);
}
if (fd_array[i] > biggest_so_far )
biggest_so_far = fd_array[i];
}
while(1) {
/* Zero the FD set */
FD_ZERO(&rfds);
/* Insert each FD in the set */
for (i = 2; i < argc; i++)
FD_SET(fd_array[i], &rfds);
retval = select(biggest_so_far+1, &rfds, 0, 0, &tv); /* no timeout */
/* Verify which FDs are still in the set: which ones have data to be
* read */
if (retval == -1) {
perror("select (ERROR)");
exit(1);
}
else if (retval) {
for (i = 2; i < argc; i++) {
if (FD_ISSET(fd_array[i],&rfds)) {
/* Read from FD */
read_node ((unsigned char*)&ev, fd_array[i],
sizeof(struct input_event));
/* f1..f10 */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
((ev.code - (KEY_F1) +1) == expected_key)) {
printf("detect=|%s\n", argv[i]);
exit(1);
}
/* f11 or f12 */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
((ev.code == KEY_F11 && expected_key == 11) ||
(ev.code == KEY_F12 && expected_key == 12)) ) {
printf("detect=|%s\n", argv[i]);
exit(1);
}
/* left button */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
ev.code == BTN_LEFT && expected_key == 13) {
printf("detect=|%s\n", argv[i]);
exit(1);
}
/* enter */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
(ev.code == KEY_ENTER || ev.code == KEY_KPENTER) &&
expected_key == 14) {
printf("detect=|enter\n");
exit(1);
}
/* esc */
if (ev.type == EV_KEY && ev.value == EV_PRESS &&
ev.code == KEY_ESC && expected_key == 14) {
printf("detect=|esc\n");
exit(1);
}
}
}
}
else {
printf("detect=|timeout\n");
exit(1);
}
}
return 0;
}
void read_node(unsigned char* buffer, int sock, int how_many)
{
/* Keep calling recv until everything is received */
int pointer = 0;
int maximum = how_many;
int bytes_read;
while (pointer < how_many) {
bytes_read = read(sock,(void*)(buffer+pointer), maximum);
if (bytes_read == -1) {
perror("Error reading the socket.");
exit(1);
}
else if (bytes_read == 0) {
fprintf(stderr, "End of file.\n");
exit(1);
}
pointer += bytes_read; /* Forward pointer */
maximum -= bytes_read;
}
}
/*
* Copyright (C) 2004-2007 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This program 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.
*/
/* This program creates a "parent window" for xephyr
* and waits forever.
* parameters: widthxheight+x+y, window name.
*/
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
# include <X11/Xlib.h>
# include <X11/Xutil.h>
int main(int argc, char *argv[])
{
int screen;
int x, y;
int rc;
unsigned int width, height;
Display *display = XOpenDisplay(NULL);
if (display == NULL)
{
fprintf(stderr, "Cannot open display.\n");
exit(1);
}
screen = DefaultScreen(display);
sscanf(argv[1], "%dx%d+%d+%d", &width, &height, &x, &y);
Window win = XCreateSimpleWindow (display, DefaultRootWindow(display),
x, y, width, height, 0,
WhitePixel(display, screen),
BlackPixel(display, screen));
XTextProperty window_name_property;
rc = XStringListToTextProperty(&argv[2], 1, &window_name_property);
if (rc == 0)
{
fprintf(stderr, "XStringListToTextProperty - out of memory\n");
exit(1);
}
XSetWMName(display, win, &window_name_property);
XMapWindow(display, win);
XFlush(display);
pause();
XCloseDisplay(display);
return 0;
}
/*
* Copyright (C) 2004-2007 Centro de Computacao Cientifica e Software Livre
* Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
*
* This program 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.
*/
#include <stdlib.h>
#include <stdio.h>
#include <X11/Xlib.h>
#include <cairo.h>
#include <cairo-xlib.h>
int main(int argc, char *argv[])
{
int i;
int screen;
int win_x, win_y;
unsigned int width, height;
unsigned int depth;
unsigned int border_width;
unsigned int win_id;
double y_all_extents = 0.0;
double x, y;
Display *display;
Visual *visual;
Window RootWindow;
Window win;
cairo_text_extents_t extents;
cairo_surface_t *surface;
cairo_t *cr;
display = XOpenDisplay(NULL);
if(display == NULL)
{
fprintf(stderr, "Cannot open display.\n");
exit(1);
}
screen = DefaultScreen(display);
sscanf(argv[1], "%x", &win_id);
win = win_id;
XGetGeometry(display, win, &RootWindow, &win_x, &win_y,
&width, &height, &border_width, &depth );
visual = DefaultVisual(display, screen);
surface = cairo_xlib_surface_create (display,
win,
visual,
width,
height );
cr = cairo_create (surface);
cairo_select_font_face (cr, "Arial",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 32.0);
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
for (i = 2; i < argc ; i++)
{
cairo_text_extents(cr, argv[i], &extents);
y_all_extents += (extents.height/2 + extents.y_bearing*2);
}
y_all_extents = y_all_extents/2.0;
cairo_text_extents(cr, argv[1], &extents);
x = width/2 - (extents.width/2 + extents.x_bearing);
y = height/2 - (extents.height/2 + extents.y_bearing);
y += y_all_extents;
cairo_move_to(cr, x, y );
XClearWindow(display, win);
for (i = 2; i < argc ; i++)
{
cairo_text_extents(cr, argv[i], &extents);
x = width/2 - (extents.width/2 + extents.x_bearing);
cairo_move_to (cr, x, y );
cairo_show_text (cr, argv[i]);
y -= (extents.height/2 + extents.y_bearing*2 );
}
XCloseDisplay(display);
return 0;
}
...@@ -24,13 +24,13 @@ ...@@ -24,13 +24,13 @@
#### Written by: Stephanie Briere Americo - sba16@c3sl.ufpr.br on 2017. #### Written by: Stephanie Briere Americo - sba16@c3sl.ufpr.br on 2017.
## Macros ## Macros
DEVICES="/sbin/devices" # shortcut to devices that have already been paired DEVICES="/etc/le-multiterminal/devices" # shortcut to devices that have already been paired
#TODO: This path is correctly?? #TODO: This path is correctly??
CONF="/opt/le-multiterminal/98-xephyr-multi-seat.conf" # lightdm settings file (associates seat to output) CONF="/etc/le-multiterminal/98-xephyr-multi-seat.conf" # lightdm settings file (associates seat to output)
## Script/function in other file ## Script/function in other file
READ_DEVICES="read-devices" READ_DEVICES="/usr/sbin/read-devices"
DETECT_KEYBOARDS="/sbin/detect-keyboard" DETECT_KEYBOARDS="/usr/sbin/detect-keyboard"
WRITE_W="write_window" # "window-acess" WRITE_W="write_window" # "window-acess"
## Variables ## Variables
......
...@@ -27,13 +27,13 @@ ...@@ -27,13 +27,13 @@
set -x set -x
## Auxiliary scripts ## Auxiliary scripts
source /usr/sbin/find-devices source /usr/lib/find-devices
source /usr/sbin/window-acess source /usr/lib/window-acess
## Path constants ## Path constants
MC3SL_DEVICES="/usr/sbin/devices" # shortcut to devices that have already been paired MC3SL_DEVICES="/usr/sbin/devices" # shortcut to devices that have already been paired
#TODO: This path is correctly?? #TODO: This path is correctly??
MC3SL_CONF="/opt/le-multiterminal/98-xephyr-multi-seat.conf" # lightdm settings file (associates seat to output) MC3SL_CONF="/etc/le-multiterminal/98-xephyr-multi-seat.conf" # lightdm settings file (associates seat to output)
LIGHTDM_CONF="/etc/xdg/lightdm/lightdm.conf.d/98-xephyr-multi-seat.conf" LIGHTDM_CONF="/etc/xdg/lightdm/lightdm.conf.d/98-xephyr-multi-seat.conf"
## Script/function in other file ## Script/function in other file
......