From: Jakub Bogusz Date: Sun, 7 Mar 2021 05:58:58 +0000 (+0100) Subject: - updated to 3.1.2 X-Git-Tag: auto/th/zephyr-3.1.2-1 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=58f98edd2623b899aeb45a5f0261a0dee81fa862;p=packages%2Fzephyr.git - updated to 3.1.2 - heimdal patch to complete heimdal Kerberos5 support --- 58f98edd2623b899aeb45a5f0261a0dee81fa862 diff --git a/zephyr-heimdal.patch b/zephyr-heimdal.patch new file mode 100644 index 0000000..3da0c33 --- /dev/null +++ b/zephyr-heimdal.patch @@ -0,0 +1,150 @@ +--- zephyr-3.1.2/lib/ZMkAuth.c.orig 2013-10-28 05:21:44.000000000 +0100 ++++ zephyr-3.1.2/lib/ZMkAuth.c 2021-03-05 21:41:58.211169636 +0100 +@@ -126,10 +126,10 @@ + keyblock = Z_credskey(creds); + + if (Z_keys_head && +- Z_keys_head->keyblock->enctype == keyblock->enctype && +- Z_keys_head->keyblock->length == keyblock->length && +- memcmp(Z_keys_head->keyblock->contents, keyblock->contents, +- keyblock->length) == 0) { ++ Z_enctype(Z_keys_head->keyblock) == Z_enctype(keyblock) && ++ Z_keylen(Z_keys_head->keyblock) == Z_keylen(keyblock) && ++ memcmp(Z_keydata(Z_keys_head->keyblock), Z_keydata(keyblock), ++ Z_keylen(keyblock)) == 0) { + /* + * Optimization: if the key hasn't changed, replace the current entry, + * rather than make a new one. +--- zephyr-3.1.2/lib/ZDumpSession.c.orig 2013-10-28 05:21:44.000000000 +0100 ++++ zephyr-3.1.2/lib/ZDumpSession.c 2021-03-05 22:11:03.011717241 +0100 +@@ -42,7 +42,7 @@ + for (key = Z_keys_head; key != NULL; key = key->next) { + num_keys++; + len += 4 + 4; /* enctype, length */ +- len += key->keyblock->length; /* contents */ ++ len += Z_keylen(key->keyblock); /* contents */ + } + #endif + +@@ -56,10 +56,10 @@ + #ifdef HAVE_KRB5 + *((uint32_t *)ptr) = htonl(num_keys); ptr += 4; + for (key = Z_keys_tail; key != NULL; key = key->prev) { +- *((uint32_t*) ptr) = htonl(key->keyblock->enctype); ptr += 4; +- *((uint32_t*) ptr) = htonl(key->keyblock->length); ptr += 4; +- memcpy(ptr, key->keyblock->contents, key->keyblock->length); +- ptr += key->keyblock->length; ++ *((uint32_t*) ptr) = htonl(Z_enctype(key->keyblock)); ptr += 4; ++ *((uint32_t*) ptr) = htonl(Z_keylen(key->keyblock)); ptr += 4; ++ memcpy(ptr, Z_keydata(key->keyblock), Z_keylen(key->keyblock)); ++ ptr += Z_keylen(key->keyblock); + } + #endif + +@@ -110,12 +110,12 @@ + free(key); + return (EINVAL); + } +- ret = krb5_init_keyblock(Z_krb5_ctx, enctype, keylength, &key->keyblock); ++ ret = Z_krb5_init_keyblock(Z_krb5_ctx, enctype, keylength, &key->keyblock); + if (ret) { + free(key); + return ret; + } +- memcpy((char *)key->keyblock->contents, buffer, keylength); ++ memcpy((char *)Z_keydata(key->keyblock), buffer, keylength); + buffer += keylength; len -= keylength; + /* Just set recent times. It means we might not be able to + retire the keys, but that's fine. */ +--- zephyr-3.1.2/lib/Zinternal.c.orig 2013-10-28 05:21:44.000000000 +0100 ++++ zephyr-3.1.2/lib/Zinternal.c 2021-03-06 08:54:08.562681386 +0100 +@@ -1420,3 +1420,30 @@ + #endif + } + #endif ++ ++#ifdef HAVE_KRB5 ++krb5_error_code ++Z_krb5_init_keyblock(krb5_context context, ++ krb5_enctype type, ++ size_t size, ++ krb5_keyblock **key) ++{ ++#ifdef HAVE_KRB5_CREDS_KEYBLOCK_ENCTYPE ++ return krb5_init_keyblock(context, type, size, key); ++#else ++ krb5_error_code ret; ++ krb5_keyblock *tmp, tmp_ss; ++ tmp = &tmp_ss; ++ ++ *key = NULL; ++ Z_enctype(tmp) = type; ++ Z_keylen(tmp) = size; ++ Z_keydata(tmp) = malloc(size); ++ if (!Z_keydata(tmp)) ++ return ENOMEM; ++ ret = krb5_copy_keyblock(context, tmp, key); ++ free(Z_keydata(tmp)); ++ return ret; ++#endif ++} ++#endif +--- zephyr-3.1.2/h/internal.h.orig 2013-10-28 05:21:44.000000000 +0100 ++++ zephyr-3.1.2/h/internal.h 2021-03-06 08:52:45.043133850 +0100 +@@ -205,4 +205,9 @@ + #define Z_tktprinc(tkt) ((tkt)->client) + #endif + ++#ifdef HAVE_KRB5 ++krb5_error_code Z_krb5_init_keyblock(krb5_context, krb5_enctype, size_t, ++ krb5_keyblock **); ++#endif ++ + #endif /* __INTERNAL_H__ */ +--- zephyr-3.1.2/server/kstuff.c.orig 2013-10-28 05:21:44.000000000 +0100 ++++ zephyr-3.1.2/server/kstuff.c 2021-03-06 08:55:24.682269010 +0100 +@@ -701,33 +701,6 @@ + + return checksum; + } +-#endif +- +-#ifdef HAVE_KRB5 +-krb5_error_code +-Z_krb5_init_keyblock(krb5_context context, +- krb5_enctype type, +- size_t size, +- krb5_keyblock **key) +-{ +-#ifdef HAVE_KRB5_CREDS_KEYBLOCK_ENCTYPE +- return krb5_init_keyblock(context, type, size, key); +-#else +- krb5_error_code ret; +- krb5_keyblock *tmp, tmp_ss; +- tmp = &tmp_ss; +- +- *key = NULL; +- Z_enctype(tmp) = type; +- Z_keylen(tmp) = size; +- Z_keydata(tmp) = malloc(size); +- if (!Z_keydata(tmp)) +- return ENOMEM; +- ret = krb5_copy_keyblock(context, tmp, key); +- free(Z_keydata(tmp)); +- return ret; +-#endif +-} + + void + ZSetSession(krb5_keyblock *keyblock) { +--- zephyr-3.1.2/server/zserver.h.orig 2021-03-06 08:52:57.593065861 +0100 ++++ zephyr-3.1.2/server/zserver.h 2021-03-06 08:53:00.516383357 +0100 +@@ -37,8 +37,6 @@ + extern krb5_keyblock *__Zephyr_keyblock; + #define ZGetSession() (__Zephyr_keyblock) + void ZSetSession(krb5_keyblock *keyblock); +-krb5_error_code Z_krb5_init_keyblock(krb5_context, krb5_enctype, size_t, +- krb5_keyblock **); + #endif + + #ifdef HAVE_KRB4 diff --git a/zephyr.spec b/zephyr.spec new file mode 100644 index 0000000..7faef2c --- /dev/null +++ b/zephyr.spec @@ -0,0 +1,191 @@ +# TODO: init scripts/service files for zephyrd and zhm +# +# Conditional build: +%bcond_without apidocs # API documentation +%bcond_with hesiod # Hesiod support +%bcond_without kerberos5 # Kerberos 5 support +%bcond_without static_libs # static library +# +Summary: Project Athena's notification service +Summary(pl.UTF-8): Usługa powiadomień z Projektu Athena +Name: zephyr +Version: 3.1.2 +Release: 1 +License: MIT +Group: Libraries +#Source0Download: https://github.com/zephyr-im/zephyr/releases +Source0: https://github.com/zephyr-im/zephyr/archive/%{version}/%{name}-%{version}.tar.gz +# Source0-md5: f41be8ee4383d100d4eeb7ed7de0e018 +Patch0: %{name}-heimdal.patch +URL: https://github.com/zephyr-im/zephyr +BuildRequires: autoconf >= 2.50 +BuildRequires: automake +BuildRequires: bison +BuildRequires: c-ares-devel +BuildRequires: flex +%{?with_kerberos5:BuildRequires: heimdal-devel} +%{?with_hesiod:BuildRequires: hesiod-devel} +BuildRequires: libcom_err-devel +BuildRequires: libss-devel +BuildRequires: libtool +BuildRequires: ncurses-devel +BuildRequires: xorg-lib-libX11-devel +# if using noarch subpackages: +#BuildRequires: rpm-build >= 4.6 +Requires: %{name}-libs = %{version}-%{release} +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +Zephyr allows users to send messages to other users or to groups of +users. Users can view incoming Zephyr messages as windowgrams +(transient X windows) or as text on a terminal. Zephyr can optionally +make use of the Kerberos security library or the Hesiod service name +resolution library. + +This package contains Zephyr clients. + +%description -l pl.UTF-8 +Zephyr pozwala użytkownikom wysyłać wiadomości do innych użytkowników +lub grup użytkowników. Użytkownicy mogą zobaczyć przychodzące +wiadomości Zephyra jako oknogramy (przemijające okienka X) albo jako +tekst na terminalu. Zephyr opcjonalnie może wykorzystywać bibliotekę +bezpieczeństwa Kerberos lub bibliotekę rozwiązywania nazw usług +Hesiod. + +Ten pakiet zawiera programy klienckie Zephyra. + +%package server +Summary: Zephyr server +Summary(pl.UTF-8): Serwer usługi Zephyr +Group: Networking/Daemons +Requires: %{name}-libs = %{version}-%{release} + +%description server +zephyrd is the central server for the Zephyr Notification System. It +maintains a location database of all currently logged-in users, and a +subscription database for each user's Zephyr clients. + +%description server -l pl.UTF-8 +zephyrd to centralny serwer systemu powiadomień Zephyr. Utrzymuje bazę +danych lokalizacji wszystkich aktualnie zalogowanych użytkowników oraz +bazę danych subskrypcji klientów Zephyra dla każdego użytkownika. + +%package libs +Summary: Zephyr service shared library +Summary(pl.UTF-8): Biblioteka współdzielona usługi Zephyr +Group: Libraries + +%description libs +Zephyr service shared library. + +%description libs -l pl.UTF-8 +Biblioteka współdzielona usługi Zephyr. + +%package devel +Summary: Header files for Zephyr library +Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Zephyr +Group: Development/Libraries +Requires: %{name}-libs = %{version}-%{release} +%{?with_kerberos5:Requires: heimdal-devel} +%{?with_hesiod:Requires: hesiod-devel} + +%description devel +Header files for Zephyr library. + +%description devel -l pl.UTF-8 +Pliki nagłówkowe biblioteki Zephyr. + +%package static +Summary: Static Zephyr library +Summary(pl.UTF-8): Statyczna biblioteka Zephyr +Group: Development/Libraries +Requires: %{name}-devel = %{version}-%{release} + +%description static +Static Zephyr library. + +%description static -l pl.UTF-8 +Statyczna biblioteka Zephyr. + +%prep +%setup -q +%patch0 -p1 + +%{__sed} -i -e 's/__DEV__/%{version}/' configure.ac + +%build +%{__libtoolize} +%{__aclocal} -I m4 +%{__autoconf} +%{__autoheader} +%configure \ + %{!?with_static_libs:--disable-static} \ + %{?with_hesiod:--with-hesiod} \ + %{?with_kerberos5:--with-krb5} +%{__make} + +%install +rm -rf $RPM_BUILD_ROOT + +%{__make} install \ + DESTDIR=$RPM_BUILD_ROOT + +# obsoleted by pkg-config +%{__rm} $RPM_BUILD_ROOT%{_libdir}/libzephyr.la + +%clean +rm -rf $RPM_BUILD_ROOT + +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig + +%files +%defattr(644,root,root,755) +%attr(755,root,root) %{_bindir}/zaway +%attr(755,root,root) %{_bindir}/zctl +%attr(755,root,root) %{_bindir}/zleave +%attr(755,root,root) %{_bindir}/zlocate +%attr(755,root,root) %{_bindir}/znol +%attr(755,root,root) %{_bindir}/zstat +%attr(755,root,root) %{_bindir}/zwgc +%attr(755,root,root) %{_bindir}/zwrite +%attr(755,root,root) %{_sbindir}/zhm +%attr(755,root,root) %{_sbindir}/zshutdown_notify +%{_datadir}/zephyr +%{_mandir}/man1/zaway.1* +%{_mandir}/man1/zctl.1* +%{_mandir}/man1/zephyr.1* +%{_mandir}/man1/zleave.1* +%{_mandir}/man1/zlocate.1* +%{_mandir}/man1/znol.1* +%{_mandir}/man1/zwgc.1* +%{_mandir}/man1/zwrite.1* +%{_mandir}/man8/zhm.8* +%{_mandir}/man8/zshutdown_notify.8* +%{_mandir}/man8/zstat.8* + +%files server +%defattr(644,root,root,755) +%attr(755,root,root) %{_sbindir}/zephyrd +%dir %{_sysconfdir}/zephyr +%dir %{_sysconfdir}/zephyr/acl +%config(noreplace) %verify(not md5,mtime,size) %{_sysconfdir}/zephyr/default.subscriptions +%{_mandir}/man8/zephyrd.8* + +%files libs +%defattr(644,root,root,755) +%doc NOTES OPERATING README.in USING h/zephyr/mit-copyright.h +%attr(755,root,root) %{_libdir}/libzephyr.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libzephyr.so.4 + +%files devel +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libzephyr.so +%{_includedir}/zephyr +%{_pkgconfigdir}/zephyr.pc + +%if %{with static_libs} +%files static +%defattr(644,root,root,755) +%{_libdir}/libzephyr.a +%endif