Merge pull request #286 from stillru/master

Upstart daemon in debian pakage
This commit is contained in:
vysheng 2014-10-11 18:49:13 +04:00
commit 30f7d8e202
14 changed files with 85 additions and 16 deletions

5
.gitignore vendored
View File

@ -12,3 +12,8 @@ objs/
dep/
auto/
libs/
debian/telegram-cli.[a-z]
debian/files
debian/telegram-cli/*
debian/telegram-cli.debhelper.log
debian/telegram-cli.substvars

11
debian/changelog vendored
View File

@ -1,5 +1,12 @@
telegram-cli (1.0.6-1) unstable; urgency=low
* Upstream update version
* Inpliment -e option
-- Steve Illichevsky <still.ru@gmail.com> Sat, 11 Oct 2014 08:47:07 +0400
telegram-cli (1.0.5.1-1) unstable; urgency=low
* Initial release
* Initial release
-- Steve Illichevsky <still.ru@gmail.com> Wed, 01 Oct 2014 21:06:28 +0400
-- Steve Illichevsky <still.ru@gmail.com> Sun, 05 Oct 2014 09:37:06 +0400

2
debian/compat vendored
View File

@ -1 +1 @@
8
9

19
debian/control vendored
View File

@ -3,14 +3,15 @@ Section: net
Priority: extra
Maintainer: Steve Illichevsky <still.ru@gmail.com>
Build-Depends: debhelper (>= 8.0.0),
autotools-dev,
autoconf-archive,
libreadline-dev,
libconfig-dev,
libssl-dev,
lua5.1,
liblua5.1-dev
Standards-Version: 3.9.2
autotools-dev,
autoconf-archive,
libreadline-dev,
libconfig-dev,
libssl-dev,
lua5.1,
liblua5.1-dev,
lua-lgi
Standards-Version: 3.9.5
Homepage: https://github.com/vysheng/tg
Vcs-Git: git://github.com/vysheng/tg.git
Vcs-Browser: https://github.com/vysheng/tg
@ -33,4 +34,4 @@ Description: Command-line interface for Telegram messenger
* 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.
* Multimedia support: send/load photos and videos.

1
debian/files vendored
View File

@ -1 +0,0 @@
telegram-cli_1.0.5.1-1_i386.deb net extra

6
debian/install vendored
View File

@ -1,3 +1,7 @@
bin/telegram-cli usr/bin
bin/tlc usr/bin
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-cli/
#telegram-daemon etc/init.d

4
debian/rules vendored
View File

@ -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
xz ../$(PACKAGE_NAME)_$(VERSION).orig.tar

8
debian/telegram-cli.logrotate vendored Normal file
View File

@ -0,0 +1,8 @@
/var/lib/telegram-cli/*.log {
daily
missingok
rotate 31
compress
notifempty
nocreate
}

View File

@ -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

1
debian/telegram-cli.preinst vendored Normal file
View File

@ -0,0 +1 @@
adduser --system --home /var/lib/telegram-cli --gecos "Telegram Daemon User" --group telegramd

14
debian/telegram-cli.preinst.debhelper vendored Normal file
View File

@ -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

7
debian/telegram-cli.prerm vendored Normal file
View File

@ -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

5
debian/telegram-cli.prerm.debhelper vendored Normal file
View File

@ -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

10
debian/telegram-cli.upstart vendored Normal file
View File

@ -0,0 +1,10 @@
# Service
setuid telegramd
setgid telegramd
script
exec /usr/bin/telegram-cli -s /var/lib/telegram-cli/test.lua -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