Compare commits
30 commits
master
...
debian-mas
Author | SHA1 | Date | |
---|---|---|---|
![]() |
924e59b91f | ||
![]() |
64354d6305 | ||
![]() |
a6afa1867f | ||
![]() |
3fd945465d | ||
![]() |
ac1763c596 | ||
![]() |
6865a5e370 | ||
![]() |
b4253a2419 | ||
![]() |
17001c910d | ||
![]() |
b8eadf92d5 | ||
![]() |
8ab007099f | ||
![]() |
12fe25086a | ||
![]() |
ee5fa68778 | ||
![]() |
cc98501725 | ||
![]() |
f849ddd18a | ||
![]() |
f432e7f1f8 | ||
![]() |
ee3b122e52 | ||
![]() |
79f54842bc | ||
![]() |
3dad3f91e3 | ||
![]() |
b4a88942c1 | ||
![]() |
6edcdb8b60 | ||
![]() |
a9084dd497 | ||
![]() |
9a43d7d98c | ||
![]() |
a355bcbf5a | ||
![]() |
9baf48d923 | ||
![]() |
2fcaea9d13 | ||
![]() |
9aefb97075 | ||
![]() |
8eb09f9adf | ||
![]() |
9053eaf124 | ||
![]() |
bcb0af12f9 | ||
![]() |
0a8f7bbf8e |
14 changed files with 695 additions and 0 deletions
3
debian/.gitignore
vendored
Normal file
3
debian/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
/files
|
||||
/telegram-purple/
|
||||
/telegram-purple.*
|
128
debian/README.source
vendored
Normal file
128
debian/README.source
vendored
Normal file
|
@ -0,0 +1,128 @@
|
|||
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.
|
||||
|
||||
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:
|
||||
- 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
|
||||
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 )
|
||||
|
||||
|
||||
|
||||
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.
|
18
debian/changelog
vendored
Normal file
18
debian/changelog
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
telegram-purple (1.2.4-2) 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.
|
||||
* 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 crash on 'unsupported' media
|
||||
|
||||
-- Ben Wiederhake <Ben.Wiederhake@gmail.com> Wed, 30 Dec 2015 16:38:02 +0100
|
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
9
|
41
debian/control
vendored
Normal file
41
debian/control
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
Source: telegram-purple
|
||||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: Ben Wiederhake <Ben.Wiederhake@gmail.com>
|
||||
Uploaders:
|
||||
Hugues Morisset <morisset.hugues@gmail.com>
|
||||
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/BenWiederhake/telegram-purple
|
||||
Vcs-Browser: https://github.com/BenWiederhake/telegram-purple/tree/debian-develop
|
||||
|
||||
Package: telegram-purple
|
||||
Architecture: any
|
||||
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
|
||||
messages are currently in development.
|
||||
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
|
||||
"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.
|
112
debian/copyright
vendored
Normal file
112
debian/copyright
vendored
Normal file
|
@ -0,0 +1,112 @@
|
|||
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 <mtthsjntsch@gmail.com>
|
||||
2014 Vitaly Valtman <mail@vysheng.ru>
|
||||
2014 Christopher Althaus <althaus.christopher@gmail.com>
|
||||
2014 Markus Endres <endresma45241@th-nuernberg.de>
|
||||
License: GPL-2+
|
||||
|
||||
Files: telegram-purple.metainfo.xml
|
||||
Copyright: 2015 Jiri Eischmann <eischmann@redhat.com>
|
||||
License: GFDL-NIV
|
||||
License-Grant:
|
||||
<metadata_license>GFDL-1.3</metadata_license>
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2015 Hugues Morisset <morisset.hugues@gmail.com>
|
||||
2015 Ben Wiederhake <BenWiederhake.GitHub@gmail.com>
|
||||
License: GPL-2+
|
||||
|
||||
Files: debian/rawtar
|
||||
Copyright: 2008, 2009, 2013, 2014 Meitar Moscovitz <meitarm+github@gmail.com>
|
||||
2011, 2013 Marius Ghita <mhitza@gmail.com>
|
||||
2012 C.D. Clark III <https://github.com/meitar/git-archive-all.sh.git>
|
||||
License: GPL-3+
|
||||
|
||||
Files: tgl/*
|
||||
Copyright: 2013-2015 Vitaly Valtman <mail@vysheng.ru>
|
||||
2015 Matthias Jentsch <mtthsjntsch@gmail.com>
|
||||
2015 Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: tgl/tl-parser/*
|
||||
Copyright: 2015 Matthias Jentsch <mtthsjntsch@gmail.com>
|
||||
2015 Vitaly Valtman <mail@vysheng.ru>
|
||||
2015 Christopher Althaus <althaus.christopher@gmail.com>
|
||||
2015 Markus Endres <endresma45241@th-nuernberg.de>
|
||||
License: GPL-2+
|
||||
|
||||
Files: tgl/tl-parser/portable_endian.h
|
||||
Copyright: 2013-2014 Mathias Panzenböck <grosser.meister.morti@gmx.net>
|
||||
2015 PkmX <pkmx.tw@gmail.com>
|
||||
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
|
||||
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.
|
||||
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.
|
||||
|
||||
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: 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
|
||||
"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.
|
2
debian/docs
vendored
Normal file
2
debian/docs
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
AUTHORS
|
||||
README.md
|
40
debian/genorigtar.sh
vendored
Executable file
40
debian/genorigtar.sh
vendored
Executable file
|
@ -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.
|
308
debian/rawtar
vendored
Executable file
308
debian/rawtar
vendored
Executable file
|
@ -0,0 +1,308 @@
|
|||
#!/bin/bash -
|
||||
|
||||
# Found on https://github.com/meitar/git-archive-all.sh
|
||||
# Version: cd7302ea7c8973f7fc360ae1a77e3b4a28a6eeb7
|
||||
# Copyright Meitar Moscovitz <meitarm+github@gmail.com> 2008, 2009, 2013, 2014
|
||||
# Marius Ghita <mhitza@gmail.com> 2011, 2013
|
||||
# C.D. Clark III <https://github.com/meitar/git-archive-all.sh.git> 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 <fmt>] [--prefix <path>] [--verbose|-v] [--separate|-s]"
|
||||
echo " [--tree-ish|-t <tree-ish>] [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 <path> 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
|
16
debian/rules
vendored
Executable file
16
debian/rules
vendored
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/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_auto_clean tries to "make distclean", but we don't have that target.
|
||||
override_dh_auto_clean:
|
||||
test ! -e Makefile || $(MAKE) clean
|
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
1
debian/source/options
vendored
Normal file
1
debian/source/options
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
extend-diff-ignore = "(^|/)(config\.(h|log|status)|Makefile)$"
|
21
debian/upstream/metadata
vendored
Normal file
21
debian/upstream/metadata
vendored
Normal file
|
@ -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: <a href="https://github.com/majn/telegram-purple">telegram-purple</ a>
|
||||
## 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 <mtthsjntsch AT gmail DOT com>
|
||||
Debian packager: Ben Wiederhake <Ben DOT Wiederhake AT gmail DOT com>
|
||||
Development channel (public): https://goo.gl/bhmM7N
|
3
debian/watch
vendored
Normal file
3
debian/watch
vendored
Normal file
|
@ -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 .*/archive/v?(\d\S*)\.tar\.gz
|
Loading…
Add table
Reference in a new issue