Last active
January 2, 2020 13:54
-
-
Save Kungergely/ee36ce88cf98f555d84ca00569e087b1 to your computer and use it in GitHub Desktop.
Bash script for re-enabling the static subpackage of libjpeg-turbo 1.5.3 and subsequent rebuild of the RPM package for CentOS 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir docker-libjpeg-turbo && cd docker-libjpeg-turbo | |
wget http://vault.centos.org/8.0.1905/AppStream/Source/SPackages/libjpeg-turbo-1.5.3-7.el8.src.rpm | |
rpm2cpio ./libjpeg-turbo-*.src.rpm | cpio -dium | |
cat > libjpeg-turbo-spec.patch <<"EOF" | |
--- libjpeg-turbo.spec.orig 2019-05-14 03:36:19.000000000 +0200 | |
+++ libjpeg-turbo.spec 2019-12-30 17:29:36.223250716 +0100 | |
@@ -1,6 +1,6 @@ | |
Name: libjpeg-turbo | |
Version: 1.5.3 | |
-Release: 7%{?dist} | |
+Release: 8%{?dist} | |
Summary: A MMX/SSE2/SIMD accelerated library for manipulating JPEG image files | |
License: IJG | |
URL: http://sourceforge.net/projects/libjpeg-turbo | |
@@ -38,8 +38,6 @@ | |
Provides: libjpeg-devel%{_isa} = 6b-47%{?dist} | |
%endif | |
Requires: libjpeg-turbo%{?_isa} = %{version}-%{release} | |
-Obsoletes: libjpeg-turbo-static < 1.3.1 | |
-Provides: libjpeg-turbo-static = 1.3.1%{?dist} | |
%description devel | |
This package contains header files necessary for developing programs which will | |
@@ -57,6 +55,22 @@ | |
transformations on JPEG files. Rdjpgcom displays any text comments included in a | |
JPEG file. Wrjpgcom inserts text comments into a JPEG file. | |
+%package static | |
+Summary: Static version of the libjpeg-turbo library | |
+Group: Development/Libraries | |
+Obsoletes: libjpeg-turbo-static < 1.3.1 | |
+Provides: libjpeg-turbo-static = 1.3.1%{?dist} | |
+Obsoletes: libjpeg-static < 6b-47 | |
+Provides: libjpeg-static = 6b-47%{?dist} | |
+%if "%{?_isa}" != "" | |
+Provides: libjpeg-static%{_isa} = 6b-47%{?dist} | |
+%endif | |
+Requires: libjpeg-turbo-devel%{?_isa} = %{version}-%{release} | |
+ | |
+%description static | |
+The libjpeg-turbo-static package contains static library for manipulating | |
+JPEG images. | |
+ | |
%package -n turbojpeg | |
Summary: TurboJPEG library | |
@@ -84,7 +98,7 @@ | |
autoreconf -vif | |
export NAFLAGS="-g -Fdwarf" | |
export CCASFLAGS="-Wa,--generate-missing-build-notes=yes" | |
-%configure --disable-static | |
+%configure --enable-static | |
make %{?_smp_mflags} V=1 | |
@@ -92,6 +106,9 @@ | |
make install DESTDIR=%{buildroot} | |
find %{buildroot} -name "*.la" -delete | |
+# Don't distribute libjpegturbo.a | |
+find %{buildroot} -name "libturbojpeg.a" -delete | |
+ | |
# Fix perms | |
chmod -x README.md | |
@@ -166,6 +183,10 @@ | |
%{_mandir}/man1/rdjpgcom.1* | |
%{_mandir}/man1/wrjpgcom.1* | |
+%files static | |
+%defattr(-,root,root,-) | |
+%{_libdir}/libjpeg.a | |
+ | |
%files -n turbojpeg | |
%{_libdir}/libturbojpeg.so.0* | |
@@ -175,6 +196,9 @@ | |
%{_libdir}/pkgconfig/libturbojpeg.pc | |
%changelog | |
+* Fri Dec 27 2019 Gergely Kún <[email protected]> - 1.5.3-8 | |
+- Re-enabled the -static subpackage | |
+ | |
* Mon Oct 15 2018 Nikola Forró <[email protected]> - 1.5.3-7 | |
- Fix important Covscan defects (#1606984) | |
EOF | |
patch < libjpeg-turbo-spec.patch | |
cat > Dockerfile <<EOF | |
FROM centos:8 | |
RUN mkdir -p /root/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} && mkdir -p /libjpeg-turbo/build | |
RUN dnf -y --enablerepo=PowerTools install cmake gcc curl zip unzip bzip2 make less rpm-build autoconf automake libtool nasm | |
COPY libjpeg-turbo14-noinst.patch /root/rpmbuild/SOURCES | |
COPY libjpeg-turbo-header-files.patch /root/rpmbuild/SOURCES | |
COPY libjpeg-turbo-CVE-2018-11813.patch /root/rpmbuild/SOURCES | |
COPY libjpeg-turbo-CVE-2018-1152.patch /root/rpmbuild/SOURCES | |
COPY libjpeg-turbo-honor-naflags.patch /root/rpmbuild/SOURCES | |
COPY libjpeg-turbo-coverity.patch /root/rpmbuild/SOURCES | |
COPY libjpeg-turbo-1.5.3.tar.gz /root/rpmbuild/SOURCES | |
COPY libjpeg-turbo.spec /root/rpmbuild/SPECS | |
RUN cd /root/rpmbuild/SPECS && rpmbuild -ba libjpeg-turbo.spec | |
EOF | |
docker build -t libjpeg-turbo-builder . | |
mkdir build; cd build | |
docker run --mount type=bind,dst=/libjpeg-turbo/build,src=`pwd` -t libjpeg-turbo-builder:latest cp -r --no-preserve=all /root/rpmbuild/{RPMS/x86_64,SRPMS} /libjpeg-turbo/build | |
cp x86_64/* .; cp SRPMS/* . | |
# Resulting packages: | |
# libjpeg-turbo-1.5.3-8.el8.src.rpm | |
# libjpeg-turbo-1.5.3-8.el8.x86_64.rpm | |
# libjpeg-turbo-devel-1.5.3-8.el8.x86_64.rpm | |
# libjpeg-turbo-utils-1.5.3-8.el8.x86_64.rpm | |
# libjpeg-turbo-static-1.5.3-8.el8.x86_64.rpm | |
# turbojpeg-1.5.3-8.el8.x86_64.rpm | |
# turbojpeg-devel-1.5.3-8.el8.x86_64.rpm | |
# libjpeg-turbo-debugsource-1.5.3-8.el8.x86_64.rpm | |
# libjpeg-turbo-debuginfo-1.5.3-8.el8.x86_64.rpm | |
# libjpeg-turbo-utils-debuginfo-1.5.3-8.el8.x86_64.rpm | |
# turbojpeg-debuginfo-1.5.3-8.el8.x86_64.rpm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment