-%if %{with initrd}
-%{?with_glibc:export CC="%{__cc}"}
-%{?with_uClibc:export CC="%{_target_cpu}-uclibc-gcc"}
-%{?with_dietlibc:cc="%{__cc}"; export CC="diet ${cc#ccache }"}
-
-%configure \
- ac_cv_lib_dl_dlopen=no \
- %{?with_uClibc:ac_cv_func_siginterrupt=no} \
- %{?debug:--enable-debug} \
- --disable-nls \
- --disable-readline \
- --enable-selinux%{!?with_glibc:=no} \
- --enable-static_link \
- --with-lvm1=internal \
- --with-optimisation="%{rpmcflags} -Os"
-# glibc version links with normal static libdevicemapper which has selinux enabled
-# and we need to keep these in sync between device-mapper and lvm2
-
-%{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h
-%{__sed} -i -e 's#rpl_realloc#realloc#g' lib/misc/configure.h
-
-%{__make} -j1 -C include
-%{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB=
-%{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB=
-%{__make} -j1 -C libdaemon/client LIB_SHARED= VERSIONED_SHLIB=
-%{__make} -j1 -C tools dmsetup.static lvm.static %{?with_dietlibc:DIETLIBC_LIBS="-lcompat"}
-%{__mv} tools/lvm.static initrd-lvm
-%{__mv} tools/dmsetup.static initrd-dmsetup
-
-# check if tools works
-for tool in initrd-lvm initrd-dmsetup; do
- LVM_SYSTEM_DIR=$(pwd) ./$tool help && rc=$? || rc=$?
- if [ $rc -gt 127 ]; then
- echo >&2 "Unexpected failure (exit status: $rc) from $tool. Does this tool work?!"
- exit 1
- fi
-done
-
-%{?with_dietlibc:%{__mv} libdm/ioctl/libdevmapper.a diet-libdevmapper.a}
-%{__make} clean
-
-unset CC
-%endif
-