diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d7c1d8e --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +VERSION ?= 0.0.0 +BINARY ?= slide +ARCH ?= noarch + +.PHONY: all +all: build + +.PHONY: install-deps-deb +install-deps-deb: + apt install qt5-qmake libexif12 qt5-default libexif-dev qt5-image-formats-plugins + +check-deps-deb: + dpkg -l | grep qt5-qmake + dpkg -l | grep libexif12 + dpkg -l | grep libexif-dev + dpkg -l | grep qt5-default + dpkg -l | grep qt5-image-formats-plugins + +.PHONY: clean +clean: + rm -rf build + +build: + mkdir -p build + qmake src/slide.pro -o build/Makefile + make -C build + +PACKAGE_DIR=build/slide_$(VERSION) + +.PHONY: package +package: clean build + mkdir -p $(PACKAGE_DIR) + cp -r "./build/$(BINARY)" $(PACKAGE_DIR) + cp "INSTALL.md" $(PACKAGE_DIR) + cp "LICENSE" $(PACKAGE_DIR) + cd build && tar cfz slide_$(ARCH)_$(VERSION).tar.gz slide_$(VERSION) diff --git a/README.md b/README.md index 93faf69..f2880ea 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Simple, lightweight slideshow selecting random images from specified directory. Tested versions: * Raspberry Pi 3 running Raspbian Stretch. * Raspberry Pi 3 running Raspbian Buster. + * Raspberry Pi Zero running Raspbian Buster. Screen background is filled with a scaled version of the image to prevent pure black background. @@ -44,27 +45,34 @@ slide [-t rotation_seconds] [-o background_opacity(0..255)] [-b blur_radius] -p ## Dependencies -* libexif +* qt5-qmake * qt5 -* qt5-image-formats-plugins for tiff +* qt5-image-formats-plugins +* libexif + +Ubuntu/Raspbian: + ``` -sudo apt install libexif12 qt5-default -sudo apt install qt5-image-formats-plugins +sudo make install-deps-deb ``` ## Build -dev libs needed to build slide on from source: +Install dependencies ``` -sudo apt install libexif-dev +make install-deps-deb ``` +Build project + ``` -mkdir -p make -cd make -qmake ../src/slide.pro make +``` + +Install binaries + +``` sudo make install ``` @@ -75,9 +83,7 @@ Prerequisite: brew ``` brew install qt5 brew install libexif -mkdir -p build -cd build -qmake ../src/slide.pro +brew install libexif make ``` @@ -88,7 +94,7 @@ This article has more helpful ways that you could use this repo as a picture fra https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi ``` -## Removing black border +## Removing black border (Raspberry Pi) ``` if you find that you have a black border around your screen you can remove it by disabling overscan. This is done by editing /boot/config.txt and uncommenting disable_overscan=1 diff --git a/sbin/package.sh b/sbin/package.sh index f5b1075..d77ed7c 100755 --- a/sbin/package.sh +++ b/sbin/package.sh @@ -2,8 +2,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -ARCH=$1 -VERSION=$2 +export ARCH=$1 +export VERSION=$2 set -euo pipefail @@ -22,11 +22,8 @@ if [[ "$ARCH" == "osx" ]]; then fi cd "$DIR/.." -mkdir -p make/slide_$VERSION -cd make -qmake ../src/slide.pro -make -cp -r "$BINARY" "slide_$VERSION/" -cp "../INSTALL.md" "slide_$VERSION/" -cp "../LICENSE" "slide_$VERSION/" -tar cfz slide_${ARCH}_$VERSION.tar.gz "slide_$VERSION" +if ! make check-deps-deb; then + sudo make install-deps-deb +fi + +make package diff --git a/sbin/package_all.sh b/sbin/package_all.sh new file mode 100755 index 0000000..2bb30ad --- /dev/null +++ b/sbin/package_all.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -euxo pipefail +VERSION=$1 +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +make clean +$DIR/package_remote.sh pi picframe pi $VERSION +$DIR/package_remote.sh pi raspberrypi pi-0 $VERSION +$DIR/package.sh amd64 $VERSION +mv build/slide_amd64_$VERSION.tar.gz . diff --git a/sbin/package_remote.sh b/sbin/package_remote.sh index 35856ab..4eb8d17 100755 --- a/sbin/package_remote.sh +++ b/sbin/package_remote.sh @@ -9,7 +9,7 @@ VERSION=$4 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -cd $DIR/.. -rsync -av --delete $(pwd)/* $USER@$HOSTNAME:/tmp/slide_build -ssh $USER@$HOSTNAME "rm -rf /tmp/slide_build/build;/tmp/slide_build/sbin/package.sh $ARCH $VERSION" -scp $USER@$HOSTNAME:/tmp/slide_build/make/slide_*.tar.gz . +cd "$DIR/.." +rsync -av --delete "$(pwd)"/* "$USER@$HOSTNAME:/tmp/slide_build" +ssh "$USER@$HOSTNAME" "rm -rf /tmp/slide_build/build;/tmp/slide_build/sbin/package.sh $ARCH $VERSION" +scp "$USER@$HOSTNAME:/tmp/slide_build/build/slide_*.tar.gz" .