diff options
author | Fede | 2016-08-11 10:37:59 +0200 |
---|---|---|
committer | Fede | 2016-08-11 10:37:59 +0200 |
commit | 76d1d20f77041ebc8d4e1fdf6b149529f90d89d5 (patch) | |
tree | 1bbe360d3fa24dd617a7fee0e19d094774c868f8 | |
download | aur-telegram-history-dump-git.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 41 | ||||
-rw-r--r-- | telegram-history-dump.patch | 26 | ||||
-rw-r--r-- | telegram-history-dump.sh | 19 |
4 files changed, 106 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c52891840f20 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = telegram-history-dump-git + pkgdesc = Backup Telegram chat logs using telegram-cli + pkgver = r92.5a37d9a + pkgrel = 1 + url = https://github.com/tvdstaaij/telegram-history-dump + arch = any + license = GPL + makedepends = git + depends = telegram-cli-git + depends = ruby + provides = telegram-history-dump + source = git+https://github.com/tvdstaaij/telegram-history-dump.git + source = telegram-history-dump.sh + source = telegram-history-dump.patch + sha512sums = SKIP + sha512sums = 6e7001e1d65038ae93d993e61c369ab69989d33ab841eaf33b377c138f2bcddc129435889231b1b310d3b1b17eed269b072ca783a5715750932bec902f905aa6 + sha512sums = f06044b1da5a3c2e5d51f4161b923bc0e95cb896b0ab93bd898d14771d3c1caf5b5c66bf915ac6ae38a85397d52841e4067959dd5e6023df2a20e8c6675492e2 + +pkgname = telegram-history-dump-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..5392d1ad352f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: tembleking <tembleking at gmail dot com> +pkgname=telegram-history-dump-git +pkgver=r92.5a37d9a +pkgrel=1 +pkgdesc='Backup Telegram chat logs using telegram-cli' +arch=('any') +url="https://github.com/tvdstaaij/telegram-history-dump" +license=('GPL') +groups=() +depends=('telegram-cli-git' + 'ruby') +makedepends=('git') +provides=('telegram-history-dump') +source=('git+https://github.com/tvdstaaij/telegram-history-dump.git' + 'telegram-history-dump.sh' + 'telegram-history-dump.patch') + +pkgver() { + cd "$srcdir/telegram-history-dump" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cp "telegram-history-dump.patch" "$srcdir/telegram-history-dump/telegram-history-dump.patch" + cd "$srcdir/telegram-history-dump" + patch -p1 -i "telegram-history-dump.patch" + rm -f "telegram-history-dump.patch" +} + +package() { + install -d "$pkgdir/opt/telegram-history-dump" + cp -r "$srcdir/telegram-history-dump/." "$pkgdir/opt/telegram-history-dump" + + install -d "$pkgdir/usr/bin" + install -m0755 "telegram-history-dump.sh" "$pkgdir/usr/bin/telegram-history-dump" +} + + +sha512sums=('SKIP' + '6e7001e1d65038ae93d993e61c369ab69989d33ab841eaf33b377c138f2bcddc129435889231b1b310d3b1b17eed269b072ca783a5715750932bec902f905aa6' + 'f06044b1da5a3c2e5d51f4161b923bc0e95cb896b0ab93bd898d14771d3c1caf5b5c66bf915ac6ae38a85397d52841e4067959dd5e6023df2a20e8c6675492e2') diff --git a/telegram-history-dump.patch b/telegram-history-dump.patch new file mode 100644 index 000000000000..9210238fd2e6 --- /dev/null +++ b/telegram-history-dump.patch @@ -0,0 +1,26 @@ +diff --git a/config.yaml b/config.yaml +index 2edbea3..d95caa1 100644 +--- a/config.yaml ++++ b/config.yaml +@@ -56,7 +56,7 @@ + # Target directory for the backup files + # If this is a relative path it will be relative to the script's directory + # Absolute path starts with '/' or '~' +- backup_dir: './output' ++ backup_dir: '~/telegram-history-dump/output' + + # Maximum number of messages to backup for each target (0 means unlimited) + backlog_limit: 0 +diff --git a/telegram-history-dump.rb b/telegram-history-dump.rb +index cfb2fc2..a6c6077 100755 +--- a/telegram-history-dump.rb ++++ b/telegram-history-dump.rb +@@ -226,7 +226,7 @@ end + + $config = YAML.load_file( + cli_opts.cfgfile || +- File.expand_path('../config.yaml', __FILE__) ++ File.expand_path('~/telegram-history-dump/config.yaml', __FILE__) + ) + $log = Logger.new(STDOUT) + diff --git a/telegram-history-dump.sh b/telegram-history-dump.sh new file mode 100644 index 000000000000..9873de3287ab --- /dev/null +++ b/telegram-history-dump.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ ! -d ~/telegram-history-dump ]; then + mkdir ~/telegram-history-dump +fi +if [ ! -f ~/telegram-history-dump/config.yaml ]; then + cp /opt/telegram-history-dump/config.yaml ~/telegram-history-dump/config.yaml + cat << EOF +Created configuration file at ~/telegram-history-dump/config.yaml +Please edit this config file first and then execute this command again + +Also REMEMBER you MUST execute telegram-cli first with: + telegram-cli --json -P 9009 + +EOF + exit 0 +fi + +ruby /opt/telegram-history-dump/telegram-history-dump.rb |