Use -Werror for all kernel configure tests.
[zfs.git] / config / rpm.am
index d557f77..9deafb3 100644 (file)
@@ -1,20 +1,31 @@
 srpm-modules:
+if CONFIG_KERNEL
        $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" srpm-common
+endif
 
 srpm-utils:
+if CONFIG_USER
        $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" srpm-common
+endif
 
 srpm: srpm-modules srpm-utils
 
+rpm-dkms: srpm-modules
+if CONFIG_KERNEL
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" dkms-common
+endif
+
 rpm-modules: srpm-modules
+if CONFIG_KERNEL
        $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" rpm-common
+endif
 
 rpm-utils: srpm-utils
+if CONFIG_USER
        $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" rpm-common
+endif
 
-rpm-modules: srpm-modules
-
-rpm: rpm-modules rpm-utils
+rpm: rpm-modules rpm-utils rpm-dkms
 
 rpm-local:
        @(if test "${HAVE_RPMBUILD}" = "no"; then \
@@ -33,6 +44,26 @@ rpm-local:
        mkdir -p $(rpmbuild)/SOURCES && \
        cp $(distdir).tar.gz $(rpmbuild)/SOURCES)
 
+dkms-common:
+       rpmpkg=$(pkg)-$(ZFS_META_VERSION)-$(ZFS_META_RELEASE).src.rpm; \
+       rpmspec=$(pkg).spec; \
+       rpmdkms=$(pkg)-dkms-$(ZFS_META_VERSION)-$(ZFS_META_RELEASE).noarch.rpm;\
+       rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
+       $(MAKE) $(AM_MAKEFLAGS) \
+               rpmbuild="$$rpmbuild" \
+               rpmspec="$$rpmspec" \
+               rpm-local || exit 1; \
+       $(RPMBUILD) \
+               --define "_tmppath $$rpmbuild/TMP" \
+               --define "_topdir $$rpmbuild" \
+               --define "dist %{nil}" \
+               --define "_without_kernel 1" \
+               --define "_without_kernel_debug 1" \
+               --define "_with_kernel_dkms 1" \
+               --nodeps --rebuild $$rpmpkg || exit 1; \
+       cp $$rpmbuild/RPMS/noarch/$$rpmdkms . || exit 1; \
+       $(RM) -R $$rpmbuild
+
 srpm-common: dist
        rpmpkg=$(pkg)-$(ZFS_META_VERSION)-$(ZFS_META_RELEASE).src.rpm; \
        rpmspec=$(pkg).spec; \
@@ -69,6 +100,7 @@ rpm-common:
                --define "require_splobj $(SPL_OBJ)" \
                --define "require_splver $(SPL_VERSION)" \
                --define "$(DEBUG_ZFS) 1" \
+               --define "$(DEBUG_DMU_TX) 1" \
                --nodeps --rebuild $$rpmpkg || exit 1; \
        cp $$rpmbuild/RPMS/*/* . || exit 1; \
        $(RM) -R $$rpmbuild