1 |
commit: b98a03cb4931341204f1e3a339ebb61364b47661 |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 25 16:33:03 2016 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 25 16:33:03 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b98a03cb |
7 |
|
8 |
net-im/mu-conference: Fix connection with long secrets (#505600 by Dmitry A. Bakshaev) |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
.../files/mu-conference-0.8.81-sha1_64bit.patch | 31 +++++++ |
13 |
.../mu-conference/mu-conference-0.8.81-r2.ebuild | 95 ++++++++++++++++++++++ |
14 |
2 files changed, 126 insertions(+) |
15 |
|
16 |
diff --git a/net-im/mu-conference/files/mu-conference-0.8.81-sha1_64bit.patch b/net-im/mu-conference/files/mu-conference-0.8.81-sha1_64bit.patch |
17 |
new file mode 100644 |
18 |
index 00000000..2764daa |
19 |
--- /dev/null |
20 |
+++ b/net-im/mu-conference/files/mu-conference-0.8.81-sha1_64bit.patch |
21 |
@@ -0,0 +1,31 @@ |
22 |
+--- mu-conference-0.8.81/include/lib.h |
23 |
++++ mu-conference-0.8.81/include/lib.h |
24 |
+@@ -114,13 +114,6 @@ |
25 |
+ /* SHA calculations */ |
26 |
+ /* */ |
27 |
+ /* --------------------------------------------------------- */ |
28 |
+-#if (SIZEOF_INT == 4) |
29 |
+-typedef unsigned int uint32; |
30 |
+-#elif (SIZEOF_SHORT == 4) |
31 |
+-typedef unsigned short uint32; |
32 |
+-#else |
33 |
+-typedef unsigned int uint32; |
34 |
+-#endif /* HAVEUINT32 */ |
35 |
+ |
36 |
+ char *shahash(char *str); /* NOT THREAD SAFE */ |
37 |
+ void shahash_r(const char* str, char hashbuf[40]); /* USE ME */ |
38 |
+@@ -301,10 +294,10 @@ |
39 |
+ |
40 |
+ |
41 |
+ typedef struct { |
42 |
+- uint32_t H[5]; |
43 |
+- uint32_t W[80]; |
44 |
++ guint32 H[5]; |
45 |
++ guint32 W[80]; |
46 |
+ int lenW; |
47 |
+- uint32_t sizeHi,sizeLo; |
48 |
++ guint32 sizeHi,sizeLo; |
49 |
+ } j_SHA_CTX; |
50 |
+ |
51 |
+ |
52 |
+ |
53 |
|
54 |
diff --git a/net-im/mu-conference/mu-conference-0.8.81-r2.ebuild b/net-im/mu-conference/mu-conference-0.8.81-r2.ebuild |
55 |
new file mode 100644 |
56 |
index 00000000..133a888 |
57 |
--- /dev/null |
58 |
+++ b/net-im/mu-conference/mu-conference-0.8.81-r2.ebuild |
59 |
@@ -0,0 +1,95 @@ |
60 |
+# Copyright 1999-2016 Gentoo Foundation |
61 |
+# Distributed under the terms of the GNU General Public License v2 |
62 |
+# $Id$ |
63 |
+ |
64 |
+EAPI=6 |
65 |
+ |
66 |
+inherit toolchain-funcs |
67 |
+ |
68 |
+DESCRIPTION="Multi-User Chat for jabberd" |
69 |
+HOMEPAGE="https://gna.org/projects/mu-conference/" |
70 |
+SRC_URI="http://download.gna.org/mu-conference/${P}.tar.gz" |
71 |
+ |
72 |
+LICENSE="GPL-2" |
73 |
+KEYWORDS="~amd64 ~ppc ~sparc ~x86" |
74 |
+SLOT="0" |
75 |
+IUSE="mysql" |
76 |
+ |
77 |
+RDEPEND=" |
78 |
+ dev-libs/expat |
79 |
+ >=dev-libs/glib-2:2 |
80 |
+ net-dns/libidn |
81 |
+ net-im/jabberd2 |
82 |
+ mysql? ( virtual/mysql ) |
83 |
+" |
84 |
+DEPEND="${RDEPEND} |
85 |
+ virtual/pkgconfig |
86 |
+" |
87 |
+ |
88 |
+PATCHES=( |
89 |
+ # http://gna.org/bugs/?16238 |
90 |
+ "${FILESDIR}"/${P}-sha1_64bit.patch |
91 |
+) |
92 |
+ |
93 |
+src_prepare() { |
94 |
+ # Fix missing header in src/conference_user.c in order to |
95 |
+ # make emerge happy and avoid QA notice. |
96 |
+ sed -i -e "/conference.h/ i #define _XOPEN_SOURCE" src/conference_user.c || die |
97 |
+ |
98 |
+ if use mysql; then |
99 |
+ sed -i -e '/^CFLAGS/ a CFLAGS:=$(CFLAGS) -DHAVE_MYSQL' \ |
100 |
+ -e '/^LIBS/ a LIBS:=$(LIBS) `mysql_config --libs`' src/Makefile || die |
101 |
+ fi |
102 |
+ sed -i -e 's/^CC:=/CC?=/' -e 's/$(MCFLAGS)/$(MCFLAGS) $(LDFLAGS)/'\ |
103 |
+ -e 's/LDFLAGS:=-L./LDFLAGS:=$(LDFLAGS) -L./'\ |
104 |
+ -e 's/$(LDFLAGS) $(LIBS)/$(LIBS)/' src/Makefile || die |
105 |
+ sed -i -e 's/-O2//' src/{,jabberd,jcomp}/Makefile || die |
106 |
+ sed -i -e 's/CC=/CC?=/' src/{jabberd,jcomp}/Makefile || die |
107 |
+ sed -i -e 's/ar/$(AR)/' -e 's/ranlib/$(RANLIB)/' src/jabberd/Makefile || die |
108 |
+ sed -i -e 's/gcc -g/$(CC) -g/' src/jcomp/Makefile || die |
109 |
+ tc-export CC AR RANLIB |
110 |
+ |
111 |
+ default |
112 |
+} |
113 |
+ |
114 |
+src_install() { |
115 |
+ dobin src/mu-conference |
116 |
+ fowners jabber:jabber /usr/bin/mu-conference |
117 |
+ fperms 750 /usr/bin/mu-conference |
118 |
+ |
119 |
+ newinitd "${FILESDIR}/${PN}"-0.7.init mu-conference |
120 |
+ |
121 |
+ dodoc ChangeLog FAQ mu-conference.sql README README.sql |
122 |
+ docinto scripts |
123 |
+ dodoc scripts/* |
124 |
+ |
125 |
+ local i |
126 |
+ for i in log spool; do |
127 |
+ dodir /var/${i}/jabber/mu-conference |
128 |
+ keepdir /var/${i}/jabber/mu-conference |
129 |
+ fowners jabber:jabber /var/${i}/jabber/mu-conference |
130 |
+ fperms 770 /var/${i}/jabber/mu-conference |
131 |
+ done |
132 |
+ |
133 |
+ insinto /etc/jabber |
134 |
+ newins muc-default.xml mu-conference.xml |
135 |
+ doins style.css |
136 |
+ |
137 |
+ sed -i \ |
138 |
+ -e 's,./spool/chat.localhost,/var/spool/jabber/mu-conference,g' \ |
139 |
+ -e 's,./syslogs,/var/log/jabber,g' \ |
140 |
+ -e 's,./logs,/var/log/jabber/mu-conference,g' \ |
141 |
+ -e 's,./mu-conference.pid,/var/run/jabber/mu-conference.pid,g' \ |
142 |
+ -e "s,../style.css,/etc/jabber/style.css,g" \ |
143 |
+ -e "s,7009,5347,g" \ |
144 |
+ "${D}"/etc/jabber/mu-conference.xml || die "sed failed" |
145 |
+} |
146 |
+ |
147 |
+pkg_postinst() { |
148 |
+ echo |
149 |
+ elog "For jabberd-2 connection:" |
150 |
+ elog "1. Make sure that the ip and port in /etc/jabber/mu-conference.xml" |
151 |
+ elog " match the address of your jabberd router." |
152 |
+ elog "2. Set a common secret in mu-conference.xml and router.xml" |
153 |
+ echo |
154 |
+} |