2010-05-18 02:18:00 +04:00
|
|
|
###############################################################################
|
|
|
|
# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
|
|
|
|
# Copyright (C) 2007 The Regents of the University of California.
|
|
|
|
# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
|
|
|
|
###############################################################################
|
2010-07-27 21:19:44 +04:00
|
|
|
# Build targets for RPM packages.
|
2010-05-18 02:18:00 +04:00
|
|
|
###############################################################################
|
|
|
|
|
2010-07-27 21:19:44 +04:00
|
|
|
srpm-modules:
|
2012-07-17 12:08:22 +04:00
|
|
|
if CONFIG_KERNEL
|
2010-07-27 21:19:44 +04:00
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" srpm-common
|
2012-07-17 12:08:22 +04:00
|
|
|
endif
|
2010-07-27 21:19:44 +04:00
|
|
|
|
|
|
|
srpm-utils:
|
2012-07-17 12:08:22 +04:00
|
|
|
if CONFIG_USER
|
2010-07-27 21:19:44 +04:00
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" srpm-common
|
2012-07-17 12:08:22 +04:00
|
|
|
endif
|
2010-07-27 21:19:44 +04:00
|
|
|
|
|
|
|
srpm: srpm-modules srpm-utils
|
|
|
|
|
2012-08-08 00:57:03 +04:00
|
|
|
rpm-dkms: srpm-modules
|
|
|
|
if CONFIG_KERNEL
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" dkms-common
|
|
|
|
endif
|
|
|
|
|
2010-07-27 21:19:44 +04:00
|
|
|
rpm-modules: srpm-modules
|
2012-07-17 12:08:22 +04:00
|
|
|
if CONFIG_KERNEL
|
2010-07-27 21:19:44 +04:00
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" rpm-common
|
2012-07-17 12:08:22 +04:00
|
|
|
endif
|
2010-07-27 21:19:44 +04:00
|
|
|
|
|
|
|
rpm-utils: srpm-utils
|
2012-07-17 12:08:22 +04:00
|
|
|
if CONFIG_USER
|
2010-07-27 21:19:44 +04:00
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" rpm-common
|
2012-07-17 12:08:22 +04:00
|
|
|
endif
|
2010-07-27 21:19:44 +04:00
|
|
|
|
2012-08-08 00:57:03 +04:00
|
|
|
rpm: rpm-modules rpm-utils rpm-dkms
|
2010-07-27 21:19:44 +04:00
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
rpm-local:
|
2010-07-27 21:19:44 +04:00
|
|
|
@(if test "${HAVE_RPMBUILD}" = "no"; then \
|
|
|
|
echo -e "\n" \
|
|
|
|
"*** Required util ${RPMBUILD} missing. Please install the\n" \
|
|
|
|
"*** package for your distribution which provides ${RPMBUILD},\n" \
|
|
|
|
"*** re-run configure, and try again.\n"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2009-07-02 01:37:44 +04:00
|
|
|
mkdir -p $(rpmbuild)/TMP && \
|
|
|
|
mkdir -p $(rpmbuild)/BUILD && \
|
|
|
|
mkdir -p $(rpmbuild)/RPMS && \
|
|
|
|
mkdir -p $(rpmbuild)/SRPMS && \
|
2010-07-27 21:19:44 +04:00
|
|
|
mkdir -p $(rpmbuild)/SPECS && \
|
|
|
|
cp $(rpmspec) $(rpmbuild)/SPECS && \
|
|
|
|
mkdir -p $(rpmbuild)/SOURCES && \
|
|
|
|
cp $(distdir).tar.gz $(rpmbuild)/SOURCES)
|
2009-07-02 01:37:44 +04:00
|
|
|
|
2012-08-08 00:57:03 +04:00
|
|
|
dkms-common:
|
|
|
|
rpmpkg=$(pkg)-$(SPL_META_VERSION)-$(SPL_META_RELEASE).src.rpm; \
|
|
|
|
rpmspec=$(pkg).spec; \
|
|
|
|
rpmdkms=$(pkg)-dkms-$(SPL_META_VERSION)-$(SPL_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
|
|
|
|
|
2009-07-02 01:37:44 +04:00
|
|
|
srpm-common: dist
|
|
|
|
rpmpkg=$(pkg)-$(SPL_META_VERSION)-$(SPL_META_RELEASE).src.rpm; \
|
|
|
|
rpmspec=$(pkg).spec; \
|
|
|
|
rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) \
|
|
|
|
rpmbuild="$$rpmbuild" \
|
|
|
|
rpmspec="$$rpmspec" \
|
|
|
|
rpm-local || exit 1; \
|
2010-07-27 21:19:44 +04:00
|
|
|
$(RPMBUILD) \
|
2009-07-02 01:37:44 +04:00
|
|
|
--define "_tmppath $$rpmbuild/TMP" \
|
|
|
|
--define "_topdir $$rpmbuild" \
|
|
|
|
--define "build_src_rpm 1" \
|
|
|
|
--define "dist %{nil}" \
|
|
|
|
--nodeps -bs $$rpmbuild/SPECS/$$rpmspec || exit 1; \
|
|
|
|
cp $$rpmbuild/SRPMS/$$rpmpkg . || exit 1; \
|
|
|
|
$(RM) -R $$rpmbuild
|
|
|
|
|
|
|
|
rpm-common:
|
|
|
|
rpmpkg=$(pkg)-$(SPL_META_VERSION)-$(SPL_META_RELEASE).src.rpm; \
|
|
|
|
rpmspec=$(pkg).spec; \
|
|
|
|
rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) \
|
|
|
|
rpmbuild="$$rpmbuild" \
|
|
|
|
rpmspec="$$rpmspec" \
|
|
|
|
rpm-local || exit 1; \
|
2010-07-27 21:19:44 +04:00
|
|
|
${RPMBUILD} \
|
2009-07-02 01:37:44 +04:00
|
|
|
--define "_tmppath $$rpmbuild/TMP" \
|
|
|
|
--define "_topdir $$rpmbuild" \
|
|
|
|
--define "dist %{nil}" \
|
|
|
|
--define "require_kdir $(LINUX)" \
|
|
|
|
--define "require_kobj $(LINUX_OBJ)" \
|
|
|
|
--define "require_kver $(LINUX_VERSION)" \
|
2012-02-27 22:42:07 +04:00
|
|
|
--define "$(DEBUG_SPL) 1" \
|
|
|
|
--define "$(DEBUG_LOG) 1" \
|
|
|
|
--define "$(DEBUG_KMEM) 1" \
|
|
|
|
--define "$(DEBUG_KMEM_TRACKING) 1" \
|
2009-07-02 01:37:44 +04:00
|
|
|
--nodeps --rebuild $$rpmpkg || exit 1; \
|
|
|
|
cp $$rpmbuild/RPMS/*/* . || exit 1; \
|
|
|
|
$(RM) -R $$rpmbuild
|