Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Debian package. #106

Merged
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
quicktile (0.4.0gtk3-1) UNRELEASED; urgency=medium

* First Debian package.

-- Stéphane Gourichon <stephane.gourichon@fidergo.fr> Wed, 01 Jan 2020 17:57:34 +0100
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
31 changes: 31 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Source: quicktile
Maintainer: Stéphane Gourichon <stephane_dpkg@gourichon.org>
Section: misc
Priority: optional
Build-Depends: debhelper (>= 9),
build-essential,
devscripts,
dh-python,
fakeroot,
python3,
python3-pip,
ssokolow marked this conversation as resolved.
Show resolved Hide resolved
python3-setuptools,
python3-gi,
python3-xlib,
python3-dbus,
gir1.2-gtk-3.0,
ssokolow marked this conversation as resolved.
Show resolved Hide resolved
gir1.2-wnck-3.0,
gir1.2-glib-2.0
Standards-Version: 4.4.0

Package: quicktile
Architecture: all
Depends: ${shlibs:Depends},
${misc:Depends}
Description: Keyboard-driven Window Tiling for your existing X11 window manager
QuickTile is a simple utility, inspired by WinSplit Revolution for
Windows, which adds window-tiling keybindings to your existing X11
window manager.
.
You can also think of it as a standalone alternative to the keyboard-
related features of the Compiz Grid plugin.
1 change: 1 addition & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
1 change: 1 addition & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quicktile
25 changes: 25 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1

# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

# main packaging script based on dh7 syntax
%:
dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_install:
dh_auto_install
install -D quicktile.desktop debian/quicktile/etc/xdg/autostart/quicktile.desktop
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
95 changes: 95 additions & 0 deletions recompile_local_debian_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/bin/bash

cat <<EOF
========================================================================
One-step Debian package generation script.
========================================================================

This script takes a git-version-controlled tree hierarchy containing
a proper debian/ directory for package generation, does a temporary
clone and builds debian packages from it.

Added value :
* automatically generated a proper *.orig.tar.gz as required by debuild.
* make sure the build it not polluted by any local non-commited files
* keep the original tree hierarchy clean

This script should be generic enough to be used in other programe. It
might be confused by stray version names with strange or worse, evil,
characters, but if you name your package "little bobby tables" you
deserve to to all this by hand.

Written by Stéphane Gourichon <stephane_dpkg@gourichon.org>

========================================================================

Let's go!


EOF

set -euo pipefail

cd "$(dirname "$(readlink -f "$0")" )"

dpkg-checkbuilddeps
echo -e "* dpkg-checkbuilddeps\tPASSED"

PKGDIR="$PWD"

TMPDIR=$( mktemp -d ) && echo "* Will work in temp dir $TMPDIR"

CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) && echo "* Current git branch $CURRENT_BRANCH"

NAMEFORTAR="$( head -n 1 debian/changelog | sed -n 's/^\([^ ]*\)* (\([^-]*\)-[0-9]*).*$/\1_\2/p' )"
DIRNAMEFORDEB=${NAMEFORTAR//_/-}

if [[ -z "$NAMEFORTAR" ]]
then
echo >&2 "Cannot figure out tar archive name from first line of debian/changelog. Aborting"
head -n 1 debian/changelog
exit 1
fi

if output=$(git status --porcelain) && [ -z "$output" ]; then
echo "Working directory clean"
else
echo >&2 "WARNING: uncommitted changes. Consider aborting."
git status
echo >&2 "WARNING: uncommitted changes. Consider aborting."
echo >&2 "Waiting for 10 second."
sleep 10
fi

GITREV=$( git describe )

cd "$TMPDIR"
git clone "$PKGDIR" "${DIRNAMEFORDEB}"

tar zcvf ${NAMEFORTAR}.orig.tar.gz "${DIRNAMEFORDEB}"
cd "${DIRNAMEFORDEB}"

dpkg-checkbuilddeps
debuild -us -uc

. /etc/os-release ; DISTRO_ID="${ID}-${VERSION_ID}"

OUTDIR="$PKGDIR/../compiled_packages/${DISTRO_ID}/${NAMEFORTAR}" #_$( date +%Yy%mm%dd_%Hh%Mm%Ss )"

mkdir -p "$OUTDIR"

echo "generated from git commit $GITREV" >"${OUTDIR}/${NAMEFORTAR}.gitversion"

cd ..

cp -v "${NAMEFORTAR}"?* "$OUTDIR"

echo
echo ================================================================
echo "Artifacts available in $OUTDIR:"
echo "OUTDIR=$OUTDIR"
echo ================================================================

cd "$OUTDIR"

ls -al