diff --git a/debian/changelog b/debian/changelog index ec49f58..105a1b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,7 @@ telegram-cli (1.0.6-1) unstable; urgency=low * Upstream update version * Inpliment -e option - -- Steve Illichevsky Sun, 05 Oct 2014 09:37:06 +0400 + -- Steve Illichevsky Sat, 11 Oct 2014 08:47:07 +0400 telegram-cli (1.0.5.1-1) unstable; urgency=low diff --git a/debian/install b/debian/install index ad1d89c..8fa39a1 100644 --- a/debian/install +++ b/debian/install @@ -1,6 +1,7 @@ bin/telegram-cli usr/bin -bin/telegram-cli usr/share/telegram-daemon/bin -start-telegram-daemon /usr/share/telegram-daemon/bin -test.lua var/lib/telegram-daemon/ -telegram-daemon etc/init.d -server.pub etc/telegram-cli \ No newline at end of file +server.pub etc/telegram-cli + +#bin/telegram-cli usr/share/telegram-daemon/bin +#start-telegram-daemon /usr/share/telegram-daemon/bin +#test.lua var/lib/telegram-daemon/ +#telegram-daemon etc/init.d \ No newline at end of file diff --git a/debian/rules b/debian/rules index 6d3c781..54f9147 100755 --- a/debian/rules +++ b/debian/rules @@ -7,7 +7,7 @@ # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +export DH_VERBOSE=1 VERSION=$(shell dpkg-parsechangelog | sed -n 's/^Version: //p' | cut -f1 -d'-') PACKAGE_NAME=$(shell dpkg-parsechangelog | sed -n 's/^Source: //p') @@ -20,4 +20,4 @@ build-orig: | ( cd $(PACKAGE_NAME)-$(VERSION) && tar xf - ) tar -cf ../$(PACKAGE_NAME)_$(VERSION).orig.tar $(PACKAGE_NAME)-$(VERSION) $(RM) -r $(PACKAGE_NAME)-$(VERSION) - xz ../$(PACKAGE_NAME)_$(VERSION).orig.tar \ No newline at end of file + xz ../$(PACKAGE_NAME)_$(VERSION).orig.tar diff --git a/debian/telegram-cli.logrotate b/debian/telegram-cli.logrotate new file mode 100644 index 0000000..b9bb11c --- /dev/null +++ b/debian/telegram-cli.logrotate @@ -0,0 +1,8 @@ +/var/lib/telegram-cli/*.log { + daily + missingok + rotate 31 + compress + notifempty + nocreate +} diff --git a/debian/telegram-cli.postinst.debhelper b/debian/telegram-cli.postinst.debhelper new file mode 100644 index 0000000..60dba79 --- /dev/null +++ b/debian/telegram-cli.postinst.debhelper @@ -0,0 +1,8 @@ +# Automatically added by dh_installinit +if [ -e "/etc/init/telegram-cli.conf" ]; then + invoke-rc.d telegram-cli start || exit $? +fi +# End automatically added section +# Automatically added by dh_installinit +update-rc.d -f telegram-cli remove >/dev/null || exit $? +# End automatically added section diff --git a/debian/telegram-cli.preinst b/debian/telegram-cli.preinst new file mode 100644 index 0000000..0c9dafa --- /dev/null +++ b/debian/telegram-cli.preinst @@ -0,0 +1 @@ +adduser --system --home /var/lib/telegram-cli --gecos "Telegram Daemon User" --group telegramd \ No newline at end of file diff --git a/debian/telegram-cli.preinst.debhelper b/debian/telegram-cli.preinst.debhelper new file mode 100644 index 0000000..c8384ba --- /dev/null +++ b/debian/telegram-cli.preinst.debhelper @@ -0,0 +1,14 @@ +# Automatically added by dh_installinit +if [ "$1" = install ] || [ "$1" = upgrade ]; then + if [ -e "/etc/init.d/telegram-cli" ] && [ ! -L "/etc/init.d/telegram-cli" ]; then + if [ "`md5sum \"/etc/init.d/telegram-cli\" | sed -e \"s/ .*//\"`" != \ + "`dpkg-query -W -f='${Conffiles}' telegram-cli | sed -n -e \"\\\\' /etc/init.d/telegram-cli '{s/ obsolete$//;s/.* //p}\"`" ] + then + echo "Obsolete conffile /etc/init.d/telegram-cli has been modified by you, renaming to .dpkg-bak" + mv -f "/etc/init.d/telegram-cli" "/etc/init.d/telegram-cli.dpkg-bak" + else + rm -f "/etc/init.d/telegram-cli" + fi + fi +fi +# End automatically added section diff --git a/debian/telegram-cli.prerm b/debian/telegram-cli.prerm new file mode 100644 index 0000000..c8e463c --- /dev/null +++ b/debian/telegram-cli.prerm @@ -0,0 +1,7 @@ +# Automatically added by dh_installinit +if [ -e "/etc/init/telegram-cli.conf" ]; then + invoke-rc.d telegram-cli stop || exit $? +fi +# End automatically added section + +deluser --remove-home telegramd \ No newline at end of file diff --git a/debian/telegram-cli.prerm.debhelper b/debian/telegram-cli.prerm.debhelper new file mode 100644 index 0000000..54db9bc --- /dev/null +++ b/debian/telegram-cli.prerm.debhelper @@ -0,0 +1,5 @@ +# Automatically added by dh_installinit +if [ -e "/etc/init/telegram-cli.conf" ]; then + invoke-rc.d telegram-cli stop || exit $? +fi +# End automatically added section diff --git a/debian/telegram-cli.upstart b/debian/telegram-cli.upstart new file mode 100644 index 0000000..8bd5ffa --- /dev/null +++ b/debian/telegram-cli.upstart @@ -0,0 +1,10 @@ +# Service + +setuid telegramd +setgid telegramd + +script + exec /usr/bin/telegram-cli -W -d -C -vvvv -l 0 -L /var/lib/telegram-cli/telegram-cli.log -P 8002 + # This example for Daemon wich keep log in his home directory + # This daemon can listen localhost:8002 tcp port +end script diff --git a/debian/telegram-cli/DEBIAN/conffiles b/debian/telegram-cli/DEBIAN/conffiles deleted file mode 100644 index b9e0b36..0000000 --- a/debian/telegram-cli/DEBIAN/conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/telegram-cli/server.pub diff --git a/debian/telegram-cli/DEBIAN/control b/debian/telegram-cli/DEBIAN/control deleted file mode 100644 index 7c2e881..0000000 --- a/debian/telegram-cli/DEBIAN/control +++ /dev/null @@ -1,25 +0,0 @@ -Package: telegram-cli -Version: 1.0.6-1 -Architecture: i386 -Maintainer: Steve Illichevsky -Installed-Size: 2414 -Depends: libc6 (>= 2.8), libconfig8 (>= 1.3.2-2), libevent-2.0-5 (>= 2.0.16-stable), liblua5.1-0, libreadline6 (>= 6.0), libssl1.0.0 (>= 1.0.0), zlib1g (>= 1:1.1.4) -Section: net -Priority: extra -Homepage: https://github.com/vysheng/tg -Description: Command-line interface for Telegram messenger - Telegram messenger is a cloud-based instant messaging designed for - smart phones and similar to Whatsapp but more flexible, and - powerful. You can send messages, photos, videos and documents to - people who are in your phone contacts (and have Telegram). Telegram - also supports secret chats whose provide a private (encrypted) way of - communication. - . - This package contains a command-line based client for Telegram with - the following features: - * Colored terminal messages. - * Message management: history, stats, etc. - * Group chat: create and manage groups. - * Secret chat: secured and encrypted conversations. - * Contact management: add/edit/remove contacts. - * Multimedia support: send/load photos and videos. diff --git a/debian/telegram-cli/DEBIAN/md5sums b/debian/telegram-cli/DEBIAN/md5sums deleted file mode 100644 index ae8efa9..0000000 --- a/debian/telegram-cli/DEBIAN/md5sums +++ /dev/null @@ -1,8 +0,0 @@ -fa3223ea6f102c82f09722afb471680c usr/bin/telegram-cli -a491fae59cac8dfd507f262f60c7145d usr/bin/tlc -ee6fbdf0a90599cc893dd1bc52c62df5 usr/share/doc/telegram-cli/README-LUA -0ade98b594fb92d79ba3aa69411949aa usr/share/doc/telegram-cli/README.es.gz -0136d70c21b079cb72401a7f9f67efcb usr/share/doc/telegram-cli/README.md.gz -e3de59df64a4dcca7a4ee2162bed92a7 usr/share/doc/telegram-cli/changelog.Debian.gz -340464ada745a0c792764a501e5b5586 usr/share/doc/telegram-cli/copyright -6b61123786d05dad4fde589934c08cb8 usr/share/man/man8/telegram-cli.8.gz diff --git a/debian/telegram-cli/etc/telegram-cli/server.pub b/debian/telegram-cli/etc/telegram-cli/server.pub deleted file mode 100644 index 5e38bb0..0000000 --- a/debian/telegram-cli/etc/telegram-cli/server.pub +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAwVACPi9w23mF3tBkdZz+zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6 -lyDONS789sVoD/xCS9Y0hkkC3gtL1tSfTlgCMOOul9lcixlEKzwKENj1Yz/s7daS -an9tqw3bfUV/nqgbhGX81v/+7RFAEd+RwFnK7a+XYl9sluzHRyVVaTTveB2GazTw -Efzk2DWgkBluml8OREmvfraX3bkHZJTKX4EQSjBbbdJ2ZXIsRrYOXfaA+xayEGB+ -8hdlLmAjbCVfaigxX0CDqWeR1yFL9kwd9P0NsZRPsmoqVwMbMu7mStFai6aIhc3n -Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB ------END RSA PUBLIC KEY----- diff --git a/debian/telegram-cli/usr/share/doc/telegram-cli/README-LUA b/debian/telegram-cli/usr/share/doc/telegram-cli/README-LUA deleted file mode 100644 index 6553d79..0000000 --- a/debian/telegram-cli/usr/share/doc/telegram-cli/README-LUA +++ /dev/null @@ -1,80 +0,0 @@ -To use lua with client you should write lua script. You can specify it from config ("lua_script" option) or from command_line [-s]. - -It should have several functions: - on_binlog_replay_end() - it is called when replay of old events end. Any updates prior this call were already received by this client - some time ago. - - on_get_difference_end() - it is called after first get_difference call. So we received all updates after last client execute. - - on_our_id(our_id) - Informs about id of currently logged in user. - - on_msg_receive(msg) - it is called when we receive new msg (!! may be called before on_binlog_replay_end, than it is old msg). - - on_user_update(user,what_changed) - updated info about user. what_changed is array of strings. - on_chat_update(user,what_changed) - updated info about user. what_changed is array of strings. - on_secret_chat_update(user,what_changed) - updated info about user. what_changed is array of strings. - - - -Also, you can call several functions. Each this function last two arguments, are cb_function and cb_extra. -These functions may return false immidiately if something is bad with args, or return true and call cb_function in future. -cb_function would have two or three arguments: first cb_extra, second success (1 or 0), third result (if applicable). - -If you want to pass msg to function, you should pass it's id. -If you want to pass peer to function, you should pass it's print_name. -Or, you can pass string user#id chat#id and secret_chat#id as peer. It is in some cases better. For example if you want to postpone and you are afraid, that print_name would be changed in the meantime. - -Function_list (arguments are listed aside from cb_function and cb_extra, : - get_contact_list () - get_dialog_list () - - rename_chat (chat, new_name) - chat_set_photo (chat, file) - - send_msg (peer, text) - fwd_msg (peer, msg) - - send_photo (peer, file) - send_video (peer, file) - send_audio (peer, file) - send_document (peer, file) - send_text (peer, file) - - load_photo(msg) - load_video(msg) - load_video_thumb(msg) - load_audio(msg) - load_document(msg) - load_document_thumb(msg) - - chat_info (chat) - user_info (user) - - get_history (peer, limit) - - chat_add_user (chat, user) - chat_del_user (chat, user) - - add_contactt (phone, first_name, last_name) - rename_contactt (phone, first_name, last_name) - - msg_search (peer, text) - msg_global_search (text) - - mark_read (peer) - - set_profile_photo (file) - - create_secret_chat (user) - create_group_chat (user, name) - - delete_msg (msg) - restore_msg (number) - - status_online () - status_offline () - - send_location (peer, latitude, longitude) - -Also, you have function - postpone (cb_function, cb_extra, timeout). It will call your cb_function in specified number of seconds (number of seconds may be double). diff --git a/debian/telegram-cli/usr/share/doc/telegram-cli/README.es.gz b/debian/telegram-cli/usr/share/doc/telegram-cli/README.es.gz deleted file mode 100644 index 7c7810b..0000000 Binary files a/debian/telegram-cli/usr/share/doc/telegram-cli/README.es.gz and /dev/null differ diff --git a/debian/telegram-cli/usr/share/doc/telegram-cli/README.md.gz b/debian/telegram-cli/usr/share/doc/telegram-cli/README.md.gz deleted file mode 100644 index 9c7b72f..0000000 Binary files a/debian/telegram-cli/usr/share/doc/telegram-cli/README.md.gz and /dev/null differ diff --git a/debian/telegram-cli/usr/share/doc/telegram-cli/changelog.Debian.gz b/debian/telegram-cli/usr/share/doc/telegram-cli/changelog.Debian.gz deleted file mode 100644 index ae23922..0000000 Binary files a/debian/telegram-cli/usr/share/doc/telegram-cli/changelog.Debian.gz and /dev/null differ diff --git a/debian/telegram-cli/usr/share/doc/telegram-cli/copyright b/debian/telegram-cli/usr/share/doc/telegram-cli/copyright deleted file mode 100644 index add9298..0000000 --- a/debian/telegram-cli/usr/share/doc/telegram-cli/copyright +++ /dev/null @@ -1,31 +0,0 @@ -Format: http://dep.debian.net/deps/dep5 -Upstream-Name: telegram-cli -Source: https://github.com/vysheng/tg - -Files: * -Copyright: 2013-2014 Vitaly Valtman -License: GPL-3.0+ - -Files: debian/* -Copyright: 2014 Steve Illichevsky -License: GPL-3.0+ - -License: GPL-3.0+ - 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 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". - -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. diff --git a/debian/telegram-cli/usr/share/man/man8/telegram-cli.8.gz b/debian/telegram-cli/usr/share/man/man8/telegram-cli.8.gz deleted file mode 100644 index e922fe8..0000000 Binary files a/debian/telegram-cli/usr/share/man/man8/telegram-cli.8.gz and /dev/null differ