-
-%if %{with initrd}
-%if %{with dietlibc}
-# dietlibc doesn't have aio.h (and xfsprogs does not need it really)
-# dietlibc has needed librt stuff in libc/libpthread
-sed -i -e 's|^AC_PACKAGE_NEED_AIO_H|dnl AC_PACKAGE_NEED_AIO_H|' \
- -e 's|^AC_PACKAGE_NEED_LIO_LISTIO|dnl AC_PACKAGE_NEED_LIO_LISTIO|' \
- configure.in
-sed -i -e 's|\(^LIBRT.*=.*\)|# \1|' include/builddefs.in
-sed -i -e 's|\(^LLDLIBS.*=.*\)|\1 -lcompat|' db/Makefile mkfs/Makefile
-%endif
-
-%{__autoconf}
-%configure \
- %{?with_dietlibc:CC="diet %{__cc} -static"} \
- --sbindir=%{_bindir} \
- --disable-gettext \
- --disable-readline \
- DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}" \
- OPTIMIZER="%{rpmcflags} -Wno-deprecated-declarations -Os -D_BSD_SOURCE -D__USE_XOPEN_EXTENDED"
-
-%{__make} -j1 include libxfs libxlog libxcmd libhandle libdisk \
- LIBUUID="%{dietlibdir}/libuuid.a" \
- V=1
-%{__make} -j1 db growfs logprint mkfs mdrestore repair \
- LDFLAGS="%{rpmldflags} -all-static" \
- LIBUUID="%{dietlibdir}/libuuid.a" \
- V=1
-
-mkdir -p initrd
-mv -f db/xfs_db initrd/xfs_db
-mv -f growfs/xfs_growfs initrd/xfs_growfs
-mv -f logprint/xfs_logprint initrd/xfs_logprint
-mv -f mkfs/mkfs.xfs initrd/mkfs.xfs
-mv -f mdrestore/xfs_mdrestore initrd/xfs_mdrestore
-mv -f repair/xfs_repair initrd/xfs_repair
-
-%if %{with dietlibc}
-sed -i -e 's|^dnl AC_PACKAGE_NEED_AIO_H|AC_PACKAGE_NEED_AIO_H|' \
- -e 's|^dnl AC_PACKAGE_NEED_LIO_LISTIO|AC_PACKAGE_NEED_LIO_LISTIO|' \
- configure.in
-sed -i -e 's|^# \(LIBRT.*=.*\)|\1|' include/builddefs.in
-sed -i -e 's|\(^LLDLIBS.*=.*\) -lcompat|\1|' db/Makefile mkfs/Makefile
-%endif
-
-%{__make} clean
-%endif
-