From d44c0fa24844542174bde279065ae93119c8ec46 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Tue, 4 Oct 2022 02:38:00 +0200 Subject: [PATCH] initial package creation Signed-off-by: Toshaan Bharvani --- SOURCES/libotr-4.1.1-versioning.patch | 24 +++++++++ SPECS/libotr.spec | 77 +++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 SOURCES/libotr-4.1.1-versioning.patch create mode 100644 SPECS/libotr.spec diff --git a/SOURCES/libotr-4.1.1-versioning.patch b/SOURCES/libotr-4.1.1-versioning.patch new file mode 100644 index 0000000..97bb8dd --- /dev/null +++ b/SOURCES/libotr-4.1.1-versioning.patch @@ -0,0 +1,24 @@ +diff -Naur libotr-4.1.1-orig/src/proto.c libotr-4.1.1/src/proto.c +--- libotr-4.1.1-orig/src/proto.c 2016-03-06 08:13:55.000000000 -0500 ++++ libotr-4.1.1/src/proto.c 2021-05-18 20:39:41.552548682 -0400 +@@ -54,6 +54,12 @@ + { + unsigned int api_version; + ++/* See: ++ * https://bugzilla.redhat.com/show_bug.cgi?id=1634321 ++ * https://github.com/psi-im/plugins/issues/7#issuecomment-423048948 ++ */ ++#if 0 ++ + /* The major versions have to match, and you can't be using a newer + * minor version than we expect. */ + if (ver_major != OTRL_VERSION_MAJOR || ver_minor > OTRL_VERSION_MINOR) { +@@ -63,6 +69,7 @@ + OTRL_VERSION_MAJOR, OTRL_VERSION_MINOR, OTRL_VERSION_SUB); + return gcry_error(GPG_ERR_INV_VALUE); + } ++#endif + + /* Set the API version. If we get called multiple times for some + * reason, take the smallest value. */ diff --git a/SPECS/libotr.spec b/SPECS/libotr.spec new file mode 100644 index 0000000..acbfbbe --- /dev/null +++ b/SPECS/libotr.spec @@ -0,0 +1,77 @@ +%global snapshot 0 +Summary: Off-The-Record Messaging library and toolkit +Name: libotr +Version: 4.1.1 +Release: 1%{?dist} +License: GPLv2 and LGPLv2 +Source0: http://otr.cypherpunks.ca/%{name}-%{version}.tar.gz +Url: http://otr.cypherpunks.ca/ +Provides: libotr-toolkit = %{version} +Obsoletes: libotr-toolkit < %{version} +Requires: libgcrypt >= 1.2.0 +Requires: pkgconfig +BuildRequires: make +BuildRequires: gcc +BuildRequires: libgcrypt-devel >= 1.2.0, libgpg-error-devel +%if %{snapshot} +Buildrequires: libtool automake autoconf +%endif + +Patch1: libotr-4.1.1-versioning.patch + +%description +Off-the-Record Messaging Library and Toolkit +This is a library and toolkit which implements Off-the-Record (OTR) Messaging. +OTR allows you to have private conversations over IM by providing Encryption, +Authentication, Deniability and Perfect forward secrecy. + +%package devel +Summary: Development library and include files for libotr +Requires: %{name} = %{version}-%{release}, libgcrypt-devel >= 1.2.0 +Conflicts: libotr3-devel + +%description devel +The devel package contains the libotr library and include files. + +%prep +%setup -q +%patch1 -p1 + +%if %{snapshot} +aclocal +intltoolize --force --copy +autoreconf -s -i +%endif + +%build +%configure --with-pic --disable-rpath --disable-static +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +make %{?_smp_mflags} all + +%install +rm -rf $RPM_BUILD_ROOT +make \ + DESTDIR=$RPM_BUILD_ROOT \ + LIBINSTDIR=%{_libdir} \ + install +rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la + +%ldconfig_scriptlets + +%files +%doc AUTHORS README COPYING COPYING.LIB NEWS Protocol* +%{_libdir}/libotr.so.* +%{_bindir}/* +%{_mandir}/man1/* + +%files devel +%doc ChangeLog +%{_libdir}/libotr.so +%{_libdir}/pkgconfig/libotr.pc +%dir %{_includedir}/libotr +%{_includedir}/libotr/* +%{_datadir}/aclocal/* + + +%changelog