summaryrefslogtreecommitdiff
path: root/net-im/telegram
diff options
context:
space:
mode:
authorKris Moore <kmoore@FreeBSD.org>2014-11-20 13:55:45 +0000
committerKris Moore <kmoore@FreeBSD.org>2014-11-20 13:55:45 +0000
commit5fac2dd60d0533f1c2a55dfe8f73e75cedd96245 (patch)
tree98591684ffc84128637d2ee2024b4b5548b170db /net-im/telegram
parent- Upgrade to 0.04006. (diff)
- Rename net-im/tg to net-im/telegram
Approved by: Maintainer <gahr@>
Notes
Notes: svn path=/head/; revision=372929
Diffstat (limited to 'net-im/telegram')
-rw-r--r--net-im/telegram/Makefile37
-rw-r--r--net-im/telegram/distinfo2
-rw-r--r--net-im/telegram/files/patch-main.c19
-rw-r--r--net-im/telegram/files/patch-mtproto-client.c11
-rw-r--r--net-im/telegram/files/patch-net.c15
-rw-r--r--net-im/telegram/pkg-descr3
6 files changed, 87 insertions, 0 deletions
diff --git a/net-im/telegram/Makefile b/net-im/telegram/Makefile
new file mode 100644
index 000000000000..d061a50f0d92
--- /dev/null
+++ b/net-im/telegram/Makefile
@@ -0,0 +1,37 @@
+# Created by: gahr
+# $FreeBSD$
+
+PORTNAME= telegram
+PORTVERSION= 1.0.5.1
+PORTREVISION= 1
+CATEGORIES= net-im
+
+MAINTAINER= gahr@FreeBSD.org
+COMMENT= Command-line interface for Telegram
+
+LICENSE= GPLv2
+
+LIB_DEPENDS= libconfig.so:${PORTSDIR}/devel/libconfig \
+ libevent.so:${PORTSDIR}/devel/libevent2
+
+USE_GITHUB= yes
+GH_ACCOUNT= vysheng
+GH_PROJECT= tg
+GH_TAGNAME= 1.0.5.1
+GH_COMMIT= 77bbb4c
+
+USES= execinfo gmake lua:52 ncurses pkgconfig readline
+USE_OPENSSL= yes
+GNU_CONFIGURE= yes
+
+PLIST_FILES= bin/telegram-cli \
+ etc/tg-server.pub
+
+post-patch:
+ ${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/main.c
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/bin/telegram-cli ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/tg-server.pub ${STAGEDIR}${PREFIX}/etc
+
+.include <bsd.port.mk>
diff --git a/net-im/telegram/distinfo b/net-im/telegram/distinfo
new file mode 100644
index 000000000000..114bee0c4b3e
--- /dev/null
+++ b/net-im/telegram/distinfo
@@ -0,0 +1,2 @@
+SHA256 (tg-1.0.5.1.tar.gz) = 42fcb2208a3534f15277fe466f9372db088910e7c5aa550b3e2269b84152aa31
+SIZE (tg-1.0.5.1.tar.gz) = 390920
diff --git a/net-im/telegram/files/patch-main.c b/net-im/telegram/files/patch-main.c
new file mode 100644
index 000000000000..8a244f95f659
--- /dev/null
+++ b/net-im/telegram/files/patch-main.c
@@ -0,0 +1,19 @@
+--- main.c.orig 2014-09-24 12:35:27.000000000 +0200
++++ main.c 2014-10-02 10:22:46.000000000 +0200
+@@ -59,6 +59,7 @@
+
+ #include <grp.h>
+ #include <arpa/inet.h>
++#include <netinet/in.h>
+
+ #include "telegram.h"
+ #include "loop.h"
+@@ -803,7 +804,7 @@
+ running_for_first_time ();
+ parse_config ();
+
+- tgl_set_rsa_key ("/etc/" PROG_NAME "/server.pub");
++ tgl_set_rsa_key ("%%PREFIX%%/etc/tg-server.pub");
+ tgl_set_rsa_key ("tg-server.pub");
+
+
diff --git a/net-im/telegram/files/patch-mtproto-client.c b/net-im/telegram/files/patch-mtproto-client.c
new file mode 100644
index 000000000000..011466f363b1
--- /dev/null
+++ b/net-im/telegram/files/patch-mtproto-client.c
@@ -0,0 +1,11 @@
+--- mtproto-client.c.orig 2014-10-02 12:07:49.000000000 +0200
++++ mtproto-client.c 2014-10-02 12:08:13.000000000 +0200
+@@ -80,7 +80,7 @@
+ #define MAX_NET_RES (1L << 16)
+ //extern int log_level;
+
+-#ifndef HAVE___BUILTIN_BSWAP32
++#if !defined(HAVE___BUILTIN_BSWAP32) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+ static inline unsigned __builtin_bswap32(unsigned x) {
+ return ((x << 24) & 0xff000000 ) |
+ ((x << 8) & 0x00ff0000 ) |
diff --git a/net-im/telegram/files/patch-net.c b/net-im/telegram/files/patch-net.c
new file mode 100644
index 000000000000..7a8700aab864
--- /dev/null
+++ b/net-im/telegram/files/patch-net.c
@@ -0,0 +1,15 @@
+--- net.c.orig 2014-10-02 12:12:58.000000000 +0200
++++ net.c 2014-10-02 12:13:09.000000000 +0200
+@@ -26,11 +26,11 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <assert.h>
++#include <sys/types.h>
+ #include <netdb.h>
+ #include <netinet/in.h>
+ #include <netinet/tcp.h>
+ #include <sys/fcntl.h>
+-#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <errno.h>
+ #include <stdio.h>
diff --git a/net-im/telegram/pkg-descr b/net-im/telegram/pkg-descr
new file mode 100644
index 000000000000..8ef7426e0c17
--- /dev/null
+++ b/net-im/telegram/pkg-descr
@@ -0,0 +1,3 @@
+tg is a command-line interface for the Telegram instant-messaging network.
+
+WWW: https://github.com/vysheng/tg