Whamcloud - gitweb
LU-7038 obdclass: lu_site_purge() to handle purge-all
[fs/lustre-release.git] / autoMakefile.am
index 689bee7..64d4c4c 100644 (file)
@@ -1,15 +1,15 @@
 SUBDIRS := @LDISKFS_SUBDIR@ \
        . \
-       @SNMP_SUBDIR@ \
        @LUSTREIOKIT_SUBDIR@ \
        @LIBCFS_SUBDIR@ \
+       @SNMP_SUBDIR@ \
        lnet \
        lustre
 
 DIST_SUBDIRS := ldiskfs \
-       @SNMP_DIST_SUBDIR@ \
        lustre-iokit \
        @LIBCFS_SUBDIR@ \
+       @SNMP_DIST_SUBDIR@ \
        lnet \
        lustre \
        config contrib
@@ -102,7 +102,9 @@ EXTRA_DIST = @PACKAGE_TARNAME@.spec \
        build/Rules.in                  \
        build/gen_filelist.sh           \
        config.h.in                     \
-       undef.h
+       undef.h                         \
+       lustre-dkms_pre-build.sh        \
+       lustre-dkms_post-build.sh
 
 rpm-local:
        @(if test -z "$(RPMBUILD)"; then \
@@ -119,6 +121,39 @@ rpm-local:
        $(MKDIR_P) $(rpmbuilddir)/SPECS && \
        $(MKDIR_P) $(rpmbuilddir)/SOURCES)
 
+if SERVER
+DKMS_PACKAGE=$(PACKAGE)
+DKMS_SERVER=--with servers
+else
+DKMS_PACKAGE=$(PACKAGE)-client
+DKMS_SERVER=--without servers
+endif
+
+# Only zfs Lustre DKMS Server is supported, so previous configure command
+# must use related parameters for success.
+dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
+       rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
+       $(MAKE) $(AM_MAKEFLAGS) \
+               rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
+       $(RPMBUILD) \
+               --define "_tmppath $$rpmbuilddir/TMP" \
+               --define "_topdir $$rpmbuilddir" \
+               --define "_sourcedir $(top_srcdir)" \
+               $(DKMS_SERVER) \
+               --bs $(PACKAGE)-dkms.spec || exit 1; \
+       cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
+       rm -rf $$rpmbuilddir
+
+dkms-rpm: dkms-srpm
+       rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
+       $(RPMBUILD) \
+               --define "_tmppath $$rpmbuilddir/TMP" \
+               --define "_topdir $$rpmbuilddir" \
+               @RPMBUILD_BINARY_ARGS@ \
+               --rebuild $(DKMS_PACKAGE)-dkms-*.src.rpm || exit 1; \
+       cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
+       rm -rf $$rpmbuilddir
+
 rpms: srpm
        rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
        $(MAKE) $(AM_MAKEFLAGS) \