Skip to content

Commit

Permalink
Packaging: Added scripts + docker instance to build .deb package
Browse files Browse the repository at this point in the history
See Issue #37
  • Loading branch information
pentix committed Sep 16, 2019
1 parent 0248fbc commit ad47db9
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ qjournalctl.pro.user
build/*
src/version.h
qrc_icon.cpp
*.deb
15 changes: 15 additions & 0 deletions packaging/deb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ubuntu

ARG LIBSSHVERS=0.9
ARG LIBSSHVERSION=0.9.0

WORKDIR /build

# Get dependencies
RUN apt-get update -y
RUN apt-get install -y build-essential pkg-config qtbase5-dev cmake g++ libssl-dev xz-utils libzip-dev wget

# Manually build libssh
RUN wget https://www.libssh.org/files/$LIBSSHVERS/libssh-$LIBSSHVERSION.tar.xz && tar xf libssh-$LIBSSHVERSION.tar.xz && cd libssh-$LIBSSHVERSION && mkdir build && cd build && cmake .. && make -j$(nproc) && make install && cd ../.. && rm -rf /build/*

# Ready to build qjournalctl now :)
12 changes: 12 additions & 0 deletions packaging/deb/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Create deb file
all:
docker run --rm -id --name=qjournalctl-deb --volume=$(realpath ../..)/:/source:ro --volume=$(realpath .)/:/out pentix/qjournalctl-deb-build-env
touch qjournalctl_0.6-1.deb
docker exec qjournalctl-deb bash /out/build_deb.sh
docker stop qjournalctl-deb

docker-build-env: Dockerfile
docker build -t pentix/qjournalctl-deb-build-env .

push-docker-build-env: docker-build-env
docker push pentix/qjournalctl-deb-build-env
23 changes: 23 additions & 0 deletions packaging/deb/build_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#/bin/bash

NAME=qjournalctl
VERSION=0.6
PKGREV=1
OUT="$NAME""_$VERSION-$PKGREV"

# Build
QT_SELECT=qt5 qmake /source/qjournalctl.pro -r -spec linux-g++ CONFIG+=release
make -j$(nproc)

# Move required files
cp -r /source/packaging/files $OUT/
mkdir -p $OUT/usr/bin
mv qjournalctl $OUT/usr/bin

# debian pkg files
mkdir -p $OUT/DEBIAN/
cp /source/packaging/deb/control $OUT/DEBIAN/
dpkg-deb --build $OUT

# Keep ownership
cat $OUT.deb > /out/$OUT.deb
8 changes: 8 additions & 0 deletions packaging/deb/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: qjournalctl
Version: 0.6-1
Section: admin
Priority: optional
Architecture: amd64
Depends: libssh (>= 0.8.7), qtbase5-dev (>= 5.5.1)
Maintainer: Patrick Eigensatz <[email protected]>
Description: A Qt-based Graphical User Interface for systemd's journalctl command
10 changes: 10 additions & 0 deletions packaging/files/usr/share/applications/qjournalctl.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=QJournalctl
Comment=Graphical User Interface for systemd's journalctl
Exec=qjournalctl
Icon=qjournalctl
Terminal=false
StartupNotify=false
Categories=System;
Binary file added packaging/files/usr/share/pixmaps/qjournalctl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ad47db9

Please sign in to comment.