sysconfdir ?= ${prefix}/etc
bindir ?= ${prefix}/bin
mandir ?= ${prefix}/share/man
-CFLAGS ?= -O2 -g -Wall
+CFLAGS ?= -O2 -g -Wall $(KMOD_CFLAGS)
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
bashcompletiondir ?= ${datadir}/bash-completion/completions
pkgconfigdatadir ?= $(datadir)/pkgconfig
install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
- $(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) -lkmod
+ $(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(KMOD_LIBS)
dracut-install: install/dracut-install
ln -fs $< $@
shift
done
+if ! pkg-config --exists --print-errors " libkmod >= 15 "; then
+ echo "dracut needs pkg-config and libkmod >= 15." >&2
+ exit 1
+fi
+
cat > Makefile.inc.$$ <<EOF
prefix ?= ${prefix}
libdir ?= ${libdir:-${prefix}/lib}
mandir ?= ${mandir:-${prefix}/share/man}
enable_documentation ?= ${enable_documentation:-yes}
bindir ?= ${bindir:-${prefix}/bin}
+KMOD_CFLAGS ?= $(pkg-config --cflags " libkmod >= 15 ")
+KMOD_LIBS ?= $(pkg-config --libs " libkmod >= 15 ")
EOF
{
BuildRequires: bash git
+BuildRequires: kmod-devel >= 15
%if 0%{?fedora} || 0%{?rhel}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%endif
%if 0%{?fedora}
BuildRequires: bash-completion
-BuildRequires: pkgconfig
%endif
%if 0%{?suse_version}
cp %{SOURCE1} .
%build
-%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \
+%configure --systemdsystemunitdir=%{_unitdir} \
+ --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) \
+ --libdir=%{_prefix}/lib \
%if %{without doc}
- --disable-documentation
+ --disable-documentation \
%endif
+ ${NULL}
make %{?_smp_mflags}