Sophie

Sophie

distrib > Mageia > 8 > x86_64 > by-pkgid > 6dffec40e5dd917501e660f593908f14 > files > 3

brotli-1.0.9-2.mga8.src.rpm

%define major	1
%define comlib	%mklibname brotlicommon %{major}
%define enclib	%mklibname brotlienc %{major}
%define declib	%mklibname brotlidec %{major}
%define devname	%mklibname brotli -d

Name:		brotli
Version:	1.0.9
Release:	%mkrel 2
Summary:        Lossless compression algorithm
License:	MIT
Group:		Archiving/Compression
Url:		https://github.com/google/brotli
Source0:	https://github.com/google/brotli/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0:		brotli-no-static-brotli.patch
Patch1:		python3.8.patch
BuildRequires:	cmake
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools

%description
Brotli is a generic-purpose lossless compression algorithm that compresses
data using a combination of a modern variant of the LZ77 algorithm, Huffman
coding and 2nd order context modeling, with a compression ratio comparable
to the best currently available general-purpose compression methods.
It is similar in speed with deflate but offers more dense compression.

%package -n %{comlib}
Summary:	Shared data used by libbrotlienc and libbrotlidec libraries
Group:		System/Libraries

%description -n %{comlib}
Shared data used by libbrotlienc and libbrotlidec libraries.

%package -n %{enclib}
Summary:	Brotli encoder library
Group:		System/Libraries

%description -n %{enclib}
Brotli is a generic-purpose lossless compression algorithm that compresses
data using a combination of a modern variant of the LZ77 algorithm, Huffman
coding and 2nd order context modeling, with a compression ratio comparable
to the best currently available general-purpose compression methods.
It is similar in speed with deflate but offers more dense compression.

%package -n %{declib}
Summary:	Brotli decoder library
Group:		System/Libraries

%description -n %{declib}
Brotli is a generic-purpose lossless compression algorithm that compresses
data using a combination of a modern variant of the LZ77 algorithm, Huffman
coding and 2nd order context modeling, with a compression ratio comparable
to the best currently available general-purpose compression methods.
It is similar in speed with deflate but offers more dense compression.

%package -n python3-%{name}
Summary:        Lossless compression algorithm (python 3)
Group:          Development/Python
%{?python_provide:%python_provide python3-%{name}}

%description -n python3-%{name}
Brotli is a generic-purpose lossless compression algorithm that compresses
data using a combination of a modern variant of the LZ77 algorithm, Huffman
coding and 2nd order context modeling, with a compression ratio comparable
to the best currently available general-purpose compression methods.
It is similar in speed with deflate but offers more dense compression.
This package installs a Python 3 module.


%package -n %{devname}
Summary:        Lossless compression algorithm (development files)
Group:		Development/Other
Requires:	%{comlib} = %{version}-%{release}
Requires:	%{enclib} = %{version}-%{release}
Requires:	%{declib} = %{version}-%{release}
Provides:	%{name}-devel = %{version}-%{release}

%description -n %{devname}
Brotli is a generic-purpose lossless compression algorithm that compresses
data using a combination of a modern variant of the LZ77 algorithm, Huffman
coding and 2nd order context modeling, with a compression ratio comparable
to the best currently available general-purpose compression methods.
It is similar in speed with deflate but offers more dense compression.
This package installs the development files

%prep
%autosetup

# fix permissions
find c/ \( -name "*.c" -o -name "*.h" \) -exec chmod 644 {} \;

# make sure cmake is used
rm -rf Makefile

%build
%py3_build

%cmake
%cmake_build

%install
%cmake_install

# I couldn't find the option to not build the static libraries
rm "%{buildroot}%{_libdir}/"*.a

%py3_install

# man page
install -Dpm644 docs/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
install -Dpm644 docs/decode.h.3 %{buildroot}%{_mandir}/man3/%{name}-decode.h.3
install -Dpm644 docs/encode.h.3 %{buildroot}%{_mandir}/man3/%{name}-encode.h.3
install -Dpm644 docs/types.h.3 %{buildroot}%{_mandir}/man3/%{name}-types.h.3

# remove -R from pkg-config (breaks building libsoup):
sed -i 's!-R\${libdir} !!' %buildroot%{_libdir}/pkgconfig/libbrotli*.pc

%files
%doc README.md
%license LICENSE
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*

%files -n %{comlib}
%license LICENSE
%{_libdir}/libbrotlicommon.so.%{major}{,.*}

%files -n %{enclib}
%license LICENSE
%{_libdir}/libbrotlienc.so.%{major}{,.*}

%files -n %{declib}
%license LICENSE
%{_libdir}/libbrotlidec.so.%{major}{,.*}

%files -n %{devname}
%doc README.md CONTRIBUTING.md
%{_includedir}/%{name}/
%{_libdir}/libbrotlicommon.so
%{_libdir}/libbrotlienc.so
%{_libdir}/libbrotlidec.so
%{_libdir}/pkgconfig/libbrotli*.pc
%{_mandir}/man3/%{name}-*.h.3*

%files -n python3-%{name}
%{python3_sitearch}/Brotli-%{version}-py%{python3_version}.egg-info/
%{python3_sitearch}/__pycache__/brotli.*
%{python3_sitearch}/*.so
%{python3_sitearch}/brotli.py*


%changelog
* Sat Sep 12 2020 tv <tv> 1.0.9-2.mga8
+ Revision: 1624964
- fix python subpkg description
- use %%autosetup
- remove -R from pkg-config (breaks building libsoup)

* Fri Sep 04 2020 wally <wally> 1.0.9-1.mga8
+ Revision: 1622085
- new version 1.0.9

* Fri May 01 2020 wally <wally> 1.0.7-6.mga8
+ Revision: 1577641
- use %%cmake_build and ensure cmake is used

* Fri May 01 2020 ovitters <ovitters> 1.0.7-5.mga8
+ Revision: 1577560
- rebuild to test cmake_install test without cmake_build

* Sun Feb 16 2020 umeabot <umeabot> 1.0.7-4.mga8
+ Revision: 1531044
- Mageia 8 Mass Rebuild

* Mon Sep 09 2019 wally <wally> 1.0.7-3.mga8
+ Revision: 1438916
- rebuild for python3.8
- drop python2 support

* Mon Jan 07 2019 shlomif <shlomif> 1.0.7-2.mga7
+ Revision: 1351496
- Rebuild for python3 3.7

* Sun Oct 28 2018 wally <wally> 1.0.7-1.mga7
+ Revision: 1326424
- new version 1.0.7

* Sat Sep 22 2018 wally <wally> 1.0.6-1.mga7
+ Revision: 1296421
- new version 1.0.6

* Sat Sep 22 2018 umeabot <umeabot> 1.0.5-2.mga7
+ Revision: 1295683
- Mageia 7 Mass Rebuild

* Sat Aug 25 2018 wally <wally> 1.0.5-1.mga7
+ Revision: 1254436
- new versino 1.0.5

* Tue May 01 2018 wally <wally> 1.0.4-1.mga7
+ Revision: 1224158
- new version 1.0.4

* Sun Mar 11 2018 wally <wally> 1.0.3-1.mga7
+ Revision: 1208162
- new version 1.0.3

* Fri Dec 08 2017 wally <wally> 1.0.2-1.mga7
+ Revision: 1181670
- new version 1.0.2
- new libmajor 1

* Tue Oct 10 2017 wally <wally> 1.0.1-1.mga7
+ Revision: 1170801
- imported package brotli