Skip to content

Commit

Permalink
- EL8: implant libsignal_jni.so from https://github.com/exquo/signal-…
Browse files Browse the repository at this point in the history
…libs-build/ to fix minimum required GLIBC_2.33 by upstream

- Add check section
  • Loading branch information
pbiering committed Aug 20, 2023
1 parent 655160d commit e68eeb1
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion signal-cli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
## MAIN VERSIONS+RELEASE
%global version_signal_cli 0.12.0

%global release_token 3
# EL8: since 0.12.0 bundled libsignal_jni.so requires GLIBC_2.33 while has only 2.28 -> build from https://github.com/exquo/signal-libs-build/ is required
%global version_libsignal 0.30.0

%global release_token 4

## VIRTUALENV+BUNDLED-AS-REQUIRED by EL+EPEL destination directories
%global basedir /usr/lib/%{pname}
Expand All @@ -45,6 +48,9 @@ URL: https://github.com/AsamK/signal-cli

Source0: https://github.com/AsamK/signal-cli/releases/download/v%{version}/signal-cli-%{version}-Linux.tar.gz

# only used on EL8 since 0.12.0
Source1: https://github.com/exquo/signal-libs-build/releases/download/libsignal_v%{version_libsignal}/libsignal_jni.so-v%{version_libsignal}-x86_64-unknown-linux-gnu.tar.gz


## config files taken+adjusted from https://github.com/AsamK/signal-cli/tree/master/data

Expand All @@ -65,6 +71,8 @@ Requires: java-17-openjdk-headless
BuildRequires: wget
BuildRequires: rpmdevtools

# for testing the build
BuildRequires: java-17-openjdk-headless


%description
Expand Down Expand Up @@ -106,6 +114,16 @@ install -d -p %{buildroot}%{basedir}
# remove non Linux files
%{__rm} %{buildroot}%{basedir}/bin/%{pname}.bat

# replace libsignal_jni.so
%if 0%{?rhel} == 8
%{__tar} xf %{SOURCE1} -C %{buildroot}%{basedir}
# check compatibility
ldd %{buildroot}%{basedir}/libsignal_jni.so
# implant libsignal
zip -j %{buildroot}%{basedir}/lib/libsignal-client-%{version_libsignal}.jar %{buildroot}%{basedir}/libsignal_jni.so
# remove
%{__rm} %{buildroot}%{basedir}/libsignal_jni.so
%endif

### wrapper scripts
install -d -p %{buildroot}%{_bindir}
Expand Down Expand Up @@ -161,6 +179,10 @@ find %{buildroot}%{_unitdir} -type f | while read file; do
done


%check
%{buildroot}%{basedir}/bin/signal-cli --version


%pre
# User & Group
if getent group %{scgroup} >/dev/null; then
Expand Down Expand Up @@ -249,6 +271,10 @@ systemctl condrestart %{pname}.service


%changelog
* Sun Aug 20 2023 Peter Bieringer <[email protected]> - 0.12.0-4
- EL8: implant libsignal_jni.so from https://github.com/exquo/signal-libs-build/ to fix minimum required GLIBC_2.33 by upstream
- Add check section

* Sat Aug 19 2023 Peter Bieringer <[email protected]> - 0.12.0-3
- New upstream version 0.12.0

Expand Down

0 comments on commit e68eeb1

Please sign in to comment.