%bcond_without static # link e2fsck dynamically with libc
%bcond_without nls # build without NLS
%bcond_without initrd # don't build initrd version
-%bcond_without uClibc # link initrd version with static glibc instead of uClibc
+%bcond_with uClibc # link initrd version with static glibc instead of uClibc
+%bcond_without dietlibc # link initrd version with dietlibc instead of uClibc
#
%ifarch sparc64 sparc
%undefine with_uClibc
Summary(zh_CN.UTF-8): 管理第二扩展(ext2)文件系统的工具。
Summary(zh_TW.UTF-8): 用於管理 ext2 檔案系統的工具程式。
Name: e2fsprogs
-Version: 1.41.3
-Release: 1
+Version: 1.41.5
+Release: 0.1
License: GPL v2 (with LGPL v2 and BSD parts)
Group: Applications/System
Source0: http://dl.sourceforge.net/e2fsprogs/%{name}-%{version}.tar.gz
-# Source0-md5: b21d26fc46c584021dc9c444933ee1c2
+# Source0-md5: e218df6c84fc17c1126d31de9472a76c
Source1: e2compr-0.4.texinfo.gz
# Source1-md5: c3c59ff37e49d8759abb1ef95a8d3abf
Source2: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
Patch0: %{name}-info.patch
Patch1: e2compr-info.patch
Patch2: %{name}-498381.patch
+Patch3: %{name}-diet.patch
URL: http://e2fsprogs.sourceforge.net/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
BuildRequires: libselinux-static
BuildRequires: libsepol-static
%endif
-%if %{with initrd} && %{with uClibc}
+%if %{with initrd}
+ %if %{with uClibc}
BuildRequires: uClibc-static >= 2:0.9.29
+ %else
+ %if %{with dietlibc}
+BuildRequires: dietlibc-static
+ %else
+BuildRequires: glibc-static
+ %endif
+ %endif
%endif
Requires(post,postun): /sbin/ldconfig
Requires: fsck = %{version}-%{release}
# changing CFLAGS in the middle confuses confcache
%undefine configure_cache
+# for some reason known only to rpm there must be "\\|" not "\|" here
+%define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
+%define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch}
+
%description
The e2fsprogs package contains a number of utilities for creating,
checking, modifying and correcting any inconsistencies in second
%description -n libuuid-static -l pl.UTF-8
Biblioteka umożliwiająca dostęp i zmiany UUID - wersja statyczna.
+%package -n libuuid-dietlibc
+Summary: Static dietlibc library for accessing and manipulating UUID
+Summary(pl.UTF-8): Statyczna biblioteka dietlibc umożliwiająca dostęp i zmiany UUID
+License: BSD
+Group: Development/Libraries
+Requires: libuuid-devel = %{version}-%{release}
+Conflicts: e2fsprogs-static < 1.34-3
+
+%description -n libuuid-dietlibc
+Library for accessing and manipulating UUID - static dietlibc version.
+
+%description -n libuuid-dietlibc -l pl.UTF-8
+Biblioteka umożliwiająca dostęp i zmiany UUID - wersja statyczna dietlibc.
+
%package -n uuidd
Summary: Helper daemon to guarantee uniqueness of time-based UUIDs
Summary(pl.UTF-8): Pomocniczy demon gwarantujący unikalność UUID-ów opartych na czasie
Sprawdzenie i naprawa linuksowego systemu plików.
%package initrd
-Summary: blkid - initrd version
-Summary(pl.UTF-8): blkid - wersja dla initrd
+Summary: e2fsck and mke2fs - initrd version
+Summary(pl.UTF-8): e2fsck i mke2fs - wersja dla initrd
Group: Base
+Conflicts: geninitrd < 10000.10
%description initrd
-This package includes a blkid utility to recognize partitions by label
-or UUID - staticaly linked for initrd.
+This package includes a e2fsck and mke2fs utilities staticaly
+linked for initrd.
%description initrd -l pl.UTF-8
-Pakiet ten zawiera narzędzie blkid do rozpoznawania partycji przez
-etykietę lub UUID - statycznie skonsolidowane na potrzeby initrd.
+Pakiet ten zawiera narzędziae2fsck i mke2fs statycznie skonsolidowane
+na potrzeby initrd.
%prep
%setup -q
%{__gzip} -dc < %{SOURCE1} > doc/e2compr.texinfo
%patch1 -p1
%patch2 -p1
+%patch3 -p1
sed -i -e '/AC_SUBST(DO_TEST_SUITE/a\MKINSTALLDIRS="install -d"\nAC_SUBST(MKINSTALLDIRS)\n' configure.in
%{__autoconf}
%if %{with initrd}
+%if %{with dietlibc}
+# needed for syscall()
+sed -i -e 's|\(^LIBUUID = .*\)|\1 -lcompat|g' \
+ -e 's|\(^STATIC_LIBUUID = .*\)|\1 -lcompat|g' MCONFIG.in
+%endif
%configure \
- %{?with_uClibc:CC="%{_target_cpu}-uclibc-gcc"} \
ac_cv_lib_dl_dlopen=no \
- --with-ccopts="-Os" \
- --with-ldopts="-static" \
+ %{?with_uClibc:CC="%{_target_cpu}-uclibc-gcc"} \
+ %{?with_dietlibc:--with-cc="diet %{__cc}"} \
+ --with-ccopts="%{rpmcflags} -Os" \
+ --with-ldopts="%{rpmldflags} -static" \
--disable-elf-shlibs \
+ --disable-libblkid \
--disable-selinux \
- --disable-nls
-
-%{__make} libs
+ --disable-nls \
+ --disable-testio-debug \
+ --disable-e2initrd-helper \
+ --disable-uuidd \
+ --disable-tls \
+ --disable-nls \
+ --disable-threads
+
+%{__make} -j1 libs
%{__make} progs
-mv -f misc/blkid initrd-blkid
+mv -f misc/mke2fs initrd-mke2fs
+mv -f misc/fsck initrd-e2fsck
+%if %{with dietlibc}
+sed -i -e 's|\(^LIBUUID = .*\) -lcompat|\1|g' \
+ -e 's|\(^STATIC_LIBUUID = .*\) -lcompat|\1|g' MCONFIG.in
+mv -f lib/uuid/libuuid.a diet-libuuid.a
+%endif
%{__make} clean
%endif
--with-root-prefix="" \
%{!?with_nls:--disable-nls} \
%{!?with_allstatic:--enable-elf-shlibs} \
+ --disable-libblkid \
--enable-compression \
--enable-htree \
--enable-fsck \
%install
rm -rf $RPM_BUILD_ROOT
+%{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
export PATH=/sbin:$PATH
install -d $RPM_BUILD_ROOT/var/lib/libuuid
bzip2 -dc %{SOURCE2} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/{mkfs,fsck}.ext[23].8*
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/{mkfs,fsck}.ext[234]*.8*
echo '.so e2fsck.8' > $RPM_BUILD_ROOT%{_mandir}/man8/fsck.ext2.8
echo '.so e2fsck.8' > $RPM_BUILD_ROOT%{_mandir}/man8/fsck.ext3.8
echo '.so e2fsck.8' > $RPM_BUILD_ROOT%{_mandir}/man8/fsck.ext4.8
%endif
rm -f $RPM_BUILD_ROOT%{_mandir}/README.e2fsprogs-non-english-man-pages
-touch $RPM_BUILD_ROOT%{_sysconfdir}/blkid.tab
-%{?with_initrd:install initrd-blkid $RPM_BUILD_ROOT/sbin/initrd-blkid}
+%if %{with initrd}
+install -d $RPM_BUILD_ROOT%{_libdir}/initrd
+install initrd-e2fsck $RPM_BUILD_ROOT%{_libdir}/initrd/e2fsck
+install initrd-mke2fs $RPM_BUILD_ROOT%{_libdir}/initrd/mke2fs
+%endif
+
+%{?with_dietlibc:install diet-libuuid.a $RPM_BUILD_ROOT%{dietlibdir}/libuuid.a}
%clean
rm -rf $RPM_BUILD_ROOT
# COPYING specifies license details for some parts of package
%doc COPYING README RELEASE-NOTES
%attr(755,root,root) /sbin/badblocks
-%attr(755,root,root) /sbin/blkid
%attr(755,root,root) /sbin/debugfs
%attr(755,root,root) /sbin/dumpe2fs
%attr(755,root,root) /sbin/e2fsck
%attr(755,root,root) %{_libdir}/e2initrd_helper
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/e2fsck.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mke2fs.conf
-%ghost %{_sysconfdir}/blkid.tab
%{_mandir}/man1/chattr.1*
%{_mandir}/man1/lsattr.1*
%{_mandir}/man1/mk_cmds.1*
%{_mandir}/man5/e2fsck.conf.5*
%{_mandir}/man5/mke2fs.conf.5*
%{_mandir}/man8/badblocks.8*
-%{_mandir}/man8/blkid.8*
%{_mandir}/man8/debugfs.8*
%{_mandir}/man8/dumpe2fs.8*
%{_mandir}/man8/e2fsck.8*
%if %{without allstatic}
%files libs
%defattr(644,root,root,755)
-%attr(755,root,root) /%{_lib}/libblkid.so.*.*
-%attr(755,root,root) %ghost /%{_lib}/libblkid.so.1
%attr(755,root,root) /%{_lib}/libe2p.so.*.*
%attr(755,root,root) %ghost /%{_lib}/libe2p.so.2
%attr(755,root,root) /%{_lib}/libext2fs.so.*.*
%files devel
%defattr(644,root,root,755)
-%doc doc/libblkid.txt
%if %{without allstatic}
-%attr(755,root,root) %{_libdir}/libblkid.so
%attr(755,root,root) %{_libdir}/libe2p.so
%attr(755,root,root) %{_libdir}/libext2fs.so
%attr(755,root,root) %{_libdir}/libss.so
%endif
-%{_includedir}/blkid
%{_includedir}/e2p
%{_includedir}/ext2fs
%{_includedir}/ss
-%{_pkgconfigdir}/blkid.pc
%{_pkgconfigdir}/e2p.pc
%{_pkgconfigdir}/ext2fs.pc
%{_pkgconfigdir}/ss.pc
%{_infodir}/libext2fs.info*
-%{_mandir}/man3/libblkid.3*
%files static
%defattr(644,root,root,755)
-%{_libdir}/libblkid.a
%{_libdir}/libe2p.a
%{_libdir}/libext2fs.a
%{_libdir}/libss.a
%defattr(644,root,root,755)
%{_libdir}/libuuid.a
+%if %{with dietlibc}
+%files -n libuuid-dietlibc
+%defattr(644,root,root,755)
+%{dietlibdir}/libuuid.a
+%endif
+
%files -n uuidd
%defattr(644,root,root,755)
%attr(6755,uuidd,uuidd) %{_sbindir}/uuidd
%if %{with initrd}
%files initrd
%defattr(644,root,root,755)
-%attr(755,root,root) /sbin/initrd-blkid
+%attr(755,root,root) %{_libdir}/initrd/e2fsck
+%attr(755,root,root) %{_libdir}/initrd/mke2fs
%endif