From 0a8f7bbf8e3bbe3639e1c3e2b06d6a212930df90 Mon Sep 17 00:00:00 2001 From: Hugues Morisset Date: Thu, 1 Oct 2015 19:35:45 +0200 Subject: [PATCH 01/41] Add Debian package files --- debian/changelog | 12 +++++++ debian/compat | 1 + debian/control | 19 ++++++++++ debian/copyright | 86 ++++++++++++++++++++++++++++++++++++++++++++ debian/docs | 2 ++ debian/rules | 28 +++++++++++++++ debian/source/format | 1 + 7 files changed, 149 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..8fef5fb --- /dev/null +++ b/debian/changelog @@ -0,0 +1,12 @@ +telegram-purple (1.2.2~bw1-1) UNRELEASED; urgency=medium + + [ Hugues Morisset ] + * Initial Release (Closes: #800771) + + [ Ben Wiederhake ] + * Please note that due to the format-switch, the file + /etc/telegram-purple/server.pub is obsolete for this version. + It is only tolerated to allow for smooth transition from old, manual + installations, and will be removed in future versions. + + -- Hugues Morisset Tue, 13 Oct 2015 14:12:44 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..7214af9 --- /dev/null +++ b/debian/control @@ -0,0 +1,19 @@ +Source: telegram-purple +Section: net +Priority: optional +Maintainer: Hugues Morisset +Uploaders: Ben Wiederhake +Build-Depends: debhelper (>= 9), autotools-dev, libpurple-dev, zlib1g-dev, libgcrypt20-dev, libwebp-dev, libglib2.0-dev, pkg-config +Standards-Version: 3.9.6 +Homepage: https://github.com/majn/telegram-purple +Vcs-Git: https://github.com/majn/telegram-purple.git +#Vcs-Browser: https://anonscm.debian.org/gitweb/?p=collab-maint/telegram-purple.git;a=summary + +Package: telegram-purple +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: pidgin | finch +Description: Purple plugin to support Telegram + Plugin for purple which lets you use and manage your Telegram account + like any other account in purple. Some features like self-destruct + messages are currently in development. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ec4f661 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,86 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: pidgin-telegram +Source: https://github.com/majn/telegram-purple + +Files: * +Copyright: 2014-2015 Matthias Jentsch + 2014 Vitaly Valtman + 2014 Christopher Althaus + 2014 Markus Endres +License: GPL-2+ + +Files: debian/* +Copyright: 2015 Hugues Morisset + 2015 Ben Wiederhake +License: GPL-2+ + +Files: lodepng/* +Copyright: 2005-2014 Lode Vandevenne +License: Zlib + +Files: tgl/* +Copyright: 2013-2015 Vitaly Valtman + 2015 Matthias Jentsch + 2015 Ben Wiederhake +License: LGPL-2.1+ + +Files: tgl/tl-parser/* +Copyright: 2015 Matthias Jentsch + 2015 Vitaly Valtman + 2015 Christopher Althaus + 2015 Markus Endres +License: GPL-2+ + +License: LGPL-2.1+ + This package is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in "/usr/share/common-licenses/LGPL-2". + +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +License: Zlib + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + . + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + . + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + . + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + . + 3. This notice may not be removed or altered from any source + distribution. diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..0b6e0f3 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +AUTHORS +README.md diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..f09a808 --- /dev/null +++ b/debian/rules @@ -0,0 +1,28 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export 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 $@ + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- \ +# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) From bcb0af12f9e82cf586a62bafd51d0cff832ab4a9 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 3 Oct 2015 00:55:13 +0200 Subject: [PATCH 02/41] Add gitignore for dh files --- debian/.gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 debian/.gitignore diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000..7290429 --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,3 @@ +/files +/telegram-purple/ +/telegram-purple.* From 9053eaf12476776c6049600f2610431f5013a533 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 5 Oct 2015 08:31:45 +0200 Subject: [PATCH 03/41] Add watchfile. Tested with uscan, looks like it's working. Remember to test updates of this file before pushing them! --- debian/watch | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 debian/watch diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..b5bfa2d --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/telegram-purple_$1\.tar\.gz/,uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/ \ + https://github.com/majn/telegram-purple/tags .*/v?(\d\S*)\.tar\.gz From 8eb09f9adfb60ea262b6115ad716238762dd41e6 Mon Sep 17 00:00:00 2001 From: Meitar Moscovitz Date: Mon, 5 Oct 2015 14:30:28 +0200 Subject: [PATCH 04/41] Add raw git-archive-all.sh script Please note that the script is not at all production-ready, but it's juuust so enough for our purposes. I have no idea how other people generate reproducible tars. I tried: - 'tar' simply doesn't honor --exclude-cvs-ignore on my machine. - 'tar' with --exclude-from=.gitignore requires including `git config --global core.excludesfile`, which requires tilde-expansion, which I simply don't grasp. - `git archive` doesn't include submodules. --- debian/copyright | 23 ++++ debian/rawtar | 308 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 331 insertions(+) create mode 100755 debian/rawtar diff --git a/debian/copyright b/debian/copyright index ec4f661..667e7b2 100644 --- a/debian/copyright +++ b/debian/copyright @@ -14,6 +14,12 @@ Copyright: 2015 Hugues Morisset 2015 Ben Wiederhake License: GPL-2+ +Files: debian/rawtar +Copyright: 2008, 2009, 2013, 2014 Meitar Moscovitz + 2011, 2013 Marius Ghita + 2012 C.D. Clark III +License: GPL-3+ + Files: lodepng/* Copyright: 2005-2014 Lode Vandevenne License: Zlib @@ -65,6 +71,23 @@ License: GPL-2+ On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". +License: GPL-3+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + License: Zlib This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/debian/rawtar b/debian/rawtar new file mode 100755 index 0000000..5daaf52 --- /dev/null +++ b/debian/rawtar @@ -0,0 +1,308 @@ +#!/bin/bash - + +# Found on https://github.com/meitar/git-archive-all.sh +# Version: cd7302ea7c8973f7fc360ae1a77e3b4a28a6eeb7 +# Copyright Meitar Moscovitz 2008, 2009, 2013, 2014 +# Marius Ghita 2011, 2013 +# C.D. Clark III 2012 +# +# File: git-archive-all.sh +# +# Description: A utility script that builds an archive file(s) of all +# git repositories and submodules in the current path. +# Useful for creating a single tarfile of a git super- +# project that contains other submodules. +# +# Examples: Use git-archive-all.sh to create archive distributions +# from git repositories. To use, simply do: +# +# cd $GIT_DIR; git-archive-all.sh +# +# where $GIT_DIR is the root of your git superproject. +# +# License: GPL3+ +# +############################################################################### +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +############################################################################### + +# DEBUGGING +set -e +set -C # noclobber + +# TRAP SIGNALS +trap 'cleanup' QUIT EXIT + +# For security reasons, explicitly set the internal field separator +# to newline, space, tab +OLD_IFS=$IFS +IFS=' + ' + +function cleanup () { + rm -f $TMPFILE + rm -f $TOARCHIVE + IFS="$OLD_IFS" +} + +function usage () { + echo "Usage is as follows:" + echo + echo "$PROGRAM <--version>" + echo " Prints the program version number on a line by itself and exits." + echo + echo "$PROGRAM <--usage|--help|-?>" + echo " Prints this usage output and exits." + echo + echo "$PROGRAM [--format ] [--prefix ] [--verbose|-v] [--separate|-s]" + echo " [--tree-ish|-t ] [output_file]" + echo " Creates an archive for the entire git superproject, and its submodules" + echo " using the passed parameters, described below." + echo + echo " If '--format' is specified, the archive is created with the named" + echo " git archiver backend. Obviously, this must be a backend that git archive" + echo " understands. The format defaults to 'tar' if not specified." + echo + echo " If '--prefix' is specified, the archive's superproject and all submodules" + echo " are created with the prefix named. The default is to not use one." + echo + echo " If '--separate' or '-s' is specified, individual archives will be created" + echo " for each of the superproject itself and its submodules. The default is to" + echo " concatenate individual archives into one larger archive." + echo + echo " If '--tree-ish' is specified, the archive will be created based on whatever" + echo " you define the tree-ish to be. Branch names, commit hash, etc. are acceptable." + echo " Defaults to HEAD if not specified. See git archive's documentation for more" + echo " information on what a tree-ish is." + echo + echo " If 'output_file' is specified, the resulting archive is created as the" + echo " file named. This parameter is essentially a path that must be writeable." + echo " When combined with '--separate' ('-s') this path must refer to a directory." + echo " Without this parameter or when combined with '--separate' the resulting" + echo " archive(s) are named with a dot-separated path of the archived directory and" + echo " a file extension equal to their format (e.g., 'superdir.submodule1dir.tar')." + echo + echo " The special value '-' (single dash) is treated as STDOUT and, when used, the" + echo " --separate option is ignored. Use a double-dash to separate the outfile from" + echo " the value of previous options. For example, to write a .zip file to STDOUT:" + echo + echo " ./$PROGRAM --format zip -- -" + echo + echo " If '--verbose' or '-v' is specified, progress will be printed." +} + +function version () { + echo "$PROGRAM version $VERSION" +} + +# Internal variables and initializations. +readonly PROGRAM=`basename "$0"` +readonly VERSION=0.3 + +SEPARATE=0 +VERBOSE=0 + +TARCMD=`command -v gnutar || command -v tar` +FORMAT=tar +PREFIX= +TREEISH=HEAD + +# RETURN VALUES/EXIT STATUS CODES +readonly E_BAD_OPTION=254 +readonly E_UNKNOWN=255 + +# Process command-line arguments. +while test $# -gt 0; do + if [ x"$1" == x"--" ]; then + # detect argument termination + shift + break + fi + case $1 in + --format ) + shift + FORMAT="$1" + shift + ;; + + --prefix ) + shift + PREFIX="$1" + shift + ;; + + --separate | -s ) + shift + SEPARATE=1 + ;; + + --tree-ish | -t ) + shift + TREEISH="$1" + shift + ;; + + --version ) + version + exit + ;; + + --verbose | -v ) + shift + VERBOSE=1 + ;; + + -? | --usage | --help ) + usage + exit + ;; + + -* ) + echo "Unrecognized option: $1" >&2 + usage + exit $E_BAD_OPTION + ;; + + * ) + break + ;; + esac +done + +OLD_PWD="`pwd`" +TMPDIR=${TMPDIR:-/tmp} +TMPFILE=`mktemp "$TMPDIR/$PROGRAM.XXXXXX"` # Create a place to store our work's progress +TOARCHIVE=`mktemp "$TMPDIR/$PROGRAM.toarchive.XXXXXX"` +OUT_FILE=$OLD_PWD # assume "this directory" without a name change by default + +if [ ! -z "$1" ]; then + OUT_FILE="$1" + if [ "-" == $OUT_FILE ]; then + SEPARATE=0 + fi + shift +fi + +# Validate parameters; error early, error often. +if [ "-" == $OUT_FILE -o $SEPARATE -ne 1 ] && [ "$FORMAT" == "tar" -a `$TARCMD --help | grep -q -- "--concatenate"; echo $?` -ne 0 ]; then + echo "Your 'tar' does not support the '--concatenate' option, which we need" + echo "to produce a single tarfile. Either install a compatible tar (such as" + echo "gnutar), or invoke $PROGRAM with the '--separate' option." + exit +elif [ $SEPARATE -eq 1 -a ! -d $OUT_FILE ]; then + echo "When creating multiple archives, your destination must be a directory." + echo "If it's not, you risk being surprised when your files are overwritten." + exit +elif [ `git config -l | grep -q '^core\.bare=false'; echo $?` -ne 0 ]; then + echo "$PROGRAM must be run from a git working copy (i.e., not a bare repository)." + exit +fi + +# Create the superproject's git-archive +if [ $VERBOSE -eq 1 ]; then + echo -n "creating superproject archive..." +fi +git archive --format=$FORMAT --prefix="$PREFIX" $TREEISH > $TMPDIR/$(basename "$(pwd)").$FORMAT +if [ $VERBOSE -eq 1 ]; then + echo "done" +fi +echo $TMPDIR/$(basename "$(pwd)").$FORMAT >| $TMPFILE # clobber on purpose +superfile=`head -n 1 $TMPFILE` + +if [ $VERBOSE -eq 1 ]; then + echo -n "looking for subprojects..." +fi +# find all '.git' dirs, these show us the remaining to-be-archived dirs +# we only want directories that are below the current directory +find . -mindepth 2 -name '.git' -type d -print | sed -e 's/^\.\///' -e 's/\.git$//' >> $TOARCHIVE +# as of version 1.7.8, git places the submodule .git directories under the superprojects .git dir +# the submodules get a .git file that points to their .git dir. we need to find all of these too +find . -mindepth 2 -name '.git' -type f -print | xargs grep -l "gitdir" | sed -e 's/^\.\///' -e 's/\.git$//' >> $TOARCHIVE +if [ $VERBOSE -eq 1 ]; then + echo "done" + echo " found:" + cat $TOARCHIVE | while read arch + do + echo " $arch" + done +fi + +if [ $VERBOSE -eq 1 ]; then + echo -n "archiving submodules..." +fi +while read path; do + TREEISH=$(git submodule | grep "^ .*${path%/} " | cut -d ' ' -f 2) # git submodule does not list trailing slashes in $path + cd "$path" + git archive --format=$FORMAT --prefix="${PREFIX}$path" ${TREEISH:-HEAD} > "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT + if [ $FORMAT == 'zip' ]; then + # delete the empty directory entry; zipped submodules won't unzip if we don't do this + zip -d "$(tail -n 1 $TMPFILE)" "${PREFIX}${path%/}" >/dev/null # remove trailing '/' + fi + echo "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT >> $TMPFILE + cd "$OLD_PWD" +done < $TOARCHIVE +if [ $VERBOSE -eq 1 ]; then + echo "done" +fi + +if [ $VERBOSE -eq 1 ]; then + echo -n "concatenating archives into single archive..." +fi +# Concatenate archives into a super-archive. +if [ $SEPARATE -eq 0 -o "-" == $OUT_FILE ]; then + if [ $FORMAT == 'tar.gz' ]; then + gunzip $superfile + superfile=${superfile:0: -3} # Remove '.gz' + sed -e '1d' $TMPFILE | while read file; do + gunzip $file + file=${file:0: -3} + $TARCMD --concatenate -f "$superfile" "$file" && rm -f "$file" + done + gzip $superfile + superfile=$superfile.gz + elif [ $FORMAT == 'tar' ]; then + sed -e '1d' $TMPFILE | while read file; do + $TARCMD --concatenate -f "$superfile" "$file" && rm -f "$file" + done + elif [ $FORMAT == 'zip' ]; then + sed -e '1d' $TMPFILE | while read file; do + # zip incorrectly stores the full path, so cd and then grow + cd `dirname "$file"` + zip -g "$superfile" `basename "$file"` && rm -f "$file" + done + cd "$OLD_PWD" + fi + + echo "$superfile" >| $TMPFILE # clobber on purpose +fi +if [ $VERBOSE -eq 1 ]; then + echo "done" +fi + +if [ $VERBOSE -eq 1 ]; then + echo -n "moving archive to $OUT_FILE..." +fi +while read file; do + if [ "-" == $OUT_FILE ]; then + cat "$file" && rm -f "$file" + else + mv "$file" "$OUT_FILE" + fi +done < $TMPFILE +if [ $VERBOSE -eq 1 ]; then + echo "done" +fi From 9aefb97075c501d15c388429940a3d4608daea2c Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 5 Oct 2015 19:19:44 +0200 Subject: [PATCH 05/41] Create origtar deterministically --- debian/genorigtar.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 debian/genorigtar.sh diff --git a/debian/genorigtar.sh b/debian/genorigtar.sh new file mode 100755 index 0000000..1918ffc --- /dev/null +++ b/debian/genorigtar.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# git-buildpackage doesn't understand submodules, and is unusable for this +# purpose. Specifically, we needed a different way of re-creating a .orig.tar.gz +# reproducibly, given only the SHA1 of the base commit. +# GitHub's functionality for that is nice, but not reproducible: +# I don't want to depend on GitHub internals, ad I don't know how they do it. +# "git-archive-all.sh" seems to fulfill all those needs, even though it is +# highly broken. But it works for now, and will be replaced in the future. + +set -e + +# Let's hope I didn't introduce any bashisms. +# TODO: This should probably be rewritten as a perl script. + +# == Check state == +DEBIAN_VERSION=`dpkg-parsechangelog --show-field=Version | sed -r s/-[0-9]+\$//` +RAW_TAG=`echo v${DEBIAN_VERSION} | sed 's/~/-/'` +echo "Debian version seems to be ${DEBIAN_VERSION}. Expecting a tag ${RAW_TAG}" +PARSED_REV=`git rev-parse "${RAW_TAG}" 2> /dev/null || true` +if [ "${RAW_TAG}" = "${PARSED_REV}" ] +then + echo "That tag doesn't exist." + exit 1 +fi +echo "Resolved to ${PARSED_REV}" + +# == Do it! == +# Cleanup (if the last run didn't already) +rm -f /tmp/telegram-purple.tar.gz /tmp/tgl.tar.gz /tmp/tgl.tl-parser.tar.gz +# Actual archiving +debian/rawtar --format tar.gz --prefix telegram-purple/ --tree-ish ${PARSED_REV} \ + -- ../telegram-purple_${DEBIAN_VERSION}.orig.tar.gz +# Remove gzip timetamp: +dd if=/dev/zero of=../telegram-purple_${DEBIAN_VERSION}.orig.tar.gz \ + bs=1 seek=4 count=4 status=none conv=notrunc +# Note that 'faketime' is somehow unreliable(?): It produces sometimes, although +# rarely, a gzip with "last modified: Thu Jan 1 00:00:01 1970", even though +# time should be frozen, even though 'LC_ALL=C faketime "2015-01-01 00:00:00"' +# should *freeze* (not shift) time. From 2fcaea9d13161279e0dedcac0c9d51435b353c0e Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Thu, 8 Oct 2015 03:32:21 +0200 Subject: [PATCH 06/41] Ignore autogenerated files --- debian/source/options | 1 + 1 file changed, 1 insertion(+) create mode 100644 debian/source/options diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..16100bc --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "(^|/)(config\.(h|log|status)|Makefile)$" From 9baf48d923936db41b4106ea268222189ddbc289 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Thu, 8 Oct 2015 13:28:23 +0200 Subject: [PATCH 07/41] Enable parallel builds --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index f09a808..c4ddba2 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,7 @@ include /usr/share/dpkg/default.mk # main packaging script based on dh7 syntax %: - dh $@ + dh $@ --parallel # dh_make generated override targets # This is example for Cmake (See https://bugs.debian.org/641051 ) From 9a43d7d98c2589a15d0e4ed8c9efe88662443cd9 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 14 Nov 2015 10:57:29 +0100 Subject: [PATCH 08/41] Fix maintainer/uploader order --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 7214af9..e2dd861 100644 --- a/debian/control +++ b/debian/control @@ -1,8 +1,8 @@ Source: telegram-purple Section: net Priority: optional -Maintainer: Hugues Morisset -Uploaders: Ben Wiederhake +Maintainer: Ben Wiederhake +Uploaders: Hugues Morisset Build-Depends: debhelper (>= 9), autotools-dev, libpurple-dev, zlib1g-dev, libgcrypt20-dev, libwebp-dev, libglib2.0-dev, pkg-config Standards-Version: 3.9.6 Homepage: https://github.com/majn/telegram-purple From a9084dd497c7c94c73bb467135bf684efd630a08 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 14 Nov 2015 11:59:34 +0100 Subject: [PATCH 09/41] Update changelog --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8fef5fb..2e17879 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +telegram-purple (1.2.2~bw2-1) UNRELEASED; urgency=medium + + * New upstream release + - Add translations + - Fix lots of bugs around secret chats (still not perfect, though) + - Fix behavior around hibernation + + -- Ben Wiederhake Sat, 14 Nov 2015 11:55:53 +0100 + telegram-purple (1.2.2~bw1-1) UNRELEASED; urgency=medium [ Hugues Morisset ] From 6edcdb8b607d2496c6970e1ea58faef043b1853c Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 14 Nov 2015 14:43:16 +0100 Subject: [PATCH 10/41] Watchfile: anchor versions correctly --- debian/changelog | 3 ++- debian/watch | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2e17879..1a4dab3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,10 @@ -telegram-purple (1.2.2~bw2-1) UNRELEASED; urgency=medium +telegram-purple (1.2.2~bw2-2) UNRELEASED; urgency=medium * New upstream release - Add translations - Fix lots of bugs around secret chats (still not perfect, though) - Fix behavior around hibernation + * Fix debian/watch -- Ben Wiederhake Sat, 14 Nov 2015 11:55:53 +0100 diff --git a/debian/watch b/debian/watch index b5bfa2d..4be4eb8 100644 --- a/debian/watch +++ b/debian/watch @@ -1,3 +1,3 @@ version=3 opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/telegram-purple_$1\.tar\.gz/,uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/ \ - https://github.com/majn/telegram-purple/tags .*/v?(\d\S*)\.tar\.gz + https://github.com/majn/telegram-purple/tags .*/archive/v?(\d\S*)\.tar\.gz From b4a88942c171bb4c5173cf0404d3e1f35ae09f76 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 28 Nov 2015 14:43:03 +0100 Subject: [PATCH 11/41] Enable hardening --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index c4ddba2..4bc601d 100755 --- a/debian/rules +++ b/debian/rules @@ -8,7 +8,7 @@ DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk # see FEATURE AREAS in dpkg-buildflags(1) -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_BUILD_MAINT_OPTIONS = hardening=+all # see ENVIRONMENT in dpkg-buildflags(1) # package maintainers to append CFLAGS From 3dad3f91e3cc40f83c056a409a2a61bc44e64171 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Thu, 3 Dec 2015 01:58:37 +0100 Subject: [PATCH 12/41] Add copyright information about portable-endian.h --- debian/copyright | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/debian/copyright b/debian/copyright index 667e7b2..cf6a010 100644 --- a/debian/copyright +++ b/debian/copyright @@ -37,6 +37,14 @@ Copyright: 2015 Matthias Jentsch 2015 Markus Endres License: GPL-2+ +Files: tgl/tl-parser/portable-endian.h +Copyright: 2013-2014 Mathias Panzenböck + 2015 PkmX +License: public-domain-pe or BSD-2-clause or BSD-3-clause or BSD-4-clause or Expat or Apache +# The licensing was meant to be "use whatever", but we have to keep it, +# verbatim. I took the freedom to interprete the term "the MIT licenses" +# as "Expat" in order to keep it reasonably small. + License: LGPL-2.1+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -107,3 +115,17 @@ License: Zlib . 3. This notice may not be removed or altered from any source distribution. + +# The following licenses are used exclusively due to "portable-endian.h" +# The mess this file causes here is justified by the mess in the code it avoids. + +License: public-domain-pe + I, Mathias Panzenböck, place this file hereby into the public domain. + Use it at your own risk for whatever you like. In case there are + jurisdictions that don't support putting things in the public domain + you can also consider it to be "dual licensed" under the BSD, MIT and + Apache licenses, if you want to. This code is trivial anyway. Consider + it an example on how to get the endian conversion functions on + different platforms. + +# Do I need to include "BSD-2-clause or BSD-3-clause or BSD-4-clause or Expat or Apache" parts? From ee3b122e5217824737bcd40c30fe3fce0b6ad618 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 30 Dec 2015 15:43:25 +0100 Subject: [PATCH 13/41] Remove lodepng's copyright info --- debian/copyright | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/debian/copyright b/debian/copyright index cf6a010..3a1a984 100644 --- a/debian/copyright +++ b/debian/copyright @@ -20,10 +20,6 @@ Copyright: 2008, 2009, 2013, 2014 Meitar Moscovitz 2012 C.D. Clark III License: GPL-3+ -Files: lodepng/* -Copyright: 2005-2014 Lode Vandevenne -License: Zlib - Files: tgl/* Copyright: 2013-2015 Vitaly Valtman 2015 Matthias Jentsch @@ -96,26 +92,6 @@ License: GPL-3+ On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". -License: Zlib - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - . - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - . - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - . - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - . - 3. This notice may not be removed or altered from any source - distribution. - # The following licenses are used exclusively due to "portable-endian.h" # The mess this file causes here is justified by the mess in the code it avoids. From f432e7f1f8447a6734d6a4a76bdf48625bfc75aa Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 30 Dec 2015 16:15:22 +0100 Subject: [PATCH 14/41] Fix issues around portable-endian.h Thanks to Ben Finney and debian-mentors for telling me a better way to solve this. --- debian/copyright | 117 +++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 61 deletions(-) diff --git a/debian/copyright b/debian/copyright index 3a1a984..08c6e0d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -36,66 +36,8 @@ License: GPL-2+ Files: tgl/tl-parser/portable-endian.h Copyright: 2013-2014 Mathias Panzenböck 2015 PkmX -License: public-domain-pe or BSD-2-clause or BSD-3-clause or BSD-4-clause or Expat or Apache -# The licensing was meant to be "use whatever", but we have to keep it, -# verbatim. I took the freedom to interprete the term "the MIT licenses" -# as "Expat" in order to keep it reasonably small. - -License: LGPL-2.1+ - This package is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU Lesser General - Public License can be found in "/usr/share/common-licenses/LGPL-2". - -License: GPL-2+ - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see - . - On Debian systems, the complete text of the GNU General - Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". - -License: GPL-3+ - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see - . - On Debian systems, the complete text of the GNU General - Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". - -# The following licenses are used exclusively due to "portable-endian.h" -# The mess this file causes here is justified by the mess in the code it avoids. - -License: public-domain-pe +License: BSD-3-clause or Expat or Apache-2 +License-Grant: I, Mathias Panzenböck, place this file hereby into the public domain. Use it at your own risk for whatever you like. In case there are jurisdictions that don't support putting things in the public domain @@ -103,5 +45,58 @@ License: public-domain-pe Apache licenses, if you want to. This code is trivial anyway. Consider it an example on how to get the endian conversion functions on different platforms. +FIXME: + This is a tag for the sole purpose and hope that one day, someone + searches for "Fixme" (possibly case-sensitive). Thus, the issue in the + following "Comment" field can be found in both the Debian archive and + the original project. +Comment: + This is a comment from the person who wrote this debian/copyright file. + . + The licensing was obviously meant to be "use whatever". However, we + have to mirror it precisely, and verbatim. I took the freedom to + interprete the terms "the MIT licenses" as "Expat"; "the BSD licenses" + as BSD 3-clause; and "the Apache licenses" as Apache 2.0. I do this + in order to keep the list reasonably small and close enough. However, + someone who understands the legal implications should take a close + look at this. -# Do I need to include "BSD-2-clause or BSD-3-clause or BSD-4-clause or Expat or Apache" parts? +License: LGPL-2.1+ + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in "/usr/share/common-licenses/LGPL-2.1". + +License: GPL-2+ + On Debian systems, the complete text of the GNU General Public License + version 2 can be found in "/usr/share/common-licenses/GPL-2". + +License: GPL-3+ + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + +License: BSD-3-clause + On Debian systems, the complete text of the Revised BSD License + (3-clause) can be found in "/usr/share/common-licenses/GPL-3". + +License: Apache-2 + On Debian systems, the complete text of version 2.0 of the Apache License + can be found in ‘/usr/share/common-licenses/Apache-2.0’. + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From f849ddd18a9c9ab71fd6f9d3ad6a2c452437ac25 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 30 Dec 2015 16:46:50 +0100 Subject: [PATCH 15/41] Update debian/changelog --- debian/changelog | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1a4dab3..b0542e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,14 +1,15 @@ -telegram-purple (1.2.2~bw2-2) UNRELEASED; urgency=medium +telegram-purple (1.2.3-1) UNRELEASED; urgency=medium * New upstream release - - Add translations + - Add translations and plural support - Fix lots of bugs around secret chats (still not perfect, though) - Fix behavior around hibernation - * Fix debian/watch + - Fix display errors and false warnings + * Fix debian/{watch, copyright} - -- Ben Wiederhake Sat, 14 Nov 2015 11:55:53 +0100 + -- Ben Wiederhake Wed, 30 Dec 2015 16:38:02 +0100 -telegram-purple (1.2.2~bw1-1) UNRELEASED; urgency=medium +telegram-purple (1.2.2~bw1-1) mentors; urgency=medium [ Hugues Morisset ] * Initial Release (Closes: #800771) From cc9850172505f90138cf15db7bc3d48c1ba10c88 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 30 Dec 2015 17:19:43 +0100 Subject: [PATCH 16/41] Include the metadata file --- debian/copyright | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/copyright b/debian/copyright index 08c6e0d..9e2be3f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -9,6 +9,12 @@ Copyright: 2014-2015 Matthias Jentsch 2014 Markus Endres License: GPL-2+ +Files: telegram-purple.metainfo.xml +Copyright: 2015 Jiri Eischmann +License: GFDL-NIV +License-Grant: + GFDL-1.3 + Files: debian/* Copyright: 2015 Hugues Morisset 2015 Ben Wiederhake @@ -81,6 +87,10 @@ License: Apache-2 On Debian systems, the complete text of version 2.0 of the Apache License can be found in ‘/usr/share/common-licenses/Apache-2.0’. +License: GFDL-NIV + On Debian systems, the complete text of version 1.3 of the GNU Free + Document License ‘/usr/share/common-licenses/GFDL-1.3’. + License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the From ee5fa687783861b107f842012ff5914a1749cfd2 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 30 Dec 2015 17:25:52 +0100 Subject: [PATCH 17/41] Run w-a-s -as Remember to use wrap-and-sort with the option -as in future. --- debian/control | 21 ++++++++++++++++----- debian/copyright | 4 ++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/debian/control b/debian/control index e2dd861..3780442 100644 --- a/debian/control +++ b/debian/control @@ -2,17 +2,28 @@ Source: telegram-purple Section: net Priority: optional Maintainer: Ben Wiederhake -Uploaders: Hugues Morisset -Build-Depends: debhelper (>= 9), autotools-dev, libpurple-dev, zlib1g-dev, libgcrypt20-dev, libwebp-dev, libglib2.0-dev, pkg-config +Uploaders: + Hugues Morisset +Build-Depends: + autotools-dev, + debhelper (>= 9), + libgcrypt20-dev, + libglib2.0-dev, + libpurple-dev, + libwebp-dev, + pkg-config, + zlib1g-dev Standards-Version: 3.9.6 Homepage: https://github.com/majn/telegram-purple Vcs-Git: https://github.com/majn/telegram-purple.git -#Vcs-Browser: https://anonscm.debian.org/gitweb/?p=collab-maint/telegram-purple.git;a=summary Package: telegram-purple Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Suggests: pidgin | finch +Depends: + ${misc:Depends}, + ${shlibs:Depends} +Suggests: + pidgin | finch Description: Purple plugin to support Telegram Plugin for purple which lets you use and manage your Telegram account like any other account in purple. Some features like self-destruct diff --git a/debian/copyright b/debian/copyright index 9e2be3f..7426ccb 100644 --- a/debian/copyright +++ b/debian/copyright @@ -80,7 +80,7 @@ License: GPL-3+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". License: BSD-3-clause - On Debian systems, the complete text of the Revised BSD License + On Debian systems, the complete text of the Revised BSD License (3-clause) can be found in "/usr/share/common-licenses/GPL-3". License: Apache-2 @@ -88,7 +88,7 @@ License: Apache-2 can be found in ‘/usr/share/common-licenses/Apache-2.0’. License: GFDL-NIV - On Debian systems, the complete text of version 1.3 of the GNU Free + On Debian systems, the complete text of version 1.3 of the GNU Free Document License ‘/usr/share/common-licenses/GFDL-1.3’. License: Expat From 12fe25086a5d2a3d86fc8125c84e4fba224cc0a7 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 30 Dec 2015 20:43:14 +0100 Subject: [PATCH 18/41] Override dh_auto_clean It attempts to call 'make distclean', which appears to be a sane default. However, telegram-purple does not have a concept of distclean, and we're unwilling to introduce one only for Debian. So just go for the target 'clean' instead, which currently does to right thing, which is: remove *everything* that can be regenerated during build. --- debian/rules | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 4bc601d..ab60122 100755 --- a/debian/rules +++ b/debian/rules @@ -16,7 +16,6 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all # package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed - # main packaging script based on dh7 syntax %: dh $@ --parallel @@ -26,3 +25,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all #override_dh_auto_configure: # dh_auto_configure -- \ # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + +# dh_auto_clean tries to "make distclean", but we don't have that target. +override_dh_auto_clean: + test ! -e Makefile || $(MAKE) clean From b8eadf92d5ac7ec7f565d4207a15c7fca06e9f58 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Thu, 31 Dec 2015 21:53:28 +0100 Subject: [PATCH 19/41] Fix typo in d/copyright --- debian/copyright | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/copyright b/debian/copyright index 7426ccb..34f82a3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -39,7 +39,7 @@ Copyright: 2015 Matthias Jentsch 2015 Markus Endres License: GPL-2+ -Files: tgl/tl-parser/portable-endian.h +Files: tgl/tl-parser/portable_endian.h Copyright: 2013-2014 Mathias Panzenböck 2015 PkmX License: BSD-3-clause or Expat or Apache-2 From 17001c910de83fcb1323b9d678d5171b967d4023 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 3 Jan 2016 15:07:53 +0100 Subject: [PATCH 20/41] Fix changelog, control, rules Added rationales for the choice of the URL in Vcs-Git and the package name. --- debian/changelog | 19 +++++++------------ debian/control | 13 ++++++++++++- debian/rules | 17 +---------------- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/debian/changelog b/debian/changelog index b0542e9..0a7e41a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,16 +1,5 @@ telegram-purple (1.2.3-1) UNRELEASED; urgency=medium - * New upstream release - - Add translations and plural support - - Fix lots of bugs around secret chats (still not perfect, though) - - Fix behavior around hibernation - - Fix display errors and false warnings - * Fix debian/{watch, copyright} - - -- Ben Wiederhake Wed, 30 Dec 2015 16:38:02 +0100 - -telegram-purple (1.2.2~bw1-1) mentors; urgency=medium - [ Hugues Morisset ] * Initial Release (Closes: #800771) @@ -19,5 +8,11 @@ telegram-purple (1.2.2~bw1-1) mentors; urgency=medium /etc/telegram-purple/server.pub is obsolete for this version. It is only tolerated to allow for smooth transition from old, manual installations, and will be removed in future versions. + * New upstream release + - Add translations and plural support + - Fix lots of bugs around secret chats (still not perfect, though) + - Fix behavior around hibernation + - Fix display errors and false warnings + * Fix debian/{watch, copyright} - -- Hugues Morisset Tue, 13 Oct 2015 14:12:44 +0200 + -- Ben Wiederhake Wed, 30 Dec 2015 16:38:02 +0100 diff --git a/debian/control b/debian/control index 3780442..b01a8a0 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,8 @@ Build-Depends: zlib1g-dev Standards-Version: 3.9.6 Homepage: https://github.com/majn/telegram-purple -Vcs-Git: https://github.com/majn/telegram-purple.git +Vcs-Git: https://github.com/BenWiederhake/telegram-purple +Vcs-Browser: https://github.com/BenWiederhake/telegram-purple/tree/debian-develop Package: telegram-purple Architecture: any @@ -28,3 +29,13 @@ Description: Purple plugin to support Telegram Plugin for purple which lets you use and manage your Telegram account like any other account in purple. Some features like self-destruct messages are currently in development. +Comment: Traditionally, this plugin should be named "telegram-pidgin". + However, this plugin is also designed to work with at least Adium, + Finch, and hopefully all other libpurple-frontends, so this name would + be highly misleading. Furthermore, the plugin refers to itself as + "telegram-purple", and changing this (e.g. via a patch) would be highly + non-trivial and fragile. Finally, several users know this plugin under + the name telegram-purple only, so naming the Debian package differently + would be another source of confusion. Thus we intentionally break with + this tradition, and re-used the name telegram-purple from the original + project. diff --git a/debian/rules b/debian/rules index ab60122..979ebb3 100755 --- a/debian/rules +++ b/debian/rules @@ -1,31 +1,16 @@ #!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) + # output every command that modifies files on the build system. #export 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 $@ --parallel -# dh_make generated override targets -# This is example for Cmake (See https://bugs.debian.org/641051 ) -#override_dh_auto_configure: -# dh_auto_configure -- \ -# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) - # dh_auto_clean tries to "make distclean", but we don't have that target. override_dh_auto_clean: test ! -e Makefile || $(MAKE) clean From b4253a2419f88baa87fc41059647bfdd75ff37a5 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 3 Jan 2016 15:10:01 +0100 Subject: [PATCH 21/41] Explain how to adapt and upgrade --- debian/README.source | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 debian/README.source diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..27caac1 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,61 @@ +This file explains how to do the following steps, as per Policy §4.14: + + +1. Generate the fully patched source, in a form ready for editing, that + would be built to create Debian packages. + +This step does not need any special attention. The standard invocation +of "dpkg-source -x" does exactly what is needed. + +2. Modify the source and save those modifications so that they will be + applied when building the package. + == AND == +3. Remove source modifications that are currently being applied when +building the package. + +There is no standard procedure for this package. Please note that: +- quilt seems to be the default tool for this kind of work. +- git-buildpackage (gbp) might not work as expected, so I refrained + from trying it for this task. See below. + +So far, issues reported against the project have been resolved quickly +enough to avoid scenarios that usually need the d/patches/ directory. + +4. Generate a *.orig.tar.gz from the git repository, e.g., upgrade the + Debian source package to a new upstream version. + + ~$ git clone --recursive --branch debian-master \ + https://github.com/majn/telegram-purple.git + ~& cd telegram-purple + ~/telegram-purple$ debian/genorigtar.sh + +The output should look like this: + + Debian version seems to be 1.2.3. Expecting a tag v1.2.3 + Resolved to ffca726ca1cd22f87a48ca3fe042802302e82837 + +Note that the script builds on the following assumptions that are *not* +verified: +- d/changelog is in a current state +- d/changelog refers to an existing version tag known by the local git + repository +- there have been no modifications in the tgl/ folder, and most + importantly: the debian-* branch didn't change the submodule commit + +The last item can be considered a bug, which is why I don't recommend +anyone to use out genorigtar.sh script for other projects. + +The following approaches do NOT work: +- githubs "download source tar", as this leaves out submodules. +- git-buildpackage (gpb). No support for submodules-within-submodules. + +The file README.md of the project contains some hints about how to +build packages, so here's a cheat sheet: +- Just build a *.deb, ideal for local use: + fakeroot ./debian/rules binary +- Build the package for analysis, e.g. lintian: + dpkg-buildpackage +- Only produce a *.dsc and *.debian.tar.xz file: + ( cd .. && dpkg-source -b telegram-purple ) +- Run pbuilder (needs the previous step): + ( cd .. && sudo pbuilder --build telegram-purple_*.dsc ) From 6865a5e3708b1f3ef3b5312c404beea8a44148b1 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 3 Jan 2016 19:39:46 +0100 Subject: [PATCH 22/41] Add further notes about the packaging decisions --- debian/README.source | 71 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/debian/README.source b/debian/README.source index 27caac1..c233f58 100644 --- a/debian/README.source +++ b/debian/README.source @@ -1,5 +1,5 @@ -This file explains how to do the following steps, as per Policy §4.14: - +Packing, unpacking, and modifying (as per §4.14) +================================================ 1. Generate the fully patched source, in a form ready for editing, that would be built to create Debian packages. @@ -59,3 +59,70 @@ build packages, so here's a cheat sheet: ( cd .. && dpkg-source -b telegram-purple ) - Run pbuilder (needs the previous step): ( cd .. && sudo pbuilder --build telegram-purple_*.dsc ) + + + +Package name +============ + +At the time of writing (2016-01-03), the Debian repository contained +the following libpurple-backends: +- pidgin-encryption +- pidgin-latex +- pidgin-otr +- pidgin-plugin-pack +- pidgin-privacy-please +So following that tradition, this package would be called "pidgin-telegram". + +However, this would have a lot of disadvantages: +- This is a frontend-agnostic backend that works with Adium, pidgin, + and Finch. We hope that it works nicely with all other frontends. + Calling it "pidgin-something" would be highly misleading. +- All error messages and their translations would need to be adapted +- paths would need to change that aren't configurable +- some users are expecting the name to be "telegram-purple" + (at least initially) + +Overall, we consider this a needlessly confusing convention, and +intentionally break with it. + + + +Packaging libtgl separately (as per §4.13) +========================================== + +No. + +So far, ABI-compatibility was broken between virtually every other +commit to libtgl, and the library is still under development. The +latest "stable" release is heavily outdated and can no longer be used +productively (missing features, known bugs, etc.), so if we were to +package tgl we would need to repackage it constantly, with no defined +concept version, soname, or anything reliable. No other program +(*including* tg-cli) can be expected to use the same version of libtgl +as telegram-purple does. (This might happen every now and then, but +that would be random chance. Finally, it's highly unlikely that someone +installs and uses both telegram-purple and tg-cli.) + +Packaging "tl-parser" or the intermediate "generate" program is also a +bad idea: One *could* do that, but it's only useful for libtgl. So +there is a significant lack of users. + +Note that tl-parser is a relatively (in comparison to the rest of +libtgl) stable, portable application (not library). The output format +hasn't changed in a over a year. If you believe that these six files +will be used by a lot of people, I'll be happy to package tl-parser for +you. However, please note that this would require at least two +packages: tl-parser (binary), tl-parser-dev (headers), and possibly +libtl-parser (common object files). + +In short: there's no set of component that could be packaged in a more +clever way. + + + +About this document +=================== + +This not written in Markdown. All formatting is in the hope of making +it easy to read. From ac1763c596bc7c645648d665a8924f87412f9a0e Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 3 Jan 2016 20:28:39 +0100 Subject: [PATCH 23/41] fixup! Explain how to adapt and upgrade --- debian/README.source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/README.source b/debian/README.source index c233f58..f1e6f3a 100644 --- a/debian/README.source +++ b/debian/README.source @@ -46,7 +46,7 @@ The last item can be considered a bug, which is why I don't recommend anyone to use out genorigtar.sh script for other projects. The following approaches do NOT work: -- githubs "download source tar", as this leaves out submodules. +- Github's "download source tar", as this leaves out submodules. - git-buildpackage (gpb). No support for submodules-within-submodules. The file README.md of the project contains some hints about how to From a6afa1867fa6e56f7f0c1b7fc148c2f9aa4ee0de Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Tue, 5 Jan 2016 15:14:04 +0100 Subject: [PATCH 24/41] Fix changelog and control --- debian/changelog | 4 ++-- debian/control | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0a7e41a..aa76348 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -telegram-purple (1.2.3-1) UNRELEASED; urgency=medium +telegram-purple (1.2.4-1) UNRELEASED; urgency=medium [ Hugues Morisset ] * Initial Release (Closes: #800771) @@ -13,6 +13,6 @@ telegram-purple (1.2.3-1) UNRELEASED; urgency=medium - Fix lots of bugs around secret chats (still not perfect, though) - Fix behavior around hibernation - Fix display errors and false warnings - * Fix debian/{watch, copyright} + - Fix crash on 'unsupported' media -- Ben Wiederhake Wed, 30 Dec 2015 16:38:02 +0100 diff --git a/debian/control b/debian/control index b01a8a0..c6df3d7 100644 --- a/debian/control +++ b/debian/control @@ -29,7 +29,7 @@ Description: Purple plugin to support Telegram Plugin for purple which lets you use and manage your Telegram account like any other account in purple. Some features like self-destruct messages are currently in development. -Comment: Traditionally, this plugin should be named "telegram-pidgin". +X-Comment: Traditionally, this plugin should be named "telegram-pidgin". However, this plugin is also designed to work with at least Adium, Finch, and hopefully all other libpurple-frontends, so this name would be highly misleading. Furthermore, the plugin refers to itself as From 64354d6305bc47c035c8e5ee273f675cf469b13c Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Tue, 5 Jan 2016 17:04:40 +0100 Subject: [PATCH 25/41] Add d/upstream/metadata --- debian/upstream/metadata | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 debian/upstream/metadata diff --git a/debian/upstream/metadata b/debian/upstream/metadata new file mode 100644 index 0000000..6ccc46c --- /dev/null +++ b/debian/upstream/metadata @@ -0,0 +1,21 @@ +Bug-Database: https://github.com/majn/telegram-purple/issues/ +Bug-Submit: https://github.com/majn/telegram-purple/issues/new +#Cite-As: telegram-purple +## Intentionally left out, to make sure that we don't accidentally break someone's +## workflow. We err on the side of not prescribing anyone how to cite this work. +#Changelog: https://github.com/majn/telegram-purple/blob/master/CHANGELOG.md +## Intentionally left out as it's currently pretty outdated. +Contact: https://telegram.me/joinchat/01fb53f301b67d3c7a5532908dfa9a89 +## The development chat group. +#Donation: See 'Contact' +#FAQ: https://github.com/majn/telegram-purple/#faq +## No real content yet. +Name: telegram-purple +## Might be superfluous, but I want to confirm that the upstream name is +## indeed telegram-purple, hence the package name in Debian. +Repository: https://github.com/majn/telegram-purple/ +Repository-Browse: https://github.com/majn/telegram-purple/ +Security-Contact: + Main developer: Matthias Jentch + Debian packager: Ben Wiederhake + Development channel (public): https://goo.gl/bhmM7N From 924e59b91fe1d4bbacd66196fc7f87279630a663 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Tue, 5 Jan 2016 17:05:58 +0100 Subject: [PATCH 26/41] Bump version --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index aa76348..507cea9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -telegram-purple (1.2.4-1) UNRELEASED; urgency=medium +telegram-purple (1.2.4-2) UNRELEASED; urgency=medium [ Hugues Morisset ] * Initial Release (Closes: #800771) From 15570de448c4b25c31c126a8de3eb1981fe3b191 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 13 Jan 2016 22:24:39 +0100 Subject: [PATCH 27/41] Clean up d/rules --- debian/control | 1 + debian/rules | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index c6df3d7..68f4baa 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Uploaders: Build-Depends: autotools-dev, debhelper (>= 9), + dh-autoreconf, libgcrypt20-dev, libglib2.0-dev, libpurple-dev, diff --git a/debian/rules b/debian/rules index 979ebb3..ea63032 100755 --- a/debian/rules +++ b/debian/rules @@ -1,15 +1,12 @@ #!/usr/bin/make -f -# output every command that modifies files on the build system. -#export DH_VERBOSE = 1 - DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: - dh $@ --parallel + dh $@ --parallel --with autoreconf # dh_auto_clean tries to "make distclean", but we don't have that target. override_dh_auto_clean: From 7968ca4007c6b70158c089f53a7d118cddbfbbae Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Fri, 19 Feb 2016 14:57:43 +0100 Subject: [PATCH 28/41] Rewrite d/watch, update d/rules to include get-orig-source --- debian/rules | 10 ++++++++++ debian/watch | 19 ++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/debian/rules b/debian/rules index ea63032..8f159df 100755 --- a/debian/rules +++ b/debian/rules @@ -11,3 +11,13 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all # dh_auto_clean tries to "make distclean", but we don't have that target. override_dh_auto_clean: test ! -e Makefile || $(MAKE) clean + +## http://wiki.debian.org/onlyjob/get-orig-source +PKD := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +PKG := $(shell dpkg-parsechangelog -l$(PKD)/changelog --show-field=Source) +VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog --show-field=Version | cut -d- -f1) +.PHONY: get-orig-source +get-orig-source: $(info I: $(PKG)_$(VER)) + @echo "# Downloading for ${PKD}" + uscan --noconf --verbose --rename --destdir=$(CURDIR) \ + --check-dirname-level=0 --force-download --download-version "$(VER)" $(PKD) diff --git a/debian/watch b/debian/watch index 4be4eb8..b53aef8 100644 --- a/debian/watch +++ b/debian/watch @@ -1,3 +1,16 @@ -version=3 -opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/telegram-purple_$1\.tar\.gz/,uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/ \ - https://github.com/majn/telegram-purple/tags .*/archive/v?(\d\S*)\.tar\.gz +version=4 +opts="\ + downloadurlmangle=s/tag\/v(.*)$/download\/v$1\/telegram-purple_$1.orig.tar.gz/,\ + uversionmangle=s/-(beta\d*)$/~$1/,\ + " \ + https://github.com/majn/telegram-purple/releases \ + /tag/v([\d\.]*(?:-beta\d*)?) \ + debian \ + uupdate + +# Rationales (from bottom up): +# - There will always be tags of the style "v1.2.5", so search for that +# - The "beta" group must be non-capturing, otherwise uscan tries to concatenate them (e.g. "1.2.3-beta.-beta") +# - Github tars are unusable; use the (hopefully attached) origtar +# - Beta-releases should be ordered before the "main" release (was never relevant so far) +# - Spacing in order to have exactly one rule per line From 7b31bee4e6ad17df7b467b62bd068e1dba9fd7f2 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Tue, 2 Aug 2016 02:17:34 +0200 Subject: [PATCH 29/41] Clean up obsolete Debianizations --- debian/changelog | 2 +- debian/control | 2 +- debian/copyright | 12 +- debian/docs | 1 - debian/genorigtar.sh | 40 ------ debian/rawtar | 308 ------------------------------------------- 6 files changed, 3 insertions(+), 362 deletions(-) delete mode 100755 debian/genorigtar.sh delete mode 100755 debian/rawtar diff --git a/debian/changelog b/debian/changelog index 507cea9..aa76348 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -telegram-purple (1.2.4-2) UNRELEASED; urgency=medium +telegram-purple (1.2.4-1) UNRELEASED; urgency=medium [ Hugues Morisset ] * Initial Release (Closes: #800771) diff --git a/debian/control b/debian/control index 68f4baa..a8da6e3 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Build-Depends: libwebp-dev, pkg-config, zlib1g-dev -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: https://github.com/majn/telegram-purple Vcs-Git: https://github.com/BenWiederhake/telegram-purple Vcs-Browser: https://github.com/BenWiederhake/telegram-purple/tree/debian-develop diff --git a/debian/copyright b/debian/copyright index 34f82a3..0ca6da4 100644 --- a/debian/copyright +++ b/debian/copyright @@ -9,7 +9,7 @@ Copyright: 2014-2015 Matthias Jentsch 2014 Markus Endres License: GPL-2+ -Files: telegram-purple.metainfo.xml +Files: AppStream/telegram-purple.metainfo.untranslated.xml Copyright: 2015 Jiri Eischmann License: GFDL-NIV License-Grant: @@ -20,12 +20,6 @@ Copyright: 2015 Hugues Morisset 2015 Ben Wiederhake License: GPL-2+ -Files: debian/rawtar -Copyright: 2008, 2009, 2013, 2014 Meitar Moscovitz - 2011, 2013 Marius Ghita - 2012 C.D. Clark III -License: GPL-3+ - Files: tgl/* Copyright: 2013-2015 Vitaly Valtman 2015 Matthias Jentsch @@ -75,10 +69,6 @@ License: GPL-2+ On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". -License: GPL-3+ - On Debian systems, the complete text of the GNU General - Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". - License: BSD-3-clause On Debian systems, the complete text of the Revised BSD License (3-clause) can be found in "/usr/share/common-licenses/GPL-3". diff --git a/debian/docs b/debian/docs index 0b6e0f3..62deb04 100644 --- a/debian/docs +++ b/debian/docs @@ -1,2 +1 @@ AUTHORS -README.md diff --git a/debian/genorigtar.sh b/debian/genorigtar.sh deleted file mode 100755 index 1918ffc..0000000 --- a/debian/genorigtar.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# git-buildpackage doesn't understand submodules, and is unusable for this -# purpose. Specifically, we needed a different way of re-creating a .orig.tar.gz -# reproducibly, given only the SHA1 of the base commit. -# GitHub's functionality for that is nice, but not reproducible: -# I don't want to depend on GitHub internals, ad I don't know how they do it. -# "git-archive-all.sh" seems to fulfill all those needs, even though it is -# highly broken. But it works for now, and will be replaced in the future. - -set -e - -# Let's hope I didn't introduce any bashisms. -# TODO: This should probably be rewritten as a perl script. - -# == Check state == -DEBIAN_VERSION=`dpkg-parsechangelog --show-field=Version | sed -r s/-[0-9]+\$//` -RAW_TAG=`echo v${DEBIAN_VERSION} | sed 's/~/-/'` -echo "Debian version seems to be ${DEBIAN_VERSION}. Expecting a tag ${RAW_TAG}" -PARSED_REV=`git rev-parse "${RAW_TAG}" 2> /dev/null || true` -if [ "${RAW_TAG}" = "${PARSED_REV}" ] -then - echo "That tag doesn't exist." - exit 1 -fi -echo "Resolved to ${PARSED_REV}" - -# == Do it! == -# Cleanup (if the last run didn't already) -rm -f /tmp/telegram-purple.tar.gz /tmp/tgl.tar.gz /tmp/tgl.tl-parser.tar.gz -# Actual archiving -debian/rawtar --format tar.gz --prefix telegram-purple/ --tree-ish ${PARSED_REV} \ - -- ../telegram-purple_${DEBIAN_VERSION}.orig.tar.gz -# Remove gzip timetamp: -dd if=/dev/zero of=../telegram-purple_${DEBIAN_VERSION}.orig.tar.gz \ - bs=1 seek=4 count=4 status=none conv=notrunc -# Note that 'faketime' is somehow unreliable(?): It produces sometimes, although -# rarely, a gzip with "last modified: Thu Jan 1 00:00:01 1970", even though -# time should be frozen, even though 'LC_ALL=C faketime "2015-01-01 00:00:00"' -# should *freeze* (not shift) time. diff --git a/debian/rawtar b/debian/rawtar deleted file mode 100755 index 5daaf52..0000000 --- a/debian/rawtar +++ /dev/null @@ -1,308 +0,0 @@ -#!/bin/bash - - -# Found on https://github.com/meitar/git-archive-all.sh -# Version: cd7302ea7c8973f7fc360ae1a77e3b4a28a6eeb7 -# Copyright Meitar Moscovitz 2008, 2009, 2013, 2014 -# Marius Ghita 2011, 2013 -# C.D. Clark III 2012 -# -# File: git-archive-all.sh -# -# Description: A utility script that builds an archive file(s) of all -# git repositories and submodules in the current path. -# Useful for creating a single tarfile of a git super- -# project that contains other submodules. -# -# Examples: Use git-archive-all.sh to create archive distributions -# from git repositories. To use, simply do: -# -# cd $GIT_DIR; git-archive-all.sh -# -# where $GIT_DIR is the root of your git superproject. -# -# License: GPL3+ -# -############################################################################### -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -############################################################################### - -# DEBUGGING -set -e -set -C # noclobber - -# TRAP SIGNALS -trap 'cleanup' QUIT EXIT - -# For security reasons, explicitly set the internal field separator -# to newline, space, tab -OLD_IFS=$IFS -IFS=' - ' - -function cleanup () { - rm -f $TMPFILE - rm -f $TOARCHIVE - IFS="$OLD_IFS" -} - -function usage () { - echo "Usage is as follows:" - echo - echo "$PROGRAM <--version>" - echo " Prints the program version number on a line by itself and exits." - echo - echo "$PROGRAM <--usage|--help|-?>" - echo " Prints this usage output and exits." - echo - echo "$PROGRAM [--format ] [--prefix ] [--verbose|-v] [--separate|-s]" - echo " [--tree-ish|-t ] [output_file]" - echo " Creates an archive for the entire git superproject, and its submodules" - echo " using the passed parameters, described below." - echo - echo " If '--format' is specified, the archive is created with the named" - echo " git archiver backend. Obviously, this must be a backend that git archive" - echo " understands. The format defaults to 'tar' if not specified." - echo - echo " If '--prefix' is specified, the archive's superproject and all submodules" - echo " are created with the prefix named. The default is to not use one." - echo - echo " If '--separate' or '-s' is specified, individual archives will be created" - echo " for each of the superproject itself and its submodules. The default is to" - echo " concatenate individual archives into one larger archive." - echo - echo " If '--tree-ish' is specified, the archive will be created based on whatever" - echo " you define the tree-ish to be. Branch names, commit hash, etc. are acceptable." - echo " Defaults to HEAD if not specified. See git archive's documentation for more" - echo " information on what a tree-ish is." - echo - echo " If 'output_file' is specified, the resulting archive is created as the" - echo " file named. This parameter is essentially a path that must be writeable." - echo " When combined with '--separate' ('-s') this path must refer to a directory." - echo " Without this parameter or when combined with '--separate' the resulting" - echo " archive(s) are named with a dot-separated path of the archived directory and" - echo " a file extension equal to their format (e.g., 'superdir.submodule1dir.tar')." - echo - echo " The special value '-' (single dash) is treated as STDOUT and, when used, the" - echo " --separate option is ignored. Use a double-dash to separate the outfile from" - echo " the value of previous options. For example, to write a .zip file to STDOUT:" - echo - echo " ./$PROGRAM --format zip -- -" - echo - echo " If '--verbose' or '-v' is specified, progress will be printed." -} - -function version () { - echo "$PROGRAM version $VERSION" -} - -# Internal variables and initializations. -readonly PROGRAM=`basename "$0"` -readonly VERSION=0.3 - -SEPARATE=0 -VERBOSE=0 - -TARCMD=`command -v gnutar || command -v tar` -FORMAT=tar -PREFIX= -TREEISH=HEAD - -# RETURN VALUES/EXIT STATUS CODES -readonly E_BAD_OPTION=254 -readonly E_UNKNOWN=255 - -# Process command-line arguments. -while test $# -gt 0; do - if [ x"$1" == x"--" ]; then - # detect argument termination - shift - break - fi - case $1 in - --format ) - shift - FORMAT="$1" - shift - ;; - - --prefix ) - shift - PREFIX="$1" - shift - ;; - - --separate | -s ) - shift - SEPARATE=1 - ;; - - --tree-ish | -t ) - shift - TREEISH="$1" - shift - ;; - - --version ) - version - exit - ;; - - --verbose | -v ) - shift - VERBOSE=1 - ;; - - -? | --usage | --help ) - usage - exit - ;; - - -* ) - echo "Unrecognized option: $1" >&2 - usage - exit $E_BAD_OPTION - ;; - - * ) - break - ;; - esac -done - -OLD_PWD="`pwd`" -TMPDIR=${TMPDIR:-/tmp} -TMPFILE=`mktemp "$TMPDIR/$PROGRAM.XXXXXX"` # Create a place to store our work's progress -TOARCHIVE=`mktemp "$TMPDIR/$PROGRAM.toarchive.XXXXXX"` -OUT_FILE=$OLD_PWD # assume "this directory" without a name change by default - -if [ ! -z "$1" ]; then - OUT_FILE="$1" - if [ "-" == $OUT_FILE ]; then - SEPARATE=0 - fi - shift -fi - -# Validate parameters; error early, error often. -if [ "-" == $OUT_FILE -o $SEPARATE -ne 1 ] && [ "$FORMAT" == "tar" -a `$TARCMD --help | grep -q -- "--concatenate"; echo $?` -ne 0 ]; then - echo "Your 'tar' does not support the '--concatenate' option, which we need" - echo "to produce a single tarfile. Either install a compatible tar (such as" - echo "gnutar), or invoke $PROGRAM with the '--separate' option." - exit -elif [ $SEPARATE -eq 1 -a ! -d $OUT_FILE ]; then - echo "When creating multiple archives, your destination must be a directory." - echo "If it's not, you risk being surprised when your files are overwritten." - exit -elif [ `git config -l | grep -q '^core\.bare=false'; echo $?` -ne 0 ]; then - echo "$PROGRAM must be run from a git working copy (i.e., not a bare repository)." - exit -fi - -# Create the superproject's git-archive -if [ $VERBOSE -eq 1 ]; then - echo -n "creating superproject archive..." -fi -git archive --format=$FORMAT --prefix="$PREFIX" $TREEISH > $TMPDIR/$(basename "$(pwd)").$FORMAT -if [ $VERBOSE -eq 1 ]; then - echo "done" -fi -echo $TMPDIR/$(basename "$(pwd)").$FORMAT >| $TMPFILE # clobber on purpose -superfile=`head -n 1 $TMPFILE` - -if [ $VERBOSE -eq 1 ]; then - echo -n "looking for subprojects..." -fi -# find all '.git' dirs, these show us the remaining to-be-archived dirs -# we only want directories that are below the current directory -find . -mindepth 2 -name '.git' -type d -print | sed -e 's/^\.\///' -e 's/\.git$//' >> $TOARCHIVE -# as of version 1.7.8, git places the submodule .git directories under the superprojects .git dir -# the submodules get a .git file that points to their .git dir. we need to find all of these too -find . -mindepth 2 -name '.git' -type f -print | xargs grep -l "gitdir" | sed -e 's/^\.\///' -e 's/\.git$//' >> $TOARCHIVE -if [ $VERBOSE -eq 1 ]; then - echo "done" - echo " found:" - cat $TOARCHIVE | while read arch - do - echo " $arch" - done -fi - -if [ $VERBOSE -eq 1 ]; then - echo -n "archiving submodules..." -fi -while read path; do - TREEISH=$(git submodule | grep "^ .*${path%/} " | cut -d ' ' -f 2) # git submodule does not list trailing slashes in $path - cd "$path" - git archive --format=$FORMAT --prefix="${PREFIX}$path" ${TREEISH:-HEAD} > "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT - if [ $FORMAT == 'zip' ]; then - # delete the empty directory entry; zipped submodules won't unzip if we don't do this - zip -d "$(tail -n 1 $TMPFILE)" "${PREFIX}${path%/}" >/dev/null # remove trailing '/' - fi - echo "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT >> $TMPFILE - cd "$OLD_PWD" -done < $TOARCHIVE -if [ $VERBOSE -eq 1 ]; then - echo "done" -fi - -if [ $VERBOSE -eq 1 ]; then - echo -n "concatenating archives into single archive..." -fi -# Concatenate archives into a super-archive. -if [ $SEPARATE -eq 0 -o "-" == $OUT_FILE ]; then - if [ $FORMAT == 'tar.gz' ]; then - gunzip $superfile - superfile=${superfile:0: -3} # Remove '.gz' - sed -e '1d' $TMPFILE | while read file; do - gunzip $file - file=${file:0: -3} - $TARCMD --concatenate -f "$superfile" "$file" && rm -f "$file" - done - gzip $superfile - superfile=$superfile.gz - elif [ $FORMAT == 'tar' ]; then - sed -e '1d' $TMPFILE | while read file; do - $TARCMD --concatenate -f "$superfile" "$file" && rm -f "$file" - done - elif [ $FORMAT == 'zip' ]; then - sed -e '1d' $TMPFILE | while read file; do - # zip incorrectly stores the full path, so cd and then grow - cd `dirname "$file"` - zip -g "$superfile" `basename "$file"` && rm -f "$file" - done - cd "$OLD_PWD" - fi - - echo "$superfile" >| $TMPFILE # clobber on purpose -fi -if [ $VERBOSE -eq 1 ]; then - echo "done" -fi - -if [ $VERBOSE -eq 1 ]; then - echo -n "moving archive to $OUT_FILE..." -fi -while read file; do - if [ "-" == $OUT_FILE ]; then - cat "$file" && rm -f "$file" - else - mv "$file" "$OUT_FILE" - fi -done < $TMPFILE -if [ $VERBOSE -eq 1 ]; then - echo "done" -fi From 81f2a5117f71a63d8fd31e07f6d65a1fd9594d57 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Tue, 2 Aug 2016 02:32:23 +0200 Subject: [PATCH 30/41] Rewrite updating process, links, typos --- debian/README.source | 37 +++++++++++++++---------------------- debian/changelog | 2 +- debian/upstream/metadata | 8 ++++---- 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/debian/README.source b/debian/README.source index f1e6f3a..f8ad3a9 100644 --- a/debian/README.source +++ b/debian/README.source @@ -24,26 +24,19 @@ enough to avoid scenarios that usually need the d/patches/ directory. 4. Generate a *.orig.tar.gz from the git repository, e.g., upgrade the Debian source package to a new upstream version. - ~$ git clone --recursive --branch debian-master \ +Easy way: + use the provided orig-tars, e.g., 'telegram-purple_1.2.6.orig.tar.gz' + +Hard way (the procedure used to create these files): + $ git clone --recursive --branch debian-master \ https://github.com/majn/telegram-purple.git - ~& cd telegram-purple - ~/telegram-purple$ debian/genorigtar.sh + $ cd telegram-purple + ...$ make dist The output should look like this: - - Debian version seems to be 1.2.3. Expecting a tag v1.2.3 - Resolved to ffca726ca1cd22f87a48ca3fe042802302e82837 - -Note that the script builds on the following assumptions that are *not* -verified: -- d/changelog is in a current state -- d/changelog refers to an existing version tag known by the local git - repository -- there have been no modifications in the tgl/ folder, and most - importantly: the debian-* branch didn't change the submodule commit - -The last item can be considered a bug, which is why I don't recommend -anyone to use out genorigtar.sh script for other projects. + Refresh commit.h + ./gen-origtar + mv -f bin/result.tar.gz telegram-purple_deb-v1.2.4-2-161-gb5272d4.orig.tar.gz The following approaches do NOT work: - Github's "download source tar", as this leaves out submodules. @@ -76,7 +69,7 @@ So following that tradition, this package would be called "pidgin-telegram". However, this would have a lot of disadvantages: - This is a frontend-agnostic backend that works with Adium, pidgin, - and Finch. We hope that it works nicely with all other frontends. + and Finch. We hope that it works nicely with all other frontends, too. Calling it "pidgin-something" would be highly misleading. - All error messages and their translations would need to be adapted - paths would need to change that aren't configurable @@ -96,9 +89,9 @@ No. So far, ABI-compatibility was broken between virtually every other commit to libtgl, and the library is still under development. The latest "stable" release is heavily outdated and can no longer be used -productively (missing features, known bugs, etc.), so if we were to +productively (missing features, known breaking bugs, etc.), so if we were to package tgl we would need to repackage it constantly, with no defined -concept version, soname, or anything reliable. No other program +concept of version, soname, or anything reliable. No other program (*including* tg-cli) can be expected to use the same version of libtgl as telegram-purple does. (This might happen every now and then, but that would be random chance. Finally, it's highly unlikely that someone @@ -124,5 +117,5 @@ clever way. About this document =================== -This not written in Markdown. All formatting is in the hope of making -it easy to read. +This is not written in Markdown. All formatting is in the hope of +making it easy to read. diff --git a/debian/changelog b/debian/changelog index aa76348..7b5f43b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -telegram-purple (1.2.4-1) UNRELEASED; urgency=medium +telegram-purple (1.3.0-1) UNRELEASED; urgency=medium [ Hugues Morisset ] * Initial Release (Closes: #800771) diff --git a/debian/upstream/metadata b/debian/upstream/metadata index 6ccc46c..c899b45 100644 --- a/debian/upstream/metadata +++ b/debian/upstream/metadata @@ -4,12 +4,12 @@ Bug-Submit: https://github.com/majn/telegram-purple/issues/new ## Intentionally left out, to make sure that we don't accidentally break someone's ## workflow. We err on the side of not prescribing anyone how to cite this work. #Changelog: https://github.com/majn/telegram-purple/blob/master/CHANGELOG.md -## Intentionally left out as it's currently pretty outdated. -Contact: https://telegram.me/joinchat/01fb53f301b67d3c7a5532908dfa9a89 +## Intentionally left out as it's already outdated at the time of writing. +Contact: https://goo.gl/QHttTR ## The development chat group. #Donation: See 'Contact' #FAQ: https://github.com/majn/telegram-purple/#faq -## No real content yet. +## Intentionally left out: no real content yet. Name: telegram-purple ## Might be superfluous, but I want to confirm that the upstream name is ## indeed telegram-purple, hence the package name in Debian. @@ -18,4 +18,4 @@ Repository-Browse: https://github.com/majn/telegram-purple/ Security-Contact: Main developer: Matthias Jentch Debian packager: Ben Wiederhake - Development channel (public): https://goo.gl/bhmM7N + Development channel (public): https://goo.gl/QHttTR From 974b16a9bdc0012d21cbed539a3237d84567b959 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Tue, 2 Aug 2016 02:45:42 +0200 Subject: [PATCH 31/41] d/changelog: supergroups and channels --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 7b5f43b..f82835b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,5 +14,6 @@ telegram-purple (1.3.0-1) UNRELEASED; urgency=medium - Fix behavior around hibernation - Fix display errors and false warnings - Fix crash on 'unsupported' media + - Support supergroups and channels -- Ben Wiederhake Wed, 30 Dec 2015 16:38:02 +0100 From 744a58550208c71733f2110dd66d60328e200e75 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Tue, 2 Aug 2016 03:08:26 +0200 Subject: [PATCH 32/41] d/watch: fix filenamemangle --- debian/watch | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/watch b/debian/watch index b53aef8..35a2049 100644 --- a/debian/watch +++ b/debian/watch @@ -1,6 +1,7 @@ version=4 opts="\ downloadurlmangle=s/tag\/v(.*)$/download\/v$1\/telegram-purple_$1.orig.tar.gz/,\ + filenamemangle=s/.*tag\/v(.*)$/telegram-purple_$1.orig.tar.gz/,\ uversionmangle=s/-(beta\d*)$/~$1/,\ " \ https://github.com/majn/telegram-purple/releases \ From db376444123de55e002dbceaa3929c584e46e4f5 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 22 Aug 2016 20:31:14 +0200 Subject: [PATCH 33/41] Remove breaking hardening-flag --- debian/rules | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/rules b/debian/rules index 8f159df..e817abb 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,6 @@ DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk -export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: dh $@ --parallel --with autoreconf From 7a7f24c6a565f55eae50b99abc24be7b027d7c23 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 22 Aug 2016 21:02:14 +0200 Subject: [PATCH 34/41] Finally: release 1.3.0 --- debian/changelog | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index f82835b..18d676d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,13 +1,13 @@ -telegram-purple (1.3.0-1) UNRELEASED; urgency=medium +telegram-purple (1.3.0-1) unstable; urgency=medium [ Hugues Morisset ] * Initial Release (Closes: #800771) [ Ben Wiederhake ] - * Please note that due to the format-switch, the file - /etc/telegram-purple/server.pub is obsolete for this version. - It is only tolerated to allow for smooth transition from old, manual - installations, and will be removed in future versions. + * Please note that due to the format-switch in 1.2.6, the file + /etc/telegram-purple/server.pub is obsolete for all version after it. + It is ignored to allow for smooth transition from old, manual + installations, and may be removed in future versions. * New upstream release - Add translations and plural support - Fix lots of bugs around secret chats (still not perfect, though) @@ -16,4 +16,4 @@ telegram-purple (1.3.0-1) UNRELEASED; urgency=medium - Fix crash on 'unsupported' media - Support supergroups and channels - -- Ben Wiederhake Wed, 30 Dec 2015 16:38:02 +0100 + -- Ben Wiederhake Mon, 22 Aug 2016 20:59:47 +0200 From 3895bc12f0955180468a61c367c427251fe3328d Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 22 Aug 2016 21:52:09 +0200 Subject: [PATCH 35/41] Fix correct ITP --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 18d676d..1be32f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ telegram-purple (1.3.0-1) unstable; urgency=medium [ Hugues Morisset ] - * Initial Release (Closes: #800771) + * Initial Release (Closes: #833793) [ Ben Wiederhake ] * Please note that due to the format-switch in 1.2.6, the file From 512eeed013eaeaeb047e6c2d327ce38d0ce62a38 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 10 Apr 2017 22:54:08 +0200 Subject: [PATCH 36/41] Update nsi file to reflect changes in po/LINGUAS --- telegram-purple.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram-purple.nsi b/telegram-purple.nsi index eadfd46..1c8b12f 100644 --- a/telegram-purple.nsi +++ b/telegram-purple.nsi @@ -92,13 +92,13 @@ Section "MainSection" SEC01 SetOutPath "$PidginDir\locale" File /nonfatal "/oname=bg\LC_MESSAGES\telegram-purple.mo" "po\bg.mo" + File /nonfatal "/oname=cs_CZ\LC_MESSAGES\telegram-purple.mo" "po\cs_CZ.mo" File /nonfatal "/oname=de_DE\LC_MESSAGES\telegram-purple.mo" "po\de_DE.mo" File /nonfatal "/oname=es_AR\LC_MESSAGES\telegram-purple.mo" "po\es_AR.mo" File /nonfatal "/oname=fr\LC_MESSAGES\telegram-purple.mo" "po\fr.mo" File /nonfatal "/oname=it_IT\LC_MESSAGES\telegram-purple.mo" "po\it_IT.mo" File /nonfatal "/oname=nl\LC_MESSAGES\telegram-purple.mo" "po\nl.mo" File /nonfatal "/oname=pl_PL\LC_MESSAGES\telegram-purple.mo" "po\pl_PL.mo" - File /nonfatal "/oname=pt_BR\LC_MESSAGES\telegram-purple.mo" "po\pt_BR.mo" File /nonfatal "/oname=ru_RU\LC_MESSAGES\telegram-purple.mo" "po\ru_RU.mo" File /nonfatal "/oname=sq\LC_MESSAGES\telegram-purple.mo" "po\sq.mo" File /nonfatal "/oname=uk\LC_MESSAGES\telegram-purple.mo" "po\uk.mo" From 53c92303a274f08bd608abdc9ba0b23b9fde15be Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 10 Apr 2017 22:32:38 +0200 Subject: [PATCH 37/41] Don't read pubkey from file anymore --- README.md | 14 ++++----- telegram-base.c | 76 ----------------------------------------------- telegram-base.h | 9 ------ telegram-purple.c | 51 ++++--------------------------- 4 files changed, 10 insertions(+), 140 deletions(-) diff --git a/README.md b/README.md index 50c50b2..adac8d4 100644 --- a/README.md +++ b/README.md @@ -281,15 +281,11 @@ Discussion / Help As we want to avoid OpenSSL, it has become necessary to replace the PEM file format. This means that if you use a custom pubkey (which you really REALLY shouldn't be doing), you have to adapt, sorry. -We no longer ship `tg-server.pub` (old format), but instead `tg-server.tglpub` (new format). If you have a `.pub` and want to continue using telegram-purple, please use this (hopefully highly portable) tool: [pem2bignum](https://github.com/BenWiederhake/pem2bignum) - -You can also write your own conversion tool if you prefer. The format is really simple: - -1. `e`, the public exponent, encoded as big endian 32 bit fixed length (e.g. `0x00 01 00 01` for 65537) -2. `n_len`, the length of `n` in bytes, encoded as big endian 32 bit fixed length (e.g. `0x00 00 01 00` for a 2048-bit = 256-byte key) -3. `n_raw`, the raw modulus, encoded as big endian, using the previously indicated length (e.g. `0xC1 50 02 3E [248 bytes omitted] 21 79 25 1F` in the case of telegram's public RSA key.) - -If you are interested in developing a non-OpenSSL-licensed converter, look into [insane-triangle-banana](https://github.com/BenWiederhake/insane-triangle-banana). +We no longer read the public key of the Telegram servers from a file. +If you really need a different public key, and know what you're doing +(e.g., connecting to some kind of test environment internal to Telegram, +which also is a very bad idea), you need to find the call to `tgl_set_rsa_key_direct` in `telegram-purple.c`, +and provide the key directly by yourself. FAQ diff --git a/telegram-base.c b/telegram-base.c index 816fe85..0e5ee46 100644 --- a/telegram-base.c +++ b/telegram-base.c @@ -35,68 +35,6 @@ #define STATE_FILE_MAGIC 0x28949a93 #define SECRET_CHAT_FILE_MAGIC 0x37a1988a -static gboolean read_ui32 (int fd, unsigned int *ret) { - typedef char check_int_size[(sizeof (int) >= 4) ? 1 : -1]; - (void) sizeof (check_int_size); - - unsigned char buf[4]; - if (4 != read (fd, buf, 4)) { - return 0; - } - // Ugly but works. - *ret = 0; - *ret |= buf[0]; - *ret <<= 8; - *ret |= buf[1]; - *ret <<= 8; - *ret |= buf[2]; - *ret <<= 8; - *ret |= buf[3]; - return 1; -} - -int read_pubkey_file (const char *name, struct rsa_pubkey *dst) { - // Just to make sure nobody reads garbage. - dst->e = 0; - dst->n_len = 0; - dst->n_raw = NULL; - - int pubkey_fd = open (name, O_RDONLY | O_BINARY); - if (pubkey_fd < 0) { - return 0; - } - - unsigned int e; - unsigned int n_len; - if (!read_ui32 (pubkey_fd, &e) || !read_ui32 (pubkey_fd, &n_len) // Ensure successful reads - || n_len < 128 || n_len > 1024 || e < 5) { // Ensure (at least remotely) sane parameters. - close (pubkey_fd); - return 0; - } - - unsigned char *n_raw = malloc (n_len); - if (!n_raw) { - close (pubkey_fd); - return 0; - } - - gint readret; - readret = read (pubkey_fd, n_raw, n_len); - if (readret <= 0 || (n_len != (guint) readret)) { - free (n_raw); - close (pubkey_fd); - return 0; - } - close (pubkey_fd); - - dst->e = e; - dst->n_len = n_len; - dst->n_raw = n_raw; - - info ("read pubkey file: n_len=%u e=%u", n_len, e); - return 1; -} - void read_state_file (struct tgl_state *TLS) { char *name = 0; name = g_strdup_printf("%s/%s", TLS->base_path, "state"); @@ -440,20 +378,6 @@ gchar *get_config_dir (char const *username) { return dir; } -gchar *get_user_pk_path () { - /* - This can't be conditional on whether or not we're using telepathy, because - then we would need to make sure that `make local_install` also knows about - that location. So we *always* use ${HOME}/.purple/telegram-purple, - even when the other files aren't in this folder. - Note that this is only visible when using Telepathy/Empathy with - local_install, which should be kinda rare anyway (use telepathy-morse!). - */ - return g_strconcat (g_get_home_dir(), G_DIR_SEPARATOR_S, ".purple", - G_DIR_SEPARATOR_S, "telegram-purple", - G_DIR_SEPARATOR_S, user_pk_filename, NULL); -} - gchar *get_download_dir (struct tgl_state *TLS) { assert (TLS->base_path); static gchar *dir; diff --git a/telegram-base.h b/telegram-base.h index 9e4a458..b6d4a4f 100644 --- a/telegram-base.h +++ b/telegram-base.h @@ -22,14 +22,6 @@ #include "telegram-purple.h" -struct rsa_pubkey { - unsigned int e; - unsigned int n_len; - unsigned char *n_raw; -}; - -gboolean read_pubkey_file (const char *name, struct rsa_pubkey *dst); - void read_state_file (struct tgl_state *TLS); void read_auth_file (struct tgl_state *TLS); void write_auth_file (struct tgl_state *TLS); @@ -40,7 +32,6 @@ void write_secret_chat_file (struct tgl_state *TLS); void write_secret_chat_gw (struct tgl_state *TLS, void *extra, int success, struct tgl_secret_chat *E); gchar *get_config_dir (char const *username); -gchar *get_user_pk_path (); gchar *get_download_dir (struct tgl_state *TLS); int tgp_visualize_key (struct tgl_state *TLS, unsigned char* sha1_key); diff --git a/telegram-purple.c b/telegram-purple.c index c403b2d..4c84d06 100644 --- a/telegram-purple.c +++ b/telegram-purple.c @@ -18,6 +18,8 @@ Copyright Matthias Jentsch, Vitaly Valtman, Ben Wiederhake, Christopher Althaus 2014-2015 */ +#include + #include "telegram-purple.h" #include "commit.h" @@ -37,12 +39,6 @@ static void update_secret_chat_handler (struct tgl_state *TLS, struct tgl_secret static void update_on_failed_login (struct tgl_state *TLS); const char *config_dir = "telegram-purple"; -const char *user_pk_filename = "server.tglpub"; -#ifdef WIN32 -const char *pk_path = "server.tglpub"; -#else -const char *pk_path = "/etc/telegram-purple/server.tglpub"; -#endif struct tgl_update_callback tgp_callback = { .new_msg = update_message_handler, @@ -541,46 +537,9 @@ static void tgprpl_login (PurpleAccount * acct) { tgl_set_download_directory (TLS, get_download_dir(TLS)); debug ("base configuration path: '%s'", TLS->base_path); - struct rsa_pubkey pubkey; -#ifdef WIN32 - gchar *global_pk_path = g_strdup_printf("%s/%s", DATADIR, pk_path); -#else - gchar *global_pk_path = g_strdup(pk_path); -#endif - debug ("trying global pubkey at %s", global_pk_path); - gboolean global_pk_loaded = read_pubkey_file (global_pk_path, &pubkey); - g_free(global_pk_path); - - tgl_set_verbosity (TLS, 4); - if (global_pk_loaded) { - info ("using global pubkey"); - tgl_set_rsa_key_direct (TLS, pubkey.e, pubkey.n_len, pubkey.n_raw); - } else { - char *user_pk_path = get_user_pk_path (); - debug ("trying local pubkey at %s", user_pk_path); - gboolean user_pk_loaded = read_pubkey_file (user_pk_path, &pubkey); - - if (user_pk_loaded) { - info ("using local pubkey"); - tgl_set_rsa_key_direct (TLS, pubkey.e, pubkey.n_len, pubkey.n_raw); - } else { - failure ("both didn't work. abort."); - char *cause = g_strdup_printf (_("Unable to sign on as %s: file (public key) not found."), - purple_account_get_username (acct)); - purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, cause); - char *long_hint = g_strdup_printf ( - _("Make sure telegram-purple is installed properly,\n" - "including the .tglpub file.\n" - "If you're running SELinux (e.g. when using Tails),\n" - "try 'make local_install', or simply copy\n" - "%1$s to %2$s."), pk_path, user_pk_path); - purple_notify_message (_telegram_protocol, PURPLE_NOTIFY_MSG_ERROR, cause, - long_hint, NULL, NULL, NULL); - g_free (cause); - g_free (long_hint); - return; - } - } + tgl_set_rsa_key_direct (TLS, tglmp_get_default_e(), + tglmp_get_default_key_len(), + tglmp_get_default_key()); tgl_set_ev_base (TLS, conn); tgl_set_net_methods (TLS, &tgp_conn_methods); From edc06b82c55295750df4be7d0740a7eca4603378 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 10 Apr 2017 22:49:21 +0200 Subject: [PATCH 38/41] Remove public key from repo --- Makefile.in | 3 +-- Makefile.mingw | 1 - telegram-purple.nsi | 1 - telegram-purple.nsi.awk-in | 1 - tg-server.tglpub | Bin 264 -> 0 bytes 5 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 tg-server.tglpub diff --git a/Makefile.in b/Makefile.in index fdeddb4..91474ee 100644 --- a/Makefile.in +++ b/Makefile.in @@ -121,7 +121,6 @@ noicon_install: $(PRPL_LIBNAME) $(LOCALE_MOS) mkdir -m $(DIR_PERM) -p $(DESTDIR)$(PLUGIN_DIR_PURPLE) install -m $(FILE_PERM) $(PRPL_LIBNAME) $(DESTDIR)$(PLUGIN_DIR_PURPLE)/$(PRPL_NAME) mkdir -m $(DIR_PERM) -p $(DESTDIR)/etc/telegram-purple - install -m $(FILE_PERM) tg-server.tglpub $(DESTDIR)/etc/telegram-purple/server.tglpub # Assume that the user does not use AppStream if she doesn't want icons @for lang in $(LOCALES); do \ mkdir -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \ @@ -133,7 +132,7 @@ noicon_install: $(PRPL_LIBNAME) $(LOCALE_MOS) noicon_uninstall: rm -f $(DESTDIR)$(PLUGIN_DIR_PURPLE)/$(PRPL_NAME) rm -f $(DESTDIR)/etc/telegram-purple/server.pub # TODO: Remove this in later versions - rm -f $(DESTDIR)/etc/telegram-purple/server.tglpub + rm -f $(DESTDIR)/etc/telegram-purple/server.tglpub # TODO: Remove this in later versions # TODO: Delete all installed .mo's, no matter what LINGUAS says. @for lang in $(LOCALES); do \ echo "removing $(localedir)/$$lang/LC_MESSAGES/$(gettext_package).mo"; \ diff --git a/Makefile.mingw b/Makefile.mingw index 8306261..b499647 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -106,7 +106,6 @@ strip: $(PRPL_LIBNAME) install: $(PRPL_LIBNAME) $(LOCALES) mkdir -m $(DIR_PERM) -p $(PLUGIN_DIR_PURPLE) install -m $(FILE_PERM) $(PRPL_LIBNAME) $(PLUGIN_DIR_PURPLE)/$(PRPL_NAME) - install -m $(FILE_PERM) tg-server.tglpub $(DATA_ROOT_DIR_PURPLE)/server.tglpub ifeq ($(COPY_ICONS),no) @echo "Not copying icons due to configure-option --disable-icons." @echo " If you're using Finch, Empathy, or Telepathy, then this is a good idea." diff --git a/telegram-purple.nsi b/telegram-purple.nsi index 1c8b12f..b6c31d3 100644 --- a/telegram-purple.nsi +++ b/telegram-purple.nsi @@ -104,7 +104,6 @@ Section "MainSection" SEC01 File /nonfatal "/oname=uk\LC_MESSAGES\telegram-purple.mo" "po\uk.mo" SetOutPath "$PidginDir" - File "/oname=server.tglpub" "tg-server.tglpub" File "${WIN32_DEV_TOP}\libgpg-error-1.12-2\bin\libgpg-error-0.dll" File "${WIN32_DEV_TOP}\libgcrypt-1.6.3\bin\libgcrypt-20.dll" File "${WIN32_DEV_TOP}\libwebp-0.4.3-1\bin\libwebp-5.dll" diff --git a/telegram-purple.nsi.awk-in b/telegram-purple.nsi.awk-in index 3578628..a980292 100644 --- a/telegram-purple.nsi.awk-in +++ b/telegram-purple.nsi.awk-in @@ -94,7 +94,6 @@ Section "MainSection" SEC01 File /nonfatal "/oname=%\LC_MESSAGES\telegram-purple.mo" "po\%.mo" SetOutPath "$PidginDir" - File "/oname=server.tglpub" "tg-server.tglpub" File "${WIN32_DEV_TOP}\libgpg-error-1.12-2\bin\libgpg-error-0.dll" File "${WIN32_DEV_TOP}\libgcrypt-1.6.3\bin\libgcrypt-20.dll" File "${WIN32_DEV_TOP}\libwebp-0.4.3-1\bin\libwebp-5.dll" diff --git a/tg-server.tglpub b/tg-server.tglpub deleted file mode 100644 index 2e42cf9f6bd9c42ed885685a957dd5da6c3e0ba9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 264 zcmV+j0r&m@0RRC20098OPy#+LaNBu>-q2)qoc_-W^C;$;LE7}z@EcQsHKzF=kBce} z$-0*y&NVLl_Qhxq{6b6CG=@n6-V00C)SpgR0x;vQm)Ts48AK~Q3J}=!V?XTe){<&} zZL1C2eMNtss2hZ3{MP^e?GZo`-;uys%I&Y0Vqa{Q?8iqXRcSQucpZjoH1HAp8Q$&F4y6{E`o9zgfCmbx>n- O=MxW*LfVocc_km3zkF~2 From 784489392c44f585eb3db4d277175c647e20a226 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 10 Apr 2017 23:14:53 +0200 Subject: [PATCH 39/41] Tell explicitly that all checks have passed --- test/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Makefile b/test/Makefile index eaa33c5..2183096 100644 --- a/test/Makefile +++ b/test/Makefile @@ -16,6 +16,7 @@ ${PLUGIN_TESTS}: %: test/bin/% test/tmp/user .PHONY: check check: ${PLUGIN_TESTS} test/tmp/user + @echo "'make check' passed." .PHONY: recheck recheck: clean-test check From 0e585650c49fba13ad0a0524423efe1ed7432322 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 10 Apr 2017 23:31:20 +0200 Subject: [PATCH 40/41] Update Debian links --- debian/control | 4 ++-- debian/upstream/metadata | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index a8da6e3..79fd86a 100644 --- a/debian/control +++ b/debian/control @@ -16,8 +16,8 @@ Build-Depends: zlib1g-dev Standards-Version: 3.9.8 Homepage: https://github.com/majn/telegram-purple -Vcs-Git: https://github.com/BenWiederhake/telegram-purple -Vcs-Browser: https://github.com/BenWiederhake/telegram-purple/tree/debian-develop +Vcs-Git: https://github.com/majn/telegram-purple.git +Vcs-Browser: https://github.com/majn/telegram-purple Package: telegram-purple Architecture: any diff --git a/debian/upstream/metadata b/debian/upstream/metadata index c899b45..e131c30 100644 --- a/debian/upstream/metadata +++ b/debian/upstream/metadata @@ -5,8 +5,11 @@ Bug-Submit: https://github.com/majn/telegram-purple/issues/new ## workflow. We err on the side of not prescribing anyone how to cite this work. #Changelog: https://github.com/majn/telegram-purple/blob/master/CHANGELOG.md ## Intentionally left out as it's already outdated at the time of writing. -Contact: https://goo.gl/QHttTR +#Contact: https://goo.gl/QHttTR ## The development chat group. +## Intentionally left out as the link changes constantly. +## https://github.com/majn/telegram-purple#group-chat +## for a recent link. #Donation: See 'Contact' #FAQ: https://github.com/majn/telegram-purple/#faq ## Intentionally left out: no real content yet. @@ -18,4 +21,7 @@ Repository-Browse: https://github.com/majn/telegram-purple/ Security-Contact: Main developer: Matthias Jentch Debian packager: Ben Wiederhake - Development channel (public): https://goo.gl/QHttTR +# Development channel (public): https://goo.gl/QHttTR +## Intentionally left out as the link changes constantly. +## https://github.com/majn/telegram-purple#group-chat +## for a recent link. From 6c3f37392a8b8653694715f27c6152c72bb1d7ef Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 10 Apr 2017 23:44:46 +0200 Subject: [PATCH 41/41] Update documentation about Debian --- README.md | 34 +++++++++++++--------------------- debian/.gitignore | 5 +++++ debian/changelog | 8 ++++++++ 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index adac8d4..419961a 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,8 @@ https://aur.archlinux.org/packages/telegram-purple/ #### Debian -At the time of writing, the package hasn't been accepted yet. -Please first check if it's already available to you: `sudo apt-get install telegram-purple` - -If this doesn't work because the package doesn't exist (yet), please build it from source. +You can build it from source (see following section) or build a `.deb` file +for your package manager. Building From Source @@ -85,12 +83,6 @@ this indicates that this version is in fact much further than just ##### Debian / Ubuntu -We are working on a Debian package! Please first check if it's already available to you: `sudo apt-get install telegram-purple` - -If the above works, then you should stop here: It is now installed. - -If the above fails: Don't worry, just continue building it by yourself. Next you need to install these dependencies: - sudo apt-get install libgcrypt20-dev libpurple-dev libwebp-dev gettext build-essential @@ -223,17 +215,16 @@ Building the Debian Package If you just need a `.deb`, simply do: sudo apt-get install debhelper - git checkout debian-master - git submodule update --recursive fakeroot ./debian/rules binary -And you're done! The `.deb` is in the directory at which you started. +And you're done! The `telegram-purple_….deb` and `telegram-purple-dbgsym_….deb` files +are in the parent directory. To show some info about it, try this: dpkg --info telegram-purple_*.deb -`debian-master` always points to a version that was submitted to Debian. (Note that this doesn't exist yet, as we haven't released to Debian yet.) -`debian-develop` is the candidate for the next submission. +Please note that installing the debugging symbols (`dbgsym`) +help a lot in troubleshooting, so please do install them, too! #### Debian Maintainers #### @@ -244,16 +235,15 @@ Here's how you can generate a `.orig.tar.gz`: make dist -Note that these are incompatible with the old `debian/genorigtar.sh` -tarballs, and can't be made compatible easily. If you need the tarball -from "back then", see the documentation there. - -This command requires the original tar to exist (and will fail otherwise, -although the error message will be misleading) will build all further files, +The following command requires the original tar to exist, +and will build all further files, specifically `.debian.tar.xz`, `.dsc`, `.deb`, and `.changes`: dpkg-buildpackage +If this fails with a cryptic error message, +first make sure that the `….orig.tar` really is in place. + For the upload, you should use `pbuilder` and similar to build the package in a more minimalistic environment. That covers the official part of the work-flow. @@ -265,6 +255,8 @@ and `.dsc` files, do this: false # Move tar to parent directory, by hand dpkg-source -b . +Note that we no longer actively try to get it into the Debian repository. + 1.3.0 ----- diff --git a/debian/.gitignore b/debian/.gitignore index 7290429..4e08d2e 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -1,3 +1,8 @@ /files /telegram-purple/ /telegram-purple.* + +/.debhelper/ +/autoreconf.after +/autoreconf.before +/debhelper-build-stamp diff --git a/debian/changelog b/debian/changelog index 1be32f3..4ed6f08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +telegram-purple (1.3.1-1) UNRELEASED; urgency=medium + + * New upstream release + * No longer actively try to push it into Debian: too unstable. + If you really want a .deb file, see README.md in the toplevel directory. + + -- Ben Wiederhake Mon, 10 Apr 2017 23:31:32 +0200 + telegram-purple (1.3.0-1) unstable; urgency=medium [ Hugues Morisset ]