Skip to content

Commit 7d29ac5

Browse files
committed
debian package with venv + setup.py
1 parent 038dbb0 commit 7d29ac5

37 files changed

Lines changed: 200 additions & 53 deletions
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release with packages
2+
3+
on:
4+
workflow_dispatch: # allow manual execution
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
create_release: # used to identify the output in other jobs
11+
name: Create Release with Debian package
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
21+
- name: Install dependencies
22+
run: |
23+
sudo apt install -y qttools5-dev-tools qtchooser $(cat installer/debian/jabber4linux/DEBIAN/control | grep 'Depends' | cut -d: -f2 | sed -e 's/,/ /g' | sed -r 's/\([<>=.0-9]+\)//g')
24+
25+
- name: Execute build
26+
run: cd installer/debian/ && ./build.sh
27+
28+
- name: Get version name for Github release title
29+
run: echo "VERSION=Version $(python3 -c 'import jabber4linux; print(jabber4linux.__version__)')" >> $GITHUB_ENV
30+
31+
- id: create_release
32+
name: Create Github release
33+
uses: actions/create-release@v1
34+
env:
35+
# this token is provided automatically by Actions with permissions declared above
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
draft: true # create a release draft - only the master of disaster is allowed to publish it
39+
prerelease: false
40+
release_name: ${{ env.VERSION }}
41+
tag_name: ${{ github.ref }}
42+
43+
- name: Get artifact
44+
run: |
45+
echo "ARTIFACT_PATH=$(find installer/ -name "*.deb")" >> $GITHUB_ENV
46+
echo "ARTIFACT_NAME=$(basename $(find installer/ -name "*.deb") .deb)" >> $GITHUB_ENV
47+
48+
- name: Upload artifact
49+
uses: actions/upload-release-asset@v1
50+
env:
51+
GITHUB_TOKEN: ${{ github.token }}
52+
with:
53+
upload_url: ${{ steps.create_release.outputs.upload_url }}
54+
asset_path: ${{ env.ARTIFACT_PATH }}
55+
asset_name: ${{ env.ARTIFACT_NAME }}.deb
56+
asset_content_type: application/vnd.debian.binary-package

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ experiments/
77
build/
88
dist/
99

10+
*.egg-info/
11+
1012
installer/windows/*.exe
1113
installer/macos/target/*
1214
installer/debian/*.deb

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ For debugging / reporting bugs, please start Jabber4Linux from Terminal with par
3333
Stars & contributions welcome!
3434

3535
## Installation
36-
For Ubuntu 22.04:
36+
### Debian Package
37+
You can download and install the `.deb` package from the [latest release](https://github.com/schorschii/Jabber4Linux/releases) on GitHub.
38+
39+
### Manual Installation
40+
For Debian & Ubuntu >= 22.04:
3741
```
38-
apt install python3-requests python3-dnspython python3-pyqt5 portaudio19-dev python3-watchdog python3-cryptography python3-pip
39-
sudo -H pip3 install -r requirements.txt
42+
apt install apt install python3-requests python3-dnspython python3-pyqt5 portaudio19-dev python3-watchdog python3-cryptography python3-pip python3-venv
43+
python3 -m venv j4l # create a new venv dir
44+
j4l/bin/pip3 install -r requirements.txt # install requirements in venv
45+
j4l/bin/pip3 install . # install jabber4linux in venv
4046
41-
./Jabber4Linux.py
47+
j4l/bin/python3 -m simple_signer # start manually
4248
```
4349

4450
## SIP Transport Encryption (SIPS)

assets/jabber4linux-autostart.desktop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[Desktop Entry]
22
Type=Application
33
Name=Jabber4Linux
4-
Exec=/usr/share/jabber4linux/Jabber4Linux.py --hidden
4+
Exec=jabber4linux --hidden
55
Terminal=false
6-
Icon=/usr/share/jabber4linux/assets/tux-phone.svg
6+
Icon=/usr/share/jabber4linux/jabber4linux/assets/tux-phone.svg
77
Categories=Application;Utility
88
Comment=Unofficial Linux implementation of Cisco Jabber softphone
99

assets/jabber4linux.desktop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[Desktop Entry]
22
Type=Application
33
Name=Jabber4Linux
4-
Exec=/usr/share/jabber4linux/Jabber4Linux.py %u
4+
Exec=jabber4linux %u
55
Terminal=false
66
MimeType=x-scheme-handler/tel;
7-
Icon=/usr/share/jabber4linux/assets/tux-phone.svg
7+
Icon=/usr/share/jabber4linux/jabber4linux/assets/tux-phone.svg
88
Categories=Application;Utility
99
Comment=Unofficial Linux implementation of Cisco Jabber softphone
1010

installer/debian/build.sh

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
set -e
33

44
# build .deb package
5+
INSTALLDIR=/usr/share/jabber4linux
6+
BUILDDIR=jabber4linux
57

68
# check root permissions
7-
if [ "$EUID" -ne 0 ]
8-
then echo "Please run this script as root!"
9-
exit
9+
if [ "$EUID" -ne 0 ]; then
10+
echo "Please run this script as root!"
11+
#exit 1 # disabled for github workflow. don't know why this check fails here but sudo works.
1012
fi
1113

1214
# cd to working dir
@@ -16,29 +18,25 @@ cd "$(dirname "$0")"
1618
lrelease ../../lang/*.ts
1719

1820
# empty / create necessary directories
19-
if [ -d "jabber4linux/usr/share/jabber4linux" ]; then
20-
rm -r jabber4linux/usr/share/jabber4linux
21+
if [ -d "$BUILDDIR/usr" ]; then
22+
sudo rm -r $BUILDDIR/usr
2123
fi
22-
mkdir -p jabber4linux/usr/share/jabber4linux/lang
23-
mkdir -p jabber4linux/usr/share/jabber4linux/assets
24-
mkdir -p jabber4linux/usr/share/applications
25-
mkdir -p jabber4linux/etc/xdg/autostart
2624

2725
# copy files in place
28-
cp ../../assets/jabber4linux-autostart.desktop jabber4linux/etc/xdg/autostart
29-
cp ../../assets/jabber4linux.desktop jabber4linux/usr/share/applications
30-
cp ../../*.py jabber4linux/usr/share/jabber4linux
31-
cp ../../lang/*.qm jabber4linux/usr/share/jabber4linux/lang
32-
cp ../../assets/*.svg jabber4linux/usr/share/jabber4linux/assets
33-
cp ../../assets/*.wav jabber4linux/usr/share/jabber4linux/assets
34-
cp ../../README.md jabber4linux/usr/share/jabber4linux
35-
cp ../../LICENSE jabber4linux/usr/share/jabber4linux
36-
37-
# set file permissions
38-
chown -R root:root jabber4linux
39-
chmod 775 jabber4linux/usr/share/jabber4linux/Jabber4Linux.py
26+
sudo install -D -m 644 ../../assets/jabber4linux-autostart.desktop -t $BUILDDIR/etc/xdg/autostart
27+
sudo install -D -m 644 ../../assets/jabber4linux.desktop -t $BUILDDIR/usr/share/applications
28+
sudo install -D -m 644 ../../lang/*.qm -t $BUILDDIR/$INSTALLDIR/lang
29+
sudo install -D -m 644 ../../jabber4linux/*.py -t $BUILDDIR/$INSTALLDIR/jabber4linux
30+
sudo install -D -m 644 ../../jabber4linux/assets/* -t $BUILDDIR/$INSTALLDIR/jabber4linux/assets
31+
sudo install -D -m 644 ../../requirements.txt -t $BUILDDIR/$INSTALLDIR
32+
sudo install -D -m 644 ../../setup.py -t $BUILDDIR/$INSTALLDIR
33+
sudo install -D -m 644 ../../README.md -t $BUILDDIR/$INSTALLDIR
34+
35+
# make binary available in PATH
36+
sudo mkdir -p $BUILDDIR/usr/bin
37+
sudo ln -sf $INSTALLDIR/venv/bin/jabber4linux $BUILDDIR/usr/bin/jabber4linux
4038

4139
# build deb
42-
dpkg-deb -Zxz --build jabber4linux
40+
dpkg-deb -Zxz --build $BUILDDIR
4341

4442
echo "Build finished"

installer/debian/jabber4linux/DEBIAN/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ Version: 0.5.1
33
Section: base
44
Priority: optional
55
Architecture: all
6-
Depends: python3, python3-requests, python3-dnspython, python3-pyqt5, portaudio19-dev, python3-watchdog, python3-cryptography (>=2.5), python3-filelock, python3-pip
6+
Depends: python3, python3-requests, python3-dnspython, python3-pyqt5, portaudio19-dev, python3-watchdog, python3-cryptography (>=2.5), python3-filelock, python3-pip, python3-venv, python3-setuptools
77
Maintainer: Georg Sieber <it@georg-sieber.de>
88
Description: Unofficial Cisco Jabber implementation for Linux (https://github.com/schorschii/jabber4linux)
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#!/bin/bash
22

3-
# Exit on error
3+
# exit on error
44
set -e
55

6-
# Source debconf library.
7-
. /usr/share/debconf/confmodule
6+
# source debconf library
7+
#. /usr/share/debconf/confmodule
88

9-
# install modules which are not available in the Debian/Ubuntu repos
10-
pip3 install --upgrade PyAudio opuslib asn1
9+
DIR=/usr/share/jabber4linux
1110

11+
# create system-wide venv and install python libraries via pip
12+
python3 -m venv --system-site-packages $DIR/venv
13+
$DIR/venv/bin/pip3 install --upgrade $DIR
14+
$DIR/venv/bin/pip3 uninstall -y pip
15+
16+
# recognize desktop shortcut / protocol handler
1217
update-desktop-database
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# exit on error
4+
set -e
5+
6+
# source debconf library
7+
#. /usr/share/debconf/confmodule
8+
9+
DIR=/usr/share/jabber4linux
10+
11+
# remove venv
12+
rm -r $DIR/build || true
13+
rm -r $DIR/jabber4linux/__pycache__ || true
14+
rm -r $DIR/venv
15+
rm -r $DIR/jabber4linux.egg-info

0 commit comments

Comments
 (0)