2010-05-17 22:18:00 +00:00
|
|
|
###############################################################################
|
2013-02-08 19:02:08 +00:00
|
|
|
# Copyright (C) 2007-2013 Lawrence Livermore National Security, LLC.
|
2010-05-17 22:18:00 +00:00
|
|
|
# Copyright (C) 2007 The Regents of the University of California.
|
|
|
|
# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
|
|
|
|
###############################################################################
|
2010-07-27 17:19:44 +00:00
|
|
|
# Build targets for RPM packages.
|
2010-05-17 22:18:00 +00:00
|
|
|
###############################################################################
|
|
|
|
|
2013-02-08 19:02:08 +00:00
|
|
|
srpm-kmod:
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-kmod" \
|
|
|
|
def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_KMOD}' srpm-common
|
|
|
|
|
|
|
|
srpm-dkms:
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \
|
|
|
|
def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_DKMS}' srpm-common
|
2010-07-27 17:19:44 +00:00
|
|
|
|
|
|
|
srpm-utils:
|
2013-02-08 19:02:08 +00:00
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
|
|
|
|
def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_UTIL}' srpm-common
|
2010-07-27 17:19:44 +00:00
|
|
|
|
2013-02-08 19:02:08 +00:00
|
|
|
srpm: srpm-kmod srpm-dkms srpm-utils
|
|
|
|
srpms: srpm-kmod srpm-dkms srpm-utils
|
2010-07-27 17:19:44 +00:00
|
|
|
|
2013-02-08 19:02:08 +00:00
|
|
|
rpm-kmod: srpm-kmod
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-kmod" \
|
|
|
|
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_KMOD}' rpm-common
|
2012-08-07 20:57:03 +00:00
|
|
|
|
2013-02-08 19:02:08 +00:00
|
|
|
rpm-dkms: srpm-dkms
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \
|
|
|
|
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common
|
2010-07-27 17:19:44 +00:00
|
|
|
|
|
|
|
rpm-utils: srpm-utils
|
2013-02-08 19:02:08 +00:00
|
|
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
|
|
|
|
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common
|
2010-07-27 17:19:44 +00:00
|
|
|
|
2013-02-08 19:02:08 +00:00
|
|
|
rpm: rpm-kmod rpm-dkms rpm-utils
|
|
|
|
rpms: rpm-kmod rpm-dkms rpm-utils
|
2010-07-27 17:19:44 +00:00
|
|
|
|
2009-07-01 21:37:44 +00:00
|
|
|
rpm-local:
|
2010-07-27 17:19:44 +00: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-01 21:37:44 +00:00
|
|
|
mkdir -p $(rpmbuild)/TMP && \
|
|
|
|
mkdir -p $(rpmbuild)/BUILD && \
|
|
|
|
mkdir -p $(rpmbuild)/RPMS && \
|
|
|
|
mkdir -p $(rpmbuild)/SRPMS && \
|
2010-07-27 17:19:44 +00:00
|
|
|
mkdir -p $(rpmbuild)/SPECS && \
|
2013-02-08 19:02:08 +00:00
|
|
|
cp ${RPM_SPEC_DIR}/$(rpmspec) $(rpmbuild)/SPECS && \
|
2010-07-27 17:19:44 +00:00
|
|
|
mkdir -p $(rpmbuild)/SOURCES && \
|
2014-06-11 01:57:48 +00:00
|
|
|
cp $(top_srcdir)/scripts/kmodtool $(rpmbuild)/SOURCES && \
|
2010-07-27 17:19:44 +00:00
|
|
|
cp $(distdir).tar.gz $(rpmbuild)/SOURCES)
|
2009-07-01 21:37:44 +00:00
|
|
|
|
|
|
|
srpm-common: dist
|
2013-02-08 19:02:08 +00:00
|
|
|
@(dist=`$(RPM) --eval %{?dist}`; \
|
|
|
|
rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \
|
2009-07-01 21:37:44 +00:00
|
|
|
rpmspec=$(pkg).spec; \
|
|
|
|
rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) \
|
|
|
|
rpmbuild="$$rpmbuild" \
|
|
|
|
rpmspec="$$rpmspec" \
|
|
|
|
rpm-local || exit 1; \
|
2014-06-09 21:35:42 +00:00
|
|
|
LANG=C $(RPMBUILD) \
|
2009-07-01 21:37:44 +00:00
|
|
|
--define "_tmppath $$rpmbuild/TMP" \
|
|
|
|
--define "_topdir $$rpmbuild" \
|
2013-02-08 19:02:08 +00:00
|
|
|
$(def) -bs $$rpmbuild/SPECS/$$rpmspec || exit 1; \
|
2009-07-01 21:37:44 +00:00
|
|
|
cp $$rpmbuild/SRPMS/$$rpmpkg . || exit 1; \
|
2013-02-08 19:02:08 +00:00
|
|
|
rm -R $$rpmbuild)
|
2009-07-01 21:37:44 +00:00
|
|
|
|
|
|
|
rpm-common:
|
2013-02-08 19:02:08 +00:00
|
|
|
@(dist=`$(RPM) --eval %{?dist}`; \
|
|
|
|
rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \
|
2009-07-01 21:37:44 +00:00
|
|
|
rpmspec=$(pkg).spec; \
|
|
|
|
rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) \
|
|
|
|
rpmbuild="$$rpmbuild" \
|
|
|
|
rpmspec="$$rpmspec" \
|
|
|
|
rpm-local || exit 1; \
|
2014-06-09 21:35:42 +00:00
|
|
|
LANG=C ${RPMBUILD} \
|
2009-07-01 21:37:44 +00:00
|
|
|
--define "_tmppath $$rpmbuild/TMP" \
|
|
|
|
--define "_topdir $$rpmbuild" \
|
2013-02-08 19:02:08 +00:00
|
|
|
$(def) --rebuild $$rpmpkg || exit 1; \
|
2009-07-01 21:37:44 +00:00
|
|
|
cp $$rpmbuild/RPMS/*/* . || exit 1; \
|
2013-02-08 19:02:08 +00:00
|
|
|
rm -R $$rpmbuild)
|