Blame SPECS/brotli.spec

5a1d36
%if 0%{?rhel} > 7
5a1d36
# Disable python2 build by default
5a1d36
%bcond_with python2
5a1d36
%else
5a1d36
%bcond_without python2
5a1d36
%endif
5a1d36
5a1d36
Name:           brotli
5a1d36
Version:        1.0.6
5a1d36
Release:        2%{?dist}
5a1d36
Summary:        Lossless compression algorithm
5a1d36
5a1d36
License:        MIT
5a1d36
URL:            https://github.com/google/brotli
5a1d36
Source0:        https://github.com/google/brotli/archive/v%{version}.tar.gz
5a1d36
5a1d36
%if %{with python2}
5a1d36
BuildRequires:  python2-devel
5a1d36
%endif
5a1d36
BuildRequires:  python3-devel
5a1d36
BuildRequires:  gcc-c++ gcc cmake
5a1d36
5a1d36
%description
5a1d36
Brotli is a generic-purpose lossless compression algorithm that compresses
5a1d36
data using a combination of a modern variant of the LZ77 algorithm, Huffman
5a1d36
coding and 2nd order context modeling, with a compression ratio comparable
5a1d36
to the best currently available general-purpose compression methods.
5a1d36
It is similar in speed with deflate but offers more dense compression.
5a1d36
5a1d36
%if %{with python2}
5a1d36
%package -n python2-%{name}
5a1d36
Summary:        Lossless compression algorithm (python 2)
5a1d36
Requires: python2
5a1d36
%{?python_provide:%python_provide python2-%{name}}
5a1d36
5a1d36
%description -n python2-%{name}
5a1d36
Brotli is a generic-purpose lossless compression algorithm that compresses
5a1d36
data using a combination of a modern variant of the LZ77 algorithm, Huffman
5a1d36
coding and 2nd order context modeling, with a compression ratio comparable
5a1d36
to the best currently available general-purpose compression methods.
5a1d36
It is similar in speed with deflate but offers more dense compression.
5a1d36
This package installs a Python 2 module.
5a1d36
%endif
5a1d36
5a1d36
%package -n python3-%{name}
5a1d36
Requires: %{__python3}
5a1d36
Summary:        Lossless compression algorithm (python 3)
5a1d36
%{?python_provide:%python_provide python3-%{name}}
5a1d36
5a1d36
%description -n python3-%{name}
5a1d36
Brotli is a generic-purpose lossless compression algorithm that compresses
5a1d36
data using a combination of a modern variant of the LZ77 algorithm, Huffman
5a1d36
coding and 2nd order context modeling, with a compression ratio comparable
5a1d36
to the best currently available general-purpose compression methods.
5a1d36
It is similar in speed with deflate but offers more dense compression.
5a1d36
This package installs a Python 3 module.
5a1d36
5a1d36
5a1d36
%package -n %{name}-devel
5a1d36
Summary:        Lossless compression algorithm (development files)
5a1d36
Requires: %{name}%{?_isa} = %{version}-%{release} 
5a1d36
5a1d36
%description -n %{name}-devel
5a1d36
Brotli is a generic-purpose lossless compression algorithm that compresses
5a1d36
data using a combination of a modern variant of the LZ77 algorithm, Huffman
5a1d36
coding and 2nd order context modeling, with a compression ratio comparable
5a1d36
to the best currently available general-purpose compression methods.
5a1d36
It is similar in speed with deflate but offers more dense compression.
5a1d36
This package installs the development files
5a1d36
5a1d36
%prep
5a1d36
%autosetup
5a1d36
# fix permissions for -debuginfo
5a1d36
# rpmlint will complain if I create an extra %%files section for
5a1d36
# -debuginfo for this so we'll put it here instead
5a1d36
%{__chmod} 644 c/enc/*.[ch]
5a1d36
%{__chmod} 644 c/include/brotli/*.h
5a1d36
%{__chmod} 644 c/tools/brotli.c
5a1d36
%build
5a1d36
5a1d36
mkdir -p build
5a1d36
cd build
5a1d36
%cmake .. -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
5a1d36
    -DCMAKE_INSTALL_LIBDIR="%{_libdir}"
5a1d36
%make_build
5a1d36
cd ..
5a1d36
%if %{with python2}
5a1d36
%py2_build
5a1d36
%endif
5a1d36
%py3_build
5a1d36
5a1d36
%install
5a1d36
cd build
5a1d36
%make_install
5a1d36
5a1d36
# I couldn't find the option to not build the static libraries
5a1d36
%__rm "%{buildroot}%{_libdir}/"*.a
5a1d36
5a1d36
cd ..
5a1d36
# Must do the python2 install first because the scripts in /usr/bin are
5a1d36
# overwritten with every setup.py install, and in general we want the
5a1d36
# python3 version to be the default. If, however, we're installing separate
5a1d36
# executables for python2 and python3, the order needs to be reversed so
5a1d36
# the unversioned executable is the python2 one.
5a1d36
%if %{with python2}
5a1d36
%py2_install
5a1d36
%endif
5a1d36
%py3_install
5a1d36
%{__install} -dm755 "%{buildroot}%{_mandir}/man3"
5a1d36
cd docs
5a1d36
for i in *.3;do
5a1d36
%{__install} -m644 "$i" "%{buildroot}%{_mandir}/man3/${i}brotli"
5a1d36
done
5a1d36
5a1d36
%ldconfig_scriptlets
5a1d36
5a1d36
%check
5a1d36
cd build
5a1d36
ctest -V
5a1d36
cd ..
5a1d36
%if %{with python2}
5a1d36
%{__python2} setup.py test
5a1d36
%endif
5a1d36
%{__python3} setup.py test
5a1d36
5a1d36
%files
5a1d36
%{_bindir}/brotli
5a1d36
%{_libdir}/*.so.*
5a1d36
%license LICENSE
5a1d36
5a1d36
# Note that there is no %%files section for the unversioned python module
5a1d36
# if we are building for several python runtimes
5a1d36
%if %{with python2}
5a1d36
%files -n python2-%{name}
5a1d36
%{python2_sitearch}/*
5a1d36
%license LICENSE
5a1d36
%endif
5a1d36
5a1d36
%files -n python3-%{name}
5a1d36
%{python3_sitearch}/*
5a1d36
%license LICENSE
5a1d36
5a1d36
%files -n %{name}-devel
5a1d36
%{_includedir}/*
5a1d36
%{_libdir}/*.so
5a1d36
%{_libdir}/pkgconfig/*
5a1d36
%{_mandir}/man3/*
5a1d36
5a1d36
5a1d36
%changelog
5a1d36
* Wed Jun 17 2020 Eike Rathke <erack@redhat.com> - 1.0.6-2
5a1d36
- Resolves: rhbz#1737412 bump NRV for build to compose
5a1d36
5a1d36
* Wed Oct 10 2018 Tomas Popela <tpopela@redhat.com> - 1.0.6-1
5a1d36
- Update to 1.0.6
5a1d36
- Resolves: rhbz#1637408
5a1d36
5a1d36
* Wed Sep 19 2018 Tomas Orsava <torsava@redhat.com> - 1.0.5-2
5a1d36
- Require the Python interpreter directly instead of using the package name
5a1d36
- Related: rhbz#1619153
5a1d36
5a1d36
* Mon Jul 16 2018 Tomas Popela <tpopela@redhat.com> - 1.0.5-1
5a1d36
- Update to 1.0.5
5a1d36
5a1d36
* Tue Jun 19 2018 Lumír Balhar <lbalhar@redhat.com> - 1.0.1-4
5a1d36
- Python 2 subpackage disabled
5a1d36
5a1d36
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-3
5a1d36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
5a1d36
5a1d36
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.1-2
5a1d36
- Switch to %%ldconfig_scriptlets
5a1d36
5a1d36
* Fri Sep 22 2017 Travis Kendrick <pouar@pouar.net> - 1.0.1-1
5a1d36
- update to 1.0.1
5a1d36
5a1d36
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-6
5a1d36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
5a1d36
5a1d36
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-5
5a1d36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5a1d36
5a1d36
* Tue May 23 2017 Travis Kendrick <pouar@pouar.net> - 0.6.0-4
5a1d36
- add man pages
5a1d36
5a1d36
* Sun May 14 2017 Travis Kendrick <pouar@pouar.net> - 0.6.0-3
5a1d36
- wrong directory for ctest
5a1d36
- LICENSE not needed in -devel
5a1d36
- fix "spurious-executable-perm"
5a1d36
- rpmbuild does the cleaning for us, so 'rm -rf %%{buildroot}' isn't needed
5a1d36
5a1d36
* Sat May 13 2017 Travis Kendrick <pouar@pouar.net> - 0.6.0-2
5a1d36
- include libraries and development files
5a1d36
5a1d36
* Sat May 06 2017 Travis Kendrick <pouar@pouar.net> - 0.6.0-1
5a1d36
- Initial build