summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--Makefile4
-rw-r--r--brotli.spec78
3 files changed, 82 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6f69818
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.bz2
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..91b0fd5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../common/Makefile
+
diff --git a/brotli.spec b/brotli.spec
index 6811fa8..f9c7b4c 100644
--- a/brotli.spec
+++ b/brotli.spec
@@ -1,4 +1,24 @@
+# remirepo spec file for brotli / libbrotli1
+# renamed for parallel installation, from:
+#
+# Fedora spec file for brotli
+#
+# License: MIT
+# http://opensource.org/licenses/MIT
+#
+# Please preserve changelog entries
+#
+
+%global libname libbrotli
+%global soname 1
+
+# Version 1.0.1 in F28+
+# Nothing in EPEL, but we only provide the lib
+%if 0%{?fedora} >= 28
Name: brotli
+%else
+Name: %{libname}%{soname}
+%endif
Version: 1.0.3
Release: 1%{?dist}
Summary: Lossless compression algorithm
@@ -7,7 +27,10 @@ License: MIT
URL: https://github.com/google/brotli
Source0: https://github.com/google/brotli/archive/v%{version}.tar.gz
-BuildRequires: python2-devel python3-devel gcc-c++ gcc cmake
+BuildRequires: gcc-c++ gcc cmake
+%if "%{name}" == "brotli"
+Obsoletes: %{libname}%{soname} <= %{version}
+%endif
%description
Brotli is a generic-purpose lossless compression algorithm that compresses
@@ -16,8 +39,11 @@ 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.
+
+%if 0%{?fedora} >= 28
%package -n python2-%{name}
Summary: Lossless compression algorithm (python 2)
+BuildRequires: python2-devel
Requires: python2
%{?python_provide:%python_provide python2-%{name}}
@@ -33,6 +59,7 @@ This package installs a Python 2 module.
%package -n python3-%{name}
Requires: python3
Summary: Lossless compression algorithm (python 3)
+BuildRequires: python3-devel
%{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{name}
@@ -42,11 +69,18 @@ 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.
+%endif
%package -n %{name}-devel
Summary: Lossless compression algorithm (development files)
-Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+%if "%{name}" == "brotli"
+Obsoletes: %{libname}%{soname}-devel <= %{version}
+%else
+Conflicts: brotli-devel
+Provides: brotli-devel = %{version}-%{release}
+%endif
%description -n %{name}-devel
Brotli is a generic-purpose lossless compression algorithm that compresses
@@ -56,8 +90,9 @@ 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
+%setup -q -n brotli-%{version}
# fix permissions for -debuginfo
# rpmlint will complain if I create an extra %%files section for
# -debuginfo for this so we'll put it here instead
@@ -70,19 +105,23 @@ mkdir -p build
cd build
%cmake .. -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DCMAKE_INSTALL_LIBDIR="%{_libdir}"
-%make_build
+make %{?_smp_mflags}
cd ..
+%if 0%{?fedora} >= 28
%py2_build
%py3_build
+%endif
+
%install
cd build
-%make_install
+make install DESTDIR=%{buildroot}
# I couldn't find the option to not build the static libraries
%__rm "%{buildroot}%{_libdir}/"*.a
cd ..
+%if 0%{?fedora} >= 28
# Must do the python2 install first because the scripts in /usr/bin are
# overwritten with every setup.py install, and in general we want the
# python3 version to be the default. If, however, we're installing separate
@@ -90,35 +129,50 @@ cd ..
# the unversioned executable is the python2 one.
%py2_install
%py3_install
+%endif
%{__install} -dm755 "%{buildroot}%{_mandir}/man3"
cd docs
for i in *.3;do
%{__install} -m644 "$i" "%{buildroot}%{_mandir}/man3/${i}brotli"
done
-%ldconfig_scriptlets
+
+%if 0%{?fedora} < 28 && 0%{?rhel} < 8
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+%endif
+
%check
cd build
ctest -V
cd ..
+%if 0%{?fedora} >= 28
%{__python2} setup.py test
%{__python3} setup.py test
+%endif
+
%files
-%{_bindir}/brotli
-%{_libdir}/*.so.*
+%{!?_licensedir:%global license %%doc}
+%exclude %{_bindir}/brotli
+%{_libdir}/*.so.%{soname}*
%license LICENSE
+
+%if 0%{?fedora} >= 28
# Note that there is no %%files section for the unversioned python module
# if we are building for several python runtimes
%files -n python2-%{name}
%{python2_sitearch}/*
%license LICENSE
+
%files -n python3-%{name}
%{python3_sitearch}/*
%license LICENSE
+%endif
+
%files -n %{name}-devel
%{_includedir}/*
@@ -127,8 +181,14 @@ cd ..
%{_mandir}/man3/*
+# DON'T run the build for F28+
+
%changelog
-* Fri Mar 03 2018 Travis Kendrick <pouar@pouar.net> - 1.0.3-1
+* Tue Apr 10 2018 Remi Collet <remi@remirepo.net> - 1.0.3-1
+- rename to libbrotli1
+- drop command and python bindings
+
+* Fri Mar 02 2018 Travis Kendrick <pouar@pouar.net> - 1.0.3-1
- update to 1.0.3
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-3