File e2fsprogs.spec of Package e2fsprogs.4950

# spec file for package e2fsprogs
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           e2fsprogs
%if 0%{?suse_version} >= 1010
# Hint for ZYPP
Supplements:    filesystem(ext2) filesystem(ext3) filesystem(ext4)
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libblkid-devel
BuildRequires:  libuuid-devel
BuildRequires:  pkg-config
%if 0%{?suse_version} > 1220
BuildRequires:  makeinfo
# Define info macros if missing (for Fedora builds)
%if 0%{!?%install_info_prereq:1}
%define install_info_prereq info
%define install_info sbin/install-info
%define install_info_delete sbin/install-info --delete
Requires:       %install_info_prereq
# bug437293
%ifarch ppc64
Obsoletes:      e2fsprogs-64bit
Version:        1.42.11
Release:        0
Summary:        Utilities for the Second Extended File System
License:        GPL-2.0
Group:          System/Filesystems
Requires:       libcom_err2 >= %{version}
Requires:       libext2fs2 >= %{version}
Source2:        README.SUSE
Source3:        baselibs.conf
# e2fsprogs patches
Patch1:         e2fsprogs-1.41.1-splash_support.patch
# libcom_err patches
Patch3:         libcom_err-compile_et_permissions.patch
Patch4:         e2fsprogs-1.42-implicit_fortify_decl.patch
Patch5:         e2fsprogs-1.42-ext2fsh_implicit.patch
Patch6:         e2fsck-free-ctx-fs-not-fs-at-the-end-of-fsck.patch
Patch7:         e2fsck-fix-free-pointer-dereferences.patch
Patch8:         libext2fs-avoid-buffer-overflow-if-s_first_meta_bg-i.patch
Patch9:         libext2fs-fix-potential-buffer-overflow-in-closefs.patch
Patch10:        resize2fs-Fix-32-64-bit-overflow-when-multiplying-by-blocks-cl.patch
Patch11:        libext2fs-don-t-ignore-fsync-errors.patch
Patch12:        libext2fs-Fix-fsync-2-detection.patch

# Do not suppress make commands
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Utilities needed to create and maintain ext2 and ext3 file systems
under Linux. Included in this package are: chattr, lsattr, mke2fs,
mklost+found, tune2fs, e2fsck, resize2fs, and badblocks.

%package devel
Summary:        Dummy development package
# bug437293
License:        LGPL-2.0
Group:          Development/Libraries/C and C++
%ifarch ppc64
Obsoletes:      e2fsprogs-devel-64bit
Requires:       libblkid-devel
Requires:       libext2fs-devel = %version
Requires:       libuuid-devel

%description devel
Dummy development package for backwards compatibility.

%package -n libext2fs2
Summary:        Ext2fs library
License:        LGPL-2.0
Group:          System/Filesystems

%description -n libext2fs2
The basic Ext2fs shared library.

%package -n libext2fs-devel
Summary:        Development files for libext2fs
License:        LGPL-2.0
Group:          Development/Libraries/C and C++
Requires:       libcom_err-devel
Requires:       libext2fs2 = %version

%description -n libext2fs-devel
Development files for libext2fs.

%package -n libcom_err2
Summary:        E2fsprogs error reporting library
# bug437293
License:        MIT
Group:          System/Filesystems
%ifarch ppc64
Obsoletes:      libcom_err-64bit
Obsoletes:      libcom_err2-64bit
Provides:       libcom_err = %{version}
Obsoletes:      libcom_err <= 1.40

%description -n libcom_err2
com_err is an error message display library.

%package -n libcom_err-devel
Summary:        Development files for libcom_err
# bug437293
License:        MIT
Group:          Development/Libraries/C and C++
%ifarch ppc64
Obsoletes:      libcom_err-devel-64bit
Requires:       glibc-devel
Requires:       libcom_err2 = %version

%description -n libcom_err-devel
Development files for the com_err error message display library.

%setup -q -n e2fsprogs-%{version}
# e2fsprogs patches
# libcom_err patches
%patch3 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
cp %{SOURCE2} .

autoreconf --force --install
%configure \
  --disable-evms \
  --with-root-prefix=''   \
  --enable-elf-shlibs \
  --disable-libblkid \
  --disable-libuuid \
  --disable-uuidd \
  --disable-fsck \
make %{?_smp_mflags} V=1
#Guarantee that tranlations match the source messages
make -C po update-po

make install install-libs DESTDIR=$RPM_BUILD_ROOT ELF_INSTALL_DIR=/%{_libdir}

%{find_lang} %{name}

rm $RPM_BUILD_ROOT%{_libdir}/e2initrd_helper
rm -f $RPM_BUILD_ROOT/%{_sbindir}/mkfs.ext4dev
rm -f $RPM_BUILD_ROOT/%{_sbindir}/fsck.ext4dev
rm -f $RPM_BUILD_ROOT/usr/share/man/man8/mkfs.ext4dev.8*
rm -f $RPM_BUILD_ROOT/usr/share/man/man8/fsck.ext4dev.8*

# Need libext2fs.a for silo
find "%buildroot/%_libdir" -type f -name "*.a" \
%ifarch %sparc
	! -name libext2fs.a \
	-print -delete
mkdir %{buildroot}/sbin
ln -s %{_sbindir}/badblocks %{buildroot}/sbin/badblocks
ln -s %{_sbindir}/debugfs   %{buildroot}/sbin/debugfs
ln -s %{_sbindir}/dumpe2fs  %{buildroot}/sbin/dumpe2fs
ln -s %{_sbindir}/e2undo    %{buildroot}/sbin/e2undo
ln -s %{_sbindir}/e2fsck    %{buildroot}/sbin/e2fsck
ln -s %{_sbindir}/e2label   %{buildroot}/sbin/e2label
ln -s %{_sbindir}/fsck.ext2 %{buildroot}/sbin/fsck.ext2
ln -s %{_sbindir}/fsck.ext3 %{buildroot}/sbin/fsck.ext3
ln -s %{_sbindir}/fsck.ext4 %{buildroot}/sbin/fsck.ext4
ln -s %{_sbindir}/mke2fs    %{buildroot}/sbin/mke2fs
ln -s %{_sbindir}/mkfs.ext2 %{buildroot}/sbin/mkfs.ext2
ln -s %{_sbindir}/mkfs.ext3 %{buildroot}/sbin/mkfs.ext3
ln -s %{_sbindir}/mkfs.ext4 %{buildroot}/sbin/mkfs.ext4
ln -s %{_sbindir}/resize2fs %{buildroot}/sbin/resize2fs
ln -s %{_sbindir}/tune2fs   %{buildroot}/sbin/tune2fs
ln -s %{_sbindir}/e2image   %{buildroot}/sbin/e2image
ln -s %{_sbindir}/logsave   %{buildroot}/sbin/logsave
mkdir %{buildroot}/%{_lib}
pushd %{buildroot}/%{_libdir}
LIBNAMES=$(ls *.so.*)
for libName in $LIBNAMES;
  do ln -s %{_libdir}/$libName %{buildroot}/%{_lib};
%install_info --info-dir=%{_infodir} %{_infodir}/

%install_info_delete --info-dir=%{_infodir} %{_infodir}/

%post -n libext2fs2 -p /sbin/ldconfig

%postun -n libext2fs2 -p /sbin/ldconfig

%post -n libcom_err2 -p /sbin/ldconfig

%postun -n libcom_err2 -p /sbin/ldconfig

%files -f %{name}.lang
%defattr(-, root, root)
%config /etc/mke2fs.conf

%files devel

%files -n libext2fs2
%defattr(-, root, root)

%files -n libext2fs-devel
%defattr(-, root, root)
%ifarch %sparc

%files -n libcom_err2
%defattr(-, root, root)

%files -n libcom_err-devel
%defattr(-, root, root)