initial commit

This commit is contained in:
Albert S. 2022-06-22 23:25:33 +02:00
commit 09d1c1e339
10 changed files with 122 additions and 0 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# looqs-bundle
The aim of this project is to create a tarball for [looqs](https://github.com/quitesimpleorg/looqs) that runs on any (recent)
Linux distribution.
It uses [Gentoo Hardened](https://wiki.gentoo.org/wiki/Hardened_Gentoo) and creates a Qt library with less features than what is
usually found in distributions.

14
build Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
set -e
[ -d cache ] || mkdir cache
SPAWN="systemd-nspawn -M gentoolooqsbuilder -D gentoo --bind=$(realpath ./out):/out --bind=$(realpath scripts):/scripts --bind=$(realpath cache):/var/cache/distfiles"
SETUPSCRIPT="/scripts/3-setup-gentoo.sh"
BUILDSCRIPT="/scripts/4-build-looqs.sh"
./scripts/1-create.sh
sudo ./scripts/2-create.sh
sudo ${SPAWN} /${SETUPSCRIPT}
sudo ${SPAWN} su - builder -c /${BUILDSCRIPT}
./scripts/5-bundle.sh

10
scripts/1-create.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -e
# TODO: always download latest
wget https://bouncer.gentoo.org/fetch/root/all/releases/amd64/autobuilds/current-stage3-amd64-hardened-openrc/stage3-amd64-hardened-openrc-20220619T170540Z.tar.xz -O hardened.tar.xz
wget https://bouncer.gentoo.org/fetch/root/all/releases/amd64/autobuilds/current-stage3-amd64-hardened-openrc/stage3-amd64-hardened-openrc-20220619T170540Z.tar.xz.asc -O hardened.tar.xz.asc
gpg --verify hardened.tar.xz.asc hardened.tar.xz

9
scripts/2-create.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
rm -rf gentoo out
mkdir gentoo
mkdir out
mkdir out/lib
mkdir out/bin
chmod -R 755 out
tar xfp hardened.tar.xz -C gentoo

16
scripts/3-setup-gentoo.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Run me inside gentoo
set -e
mkdir --parents /etc/portage/repos.conf
cp /usr/share/portage/config/repos.conf /etc/portage/repos.conf/gentoo.conf
emerge-webrsync
export USE="X jpeg png icu -accessibility -debug -dbus cairo"
emerge -v qtcore qtgui uchardet
emerge -v qtwidgets qtsql qtnetwork qtconcurrent
export USE="X jpeg png icu -accessibility -debug -dbus qt5 cairo minizip"
emerge -v app-text/poppler
emerge -v dev-libs/quazip
emerge -v dev-vcs/git
emerge -v qtchooser
useradd -m -s /bin/bash builder

37
scripts/4-build-looqs.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
set -e
. /scripts/CONFIG
wget https://quitesimple.org/share/pubkey
sha256sum pubkey | grep fe5ce4868d6998aabe08ab51dc2d8fded73cf126d03e2df37045b6c486904356
gpg --import pubkey
rm -rf looqs
git clone https://github.com/quitesimpleorg/looqs
cd looqs
git submodule init
git submodule update
git fetch
if [ "$TAG" != "master" -a "$TAG" != "dev" ] ; then
git verify-tag "$TAG"
fi
git checkout "$TAG"
qmake
make
cp cli/looqs /out/bin/
cp gui/looqs-gui /out/bin/
for lib in $( find /usr/lib64/ -mindepth 1 | grep libQt | grep .so ) ; do
cp -a "$lib" /out/lib/
done
cp -a /usr/lib64/libcrypto* /out/lib/
cp -a /usr/lib64/qt5/plugins /out/lib/
for lib in $( ldd gui/looqs-gui | awk '{print $3}' | grep so | grep -vE "libGL|libm|libc|fontconfig|libgcc|freetype|libX11|libQt" ) ; do
cp "$lib" /out/lib/
done

13
scripts/5-bundle.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -e
. scripts/CONFIG
DIRNAME="looqs-${TAG}"
ARCHIVENAME="${DIRNAME}.tar.xz"
mv out ${DIRNAME}
cp src/looqs-gui ${DIRNAME}
cp src/looqs ${DIRNAME}
chmod 755 src/looqs-gui
chmod 755 src/looqs
tar cfpvJ "${DIRNAME}".tar.xz "${DIRNAME}"
gpg -b --local-user "$SIGNING_KEY_EMAIL" "$ARCHIVENAME"

2
scripts/CONFIG Executable file
View File

@ -0,0 +1,2 @@
TAG="master"
SIGNING_KEY_EMAIL="repo@quitesimple.org"

7
src/looqs Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
SELF=$(readlink -f "$0")
HERE=${SELF%/*}
export LD_LIBRARY_PATH="/${HERE}/lib"
export QT_PLUGIN_PATH="/${HERE}/lib/plugins"
./bin/looqs

7
src/looqs-gui Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
SELF=$(readlink -f "$0")
HERE=${SELF%/*}
export LD_LIBRARY_PATH="/${HERE}/lib"
export QT_PLUGIN_PATH="/${HERE}/lib/plugins"
"${HERE}/bin/looqs-gui"