# Copyright 2014 Eric Heydenberk # Copyright 2017 Adrien Vergé Summary: A headless WebKit browser with a full JavaScript API. Name: phantomjs Version: 1.9.8 License: BSD Release: 0%{?dist}.1sunshine Source: https://bitbucket.org/ariya/phantomjs/downloads/%{name}-%{version}-linux-x86_64.tar.bz2 BuildRequires: patchelf %if 0%{?el8} Requires: compat-openssl10 %endif %description PhantomJS is a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. PhantomJS is created by Ariya Hidayat. %prep %setup -n %{name}-%{version}-linux-x86_64 -q # The pre-compiled PhantomJS binary used in this package dates from 2014 and is # linked to use libcrypto.so and libssl.so from OpenSSL 1.0, but does not # specify their version (e.g. libcrypto.so.1.0.0). Hence, running PhantomJS # crashes (segmentation fault) on systems with OpenSSL 1.1 installed, because # libcrypto.so and libssl.so refer to the new version 1.1. Removing # /lib64/libssl.so from the system removes the crash, but of course it's not a # real fix. I've tried multiple solutions including using LD_PRELOAD or # patchelf, but the only working I've found is to alter PhantomJS binary to make # it fail loading libcrypto.so and libssl.so. This is it: # cryptooffset=$((0x01ca2c53)) # 30026835, 1.9.7 cryptooffset=$((0x01ca2d53)) test "$(dd if=bin/%{name} bs=1 skip=$cryptooffset count=6 status=none)" = "crypto" && \ printf "xxxxxx" | dd of=bin/%{name} bs=1 seek=$cryptooffset count=6 conv=notrunc %install mkdir -p %{buildroot}%{_bindir} install -p -m755 bin/%{name} %{buildroot}%{_bindir}/%{name} patchelf --remove-rpath %{buildroot}%{_bindir}/%{name} %files %doc ChangeLog README.md examples %license README.md %{_bindir}/%{name} %changelog * Thu Feb 02 2023 Moritz Barsnick 1.9.8-0.1sunshine - update to 1.9.8 - drop most of the explicit Requires, they are determined automatically - use more and better macros - use %%doc and %%licenkpse - drop %%defattr and %%attr - preserve modification times - adapt the offset for fixing the crypto function - remove the bogus RPATH from the binary (BR patchelf) * Tue Jun 30 2020 Adrien Vergé 1.9.7-3 - Require OpenSSL 1.0 on CentOS 8, otherwise crash * Fri Jun 12 2020 Adrien Vergé 1.9.7-2 - Fix incompatibility with OpenSSL 1.1 * Tue Jan 31 2017 Adrien Vergé 1.9.7-1 - Package for copr * Fri Apr 18 2014 Eric Heydenberk - add missing filenames for examples to files section * Tue Apr 30 2013 Eric Heydenberk - add missing filenames for examples to files section * Wed Apr 24 2013 Robin Helgelin - updated to version 1.9 * Thu Jan 24 2013 Matthew Barr - updated to version 1.8 * Thu Nov 15 2012 Jan Schaumann - first rpm version