Add arch package

This commit is contained in:
Ximi1970
2020-11-22 12:48:19 +01:00
parent 83767a7e20
commit e5174bf3df
8 changed files with 309 additions and 8 deletions

View File

@@ -250,6 +250,43 @@ sudo dnf install systray-x-minimal
```
### Arch
#### Repository
Installing the repository:
```bash
wget -q https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/Arch/x86_64/home_Ximi1970_Mozilla_Add-ons_Arch.key
sudo pacman-key --add home_Ximi1970_Mozilla_Add-ons_Arch.key
sudo pacman-key --lsign-key BEEF5C3607D86FE9
sudo echo -e "\n[home_Ximi1970_Mozilla_Add-ons_Arch]\nSigLevel = PackageOptional\nServer = https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/Arch/x86_64" | sudo tee -a /etc/pacman.conf
sudo pacman -Syyu
```
#### Package
Installing the SysTray-X addon and companion app package:
###### KDE
```bash
sudo pacman -S systray-x
```
###### GNOME
```bash
sudo pacman -S systray-x-gnome
```
###### XFCE / Others (non-KDE, non-GNOME)
```bash
sudo pacman -S systray-x-minimal
```
## Binaries (User)
User installable package.

138
dist/arch/gnome/PKGBUILD vendored Normal file
View File

@@ -0,0 +1,138 @@
# Maintainer: Maxime Rijnders <ximi.obs@gmail.com>
pkgname=systray-x-gnome
pkgver=0
pkgrel=0
epoch=1
pkgdesc='A system tray extension for Thunderbird 68+ (GNOME)'
arch=(x86_64)
url=https://github.com/Ximi1970/systray-x
license=(MPL-2.0)
depends=(
'qt5-base'
'gnome-shell-extension-appindicator'
'thunderbird>=68'
'thunderbird<=84'
)
makedepends=(
'git'
'unzip'
'zip'
'libx11'
'qt5-base'
'notifications'
)
provides=(
'systray-x'
)
source=($pkgname-$pkgver.tar.xz)
sha256sums=(SKIP)
build() {
cd $pkgname-$pkgver
export VERSION=$(cat dist/rpm/VERSION | grep VERSION | sed -e "s/VERSION=\(.*\)/\1/")
export VERSION_MAJOR=$(echo $VERSION | cut -d'.' -f1)
export VERSION_MINOR=$(echo $VERSION | cut -d'.' -f2)
export VERSION_PATCH=$(echo $VERSION | cut -d'.' -f3)
export BUILD_NUMBER=$(cat dist/rpm/VERSION | grep BUILD_NUMBER | sed -e "s/BUILD_NUMBER=\(.*\)/\1/")
export GIT_HASH=$(cat dist/rpm/VERSION | grep GIT_HASH | sed -e "s/GIT_HASH=\(.*\)/\1/")
export GIT_BRANCH=$(cat dist/rpm/VERSION | grep GIT_BRANCH | sed -e "s/GIT_BRANCH=\(.*\)/\1/")
sed < app/config/linux/SysTray_X.json.template -e 's|SYSTRAY_X_PATH|/usr/bin/SysTray-X|' > SysTray_X.json
make EXT_VERSION="DEFINES+=EXT_VERSION DEFINES+=APP_VERSION_MAJOR=\\\\\\\\\\\\\\\"$VERSION_MAJOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_MINOR=\\\\\\\\\\\\\\\"$VERSION_MINOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_PATCH=\\\\\\\\\\\\\\\"$VERSION_PATCH\\\\\\\\\\\\\\\" DEFINES+=APP_BUILD=\\\\\\\\\\\\\\\"$BUILD_NUMBER\\\\\\\\\\\\\\\" DEFINES+=APP_GITHASH=\\\\\\\\\\\\\\\"$GIT_HASH\\\\\\\\\\\\\\\" DEFINES+=APP_GITBRANCH=\\\\\\\\\\\\\\\"$GIT_BRANCH\\\\\\\\\\\\\\\""
}
package() {
mkdir -p "${pkgdir}"/usr/bin
cp -f ${pkgname}-${pkgver}/app/build/SysTray-X "${pkgdir}"/usr/bin/SysTray-X
mkdir -p "${pkgdir}"/usr/lib/mozilla/native-messaging-hosts
cp -f ${pkgname}-${pkgver}/SysTray_X.json "${pkgdir}"/usr/lib/mozilla/native-messaging-hosts/SysTray_X.json
mkdir -p "${pkgdir}"/usr/lib/thunderbird/distribution/extensions
cp -f ${pkgname}-${pkgver}/systray-x@Ximi1970.xpi "${pkgdir}"/usr/lib//thunderbird/distribution/extensions/systray-x@Ximi1970.xpi
}
post_install() {
PROF_DIR=/etc/dconf/profile
PROF_FILE=user
if [ -f $PROF_DIR/$PROF_FILE ] ; then
#
# Edit user file
#
grep -q "user-db:user" $PROF_DIR/$PROF_FILE
if [ "$?" = "1" ] ; then
echo "user-db:user" >> $PROF_DIR/$PROF_FILE
fi
grep -q "system-db:local" $PROF_DIR/$PROF_FILE
if [ "$?" = "1" ] ; then
echo "system-db:local" >> $PROF_DIR/$PROF_FILE
fi
else
#
# Generate user file
#
mkdir -p $PROF_DIR
cat >$PROF_DIR/$PROF_FILE <<EOF
user-db:user
system-db:local
EOF
fi
DEB_VENDOR=$(cat /etc/dpkg/origins/default | grep Vendor: | sed -e "s/Vendor: //")
case $DEB_VENDOR in
Debian)
EXTENSION="ubuntu-appindicators@ubuntu.com"
;;
Ubuntu)
RELEASE=$(lsb_release -rs)
case $RELEASE in
16.04)
EXTENSION="appindicatorsupport@rgcjonas.gmail.com"
;;
*)
EXTENSION="ubuntu-appindicators@ubuntu.com"
;;
esac
;;
*)
EXTENSION="ubuntu-appindicators@ubuntu.com"
;;
esac
CONF_DIR=/etc/dconf/db/local.d
CONF_FILE=00-extensions
if [ -f $CONF_DIR/$CONF_FILE ] ; then
#
# Edit extensions file
#
grep -q $EXTENSION $CONF_DIR/$CONF_FILE
if [ "$?" = "1" ] ; then
sed -i -e "s/\(enabled-extensions=\[.*\)\]/\1, '${EXTENSION}'\]/" $CONF_DIR/$CONF_FILE
fi
else
#
# Generate extensions file
#
mkdir -p $CONF_DIR
echo "[org/gnome/shell]" > $CONF_DIR/$CONF_FILE
echo "# List all extensions that you want to have enabled for all users" >> $CONF_DIR/$CONF_FILE
echo "enabled-extensions=['${EXTENSION}']" >> $CONF_DIR/$CONF_FILE
fi
which dconf > /dev/null 2>&1
if [ "$?" = "0" ] ; then
dconf update
fi
}

58
dist/arch/kde/PKGBUILD vendored Normal file
View File

@@ -0,0 +1,58 @@
# Maintainer: Maxime Rijnders <ximi.obs@gmail.com>
pkgname=systray-x
pkgver=0
pkgrel=0
epoch=1
pkgdesc='A system tray extension for Thunderbird 68+ (KDE)'
arch=(x86_64)
url=https://github.com/Ximi1970/systray-x
license=(MPL-2.0)
depends=(
'qt5-base'
'knotifications'
'thunderbird>=68'
'thunderbird<=84'
)
makedepends=(
'git'
'unzip'
'zip'
'libx11'
'qt5-base'
'knotifications'
)
provides=(
'systray-x'
)
source=($pkgname-$pkgver.tar.xz)
sha256sums=(SKIP)
build() {
cd $pkgname-$pkgver
export VERSION=$(cat dist/rpm/VERSION | grep VERSION | sed -e "s/VERSION=\(.*\)/\1/")
export VERSION_MAJOR=$(echo $VERSION | cut -d'.' -f1)
export VERSION_MINOR=$(echo $VERSION | cut -d'.' -f2)
export VERSION_PATCH=$(echo $VERSION | cut -d'.' -f3)
export BUILD_NUMBER=$(cat dist/rpm/VERSION | grep BUILD_NUMBER | sed -e "s/BUILD_NUMBER=\(.*\)/\1/")
export GIT_HASH=$(cat dist/rpm/VERSION | grep GIT_HASH | sed -e "s/GIT_HASH=\(.*\)/\1/")
export GIT_BRANCH=$(cat dist/rpm/VERSION | grep GIT_BRANCH | sed -e "s/GIT_BRANCH=\(.*\)/\1/")
sed < app/config/linux/SysTray_X.json.template -e 's|SYSTRAY_X_PATH|/usr/bin/SysTray-X|' > SysTray_X.json
make EXT_VERSION="DEFINES+=EXT_VERSION DEFINES+=APP_VERSION_MAJOR=\\\\\\\\\\\\\\\"$VERSION_MAJOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_MINOR=\\\\\\\\\\\\\\\"$VERSION_MINOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_PATCH=\\\\\\\\\\\\\\\"$VERSION_PATCH\\\\\\\\\\\\\\\" DEFINES+=APP_BUILD=\\\\\\\\\\\\\\\"$BUILD_NUMBER\\\\\\\\\\\\\\\" DEFINES+=APP_GITHASH=\\\\\\\\\\\\\\\"$GIT_HASH\\\\\\\\\\\\\\\" DEFINES+=APP_GITBRANCH=\\\\\\\\\\\\\\\"$GIT_BRANCH\\\\\\\\\\\\\\\""
}
package() {
mkdir -p "${pkgdir}"/usr/bin
cp -f ${pkgname}-${pkgver}/app/build/SysTray-X "${pkgdir}"/usr/bin/SysTray-X
mkdir -p "${pkgdir}"/usr/lib/mozilla/native-messaging-hosts
cp -f ${pkgname}-${pkgver}/SysTray_X.json "${pkgdir}"/usr/lib/mozilla/native-messaging-hosts/SysTray_X.json
mkdir -p "${pkgdir}"/usr/lib/thunderbird/distribution/extensions
cp -f ${pkgname}-${pkgver}/systray-x@Ximi1970.xpi "${pkgdir}"/usr/lib//thunderbird/distribution/extensions/systray-x@Ximi1970.xpi
}

56
dist/arch/minimal/PKGBUILD vendored Normal file
View File

@@ -0,0 +1,56 @@
# Maintainer: Maxime Rijnders <ximi.obs@gmail.com>
pkgname=systray-x-minimal
pkgver=0
pkgrel=0
epoch=1
pkgdesc='A system tray extension for Thunderbird 68+ (Unity/XFCE/other)'
arch=(x86_64)
url=https://github.com/Ximi1970/systray-x
license=(MPL-2.0)
depends=(
'qt5-base'
'thunderbird>=68'
'hunderbird<=84'
)
makedepends=(
'git'
'unzip'
'zip'
'libx11'
't5-base'
)
provides=(
'systray-x'
)
source=($pkgname-$pkgver.tar.xz)
sha256sums=(SKIP)
build() {
cd $pkgname-$pkgver
export VERSION=$(cat dist/rpm/VERSION | grep VERSION | sed -e "s/VERSION=\(.*\)/\1/")
export VERSION_MAJOR=$(echo $VERSION | cut -d'.' -f1)
export VERSION_MINOR=$(echo $VERSION | cut -d'.' -f2)
export VERSION_PATCH=$(echo $VERSION | cut -d'.' -f3)
export BUILD_NUMBER=$(cat dist/rpm/VERSION | grep BUILD_NUMBER | sed -e "s/BUILD_NUMBER=\(.*\)/\1/")
export GIT_HASH=$(cat dist/rpm/VERSION | grep GIT_HASH | sed -e "s/GIT_HASH=\(.*\)/\1/")
export GIT_BRANCH=$(cat dist/rpm/VERSION | grep GIT_BRANCH | sed -e "s/GIT_BRANCH=\(.*\)/\1/")
sed < app/config/linux/SysTray_X.json.template -e 's|SYSTRAY_X_PATH|/usr/bin/SysTray-X|' > SysTray_X.json
make OPTIONS="DEFINES+=NO_KDE_INTEGRATION" EXT_VERSION="DEFINES+=EXT_VERSION DEFINES+=APP_VERSION_MAJOR=\\\\\\\\\\\\\\\"$VERSION_MAJOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_MINOR=\\\\\\\\\\\\\\\"$VERSION_MINOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_PATCH=\\\\\\\\\\\\\\\"$VERSION_PATCH\\\\\\\\\\\\\\\" DEFINES+=APP_BUILD=\\\\\\\\\\\\\\\"$BUILD_NUMBER\\\\\\\\\\\\\\\" DEFINES+=APP_GITHASH=\\\\\\\\\\\\\\\"$GIT_HASH\\\\\\\\\\\\\\\" DEFINES+=APP_GITBRANCH=\\\\\\\\\\\\\\\"$GIT_BRANCH\\\\\\\\\\\\\\\""
}
package() {
mkdir -p "${pkgdir}"/usr/bin
cp -f ${pkgname}-${pkgver}/app/build/SysTray-X "${pkgdir}"/usr/bin/SysTray-X
mkdir -p "${pkgdir}"/usr/lib/mozilla/native-messaging-hosts
cp -f ${pkgname}-${pkgver}/SysTray_X.json "${pkgdir}"/usr/lib/mozilla/native-messaging-hosts/SysTray_X.json
mkdir -p "${pkgdir}"/usr/lib/thunderbird/distribution/extensions
cp -f ${pkgname}-${pkgver}/systray-x@Ximi1970.xpi "${pkgdir}"/usr/lib//thunderbird/distribution/extensions/systray-x@Ximi1970.xpi
}

View File

@@ -14,6 +14,7 @@
<param name="extract">dist/deb/gnome/debian.rules</param>
<param name="extract">dist/deb/gnome/debian.postinst</param>
<param name="extract">dist/deb/gnome/systray-x-gnome.dsc</param>
<param name="extract">dist/arch/gnome/PKGBUILD</param>
</service>
<service mode="buildtime" name="tar" />
<service mode="buildtime" name="recompress">

View File

@@ -12,6 +12,7 @@
<param name="extract">dist/deb/kde/debian.control</param>
<param name="extract">dist/deb/kde/debian.rules</param>
<param name="extract">dist/deb/kde/systray-x.dsc</param>
<param name="extract">dist/arch/kde/PKGBUILD</param>
</service>
<service mode="buildtime" name="tar" />
<service mode="buildtime" name="recompress">

View File

@@ -5,15 +5,16 @@
<param name="revision">0.5.0</param>
<param name="versionformat">0.5.0</param>
<param name="filename">systray-x-minimal</param>
<param name="extract">dist/rpm/gnome/systray-x-minimal.changes</param>
<param name="extract">dist/rpm/gnome/systray-x-minimal.spec</param>
<param name="extract">dist/rpm/minimal/systray-x-minimal.changes</param>
<param name="extract">dist/rpm/minimal/systray-x-minimal.spec</param>
<param name="extract">dist/rpm/VERSION</param>
<param name="extract">dist/deb/gnome/debian.changelog</param>
<param name="extract">dist/deb/gnome/debian.compat</param>
<param name="extract">dist/deb/gnome/debian.control</param>
<param name="extract">dist/deb/gnome/debian.rules</param>
<param name="extract">dist/deb/gnome/debian.postinst</param>
<param name="extract">dist/deb/gnome/systray-x-minimal.dsc</param>
<param name="extract">dist/deb/minimal/debian.changelog</param>
<param name="extract">dist/deb/minimal/debian.compat</param>
<param name="extract">dist/deb/minimal/debian.control</param>
<param name="extract">dist/deb/minimal/debian.rules</param>
<param name="extract">dist/deb/minimal/debian.postinst</param>
<param name="extract">dist/deb/minimal/systray-x-minimal.dsc</param>
<param name="extract">dist/arch/minimal/PKGBUILD</param>
</service>
<service mode="buildtime" name="tar" />
<service mode="buildtime" name="recompress">

View File

@@ -23,5 +23,14 @@ sed -i -e "s?\(^Depends:.*, thunderbird (<= 1:\).*?\1$VERSION)?" $SERVICE_FILE
SERVICE_FILE="./dist/deb/minimal/debian.control"
sed -i -e "s?\(^Depends:.*, thunderbird (<= 1:\).*?\1$VERSION)?" $SERVICE_FILE
SERVICE_FILE="./dist/arch/kde/PKGBUILD"
sed -i -e "s?\(^.*thunderbird<=\).*?\1$VERSION?" $SERVICE_FILE
SERVICE_FILE="./dist/arch/gnome/PKGBUILD"
sed -i -e "s?\(^.*thunderbird<=\).*?\1$VERSION?" $SERVICE_FILE
SERVICE_FILE="./dist/arch/minimal/PKGBUILD"
sed -i -e "s?\(^.*thunderbird<=\).*?\1$VERSION?" $SERVICE_FILE
MANIFEST_FILE="./webext/manifest.json"
sed -i -e "s?\(^.*\"strict_max_version\": \"\).*\(\.\*\"\)?\1$VERSION\2?" $MANIFEST_FILE