%global snap %{lua:print(os.date('%Y%m%d'))} # The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %endif %global libname %mklibname %{name} %global makemacros PREFIX=%{buildroot}/%{_prefix}/ bindir=%{buildroot}/%{_bindir}/ libdir=%{buildroot}/%{_libdir}/ mandir=%{buildroot}/%{_mandir}/man1/ Name: lz4json Version: 2 Release: 0.git%{snap}.1%{?dist} Summary: C decompress tool for mozilla lz4json format License: BSD URL: https://github.com/andikleen/lz4json Source0: https://github.com/andikleen/lz4json/archive/refs/tags/v%{version}/lz4json-%{version}.tar.gz Patch0: https://github.com/andikleen/lz4json/compare/v2...alichtman:lz4json:master.diff BuildRequires: gcc BuildRequires: make BuildRequires: pkgconfig(liblz4) %description A little utility to unpack lz4json files as generated by Firefox's bookmark backups and session restore. This is a different format from what the normal lz4 utility expects. The data is dumped to stdout. %package -n %{libname} Summary: The shared library for %{name}. %description -n %{libname} The shared library for %{name}. %prep %autosetup -p1 %build %make_build %{makemacros} %install export %{makemacros} mkdir -p ${PREFIX} ${bindir} ${libdir} ${mandir} %make_install %{makemacros} %files %doc README.md %{_bindir}/lz4jsoncat %{_mandir}/man1/lz4jsoncat.1* %files -n %{libname} %{_libdir}/liblz4json.so*