diff options
Diffstat (limited to 'config/rpm.am')
-rw-r--r-- | config/rpm.am | 99 |
1 files changed, 40 insertions, 59 deletions
diff --git a/config/rpm.am b/config/rpm.am index 9deafb3de..8b33bb5b6 100644 --- a/config/rpm.am +++ b/config/rpm.am @@ -1,31 +1,40 @@ -srpm-modules: -if CONFIG_KERNEL - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" srpm-common -endif +############################################################################### +# Copyright (C) 2007-2013 Lawrence Livermore National Security, LLC. +# Copyright (C) 2007 The Regents of the University of California. +# Written by Brian Behlendorf <[email protected]>. +############################################################################### +# Build targets for RPM packages. +############################################################################### + +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 srpm-utils: -if CONFIG_USER - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" srpm-common -endif + $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ + def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_UTIL}' srpm-common -srpm: srpm-modules srpm-utils +srpm: srpm-kmod srpm-dkms srpm-utils +srpms: srpm-kmod srpm-dkms srpm-utils -rpm-dkms: srpm-modules -if CONFIG_KERNEL - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" dkms-common -endif +rpm-kmod: srpm-kmod + $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-kmod" \ + def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_KMOD}' rpm-common -rpm-modules: srpm-modules -if CONFIG_KERNEL - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" rpm-common -endif +rpm-dkms: srpm-dkms + $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \ + def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common rpm-utils: srpm-utils -if CONFIG_USER - $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" rpm-common -endif + $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ + def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common -rpm: rpm-modules rpm-utils rpm-dkms +rpm: rpm-kmod rpm-dkms rpm-utils +rpms: rpm-kmod rpm-dkms rpm-utils rpm-local: @(if test "${HAVE_RPMBUILD}" = "no"; then \ @@ -40,32 +49,14 @@ rpm-local: mkdir -p $(rpmbuild)/RPMS && \ mkdir -p $(rpmbuild)/SRPMS && \ mkdir -p $(rpmbuild)/SPECS && \ - cp $(rpmspec) $(rpmbuild)/SPECS && \ + cp ${RPM_SPEC_DIR}/$(rpmspec) $(rpmbuild)/SPECS && \ mkdir -p $(rpmbuild)/SOURCES && \ + cp scripts/kmodtool $(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; \ + @(dist=`$(RPM) --eval %{?dist}`; \ + rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \ rpmspec=$(pkg).spec; \ rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \ $(MAKE) $(AM_MAKEFLAGS) \ @@ -75,32 +66,22 @@ srpm-common: dist $(RPMBUILD) \ --define "_tmppath $$rpmbuild/TMP" \ --define "_topdir $$rpmbuild" \ - --define "build_src_rpm 1" \ - --define "dist %{nil}" \ - --nodeps -bs $$rpmbuild/SPECS/$$rpmspec || exit 1; \ + $(def) -bs $$rpmbuild/SPECS/$$rpmspec || exit 1; \ cp $$rpmbuild/SRPMS/$$rpmpkg . || exit 1; \ - $(RM) -R $$rpmbuild + rm -R $$rpmbuild) rpm-common: - rpmpkg=$(pkg)-$(ZFS_META_VERSION)-$(ZFS_META_RELEASE).src.rpm; \ + @(dist=`$(RPM) --eval %{?dist}`; \ + rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \ rpmspec=$(pkg).spec; \ rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \ $(MAKE) $(AM_MAKEFLAGS) \ rpmbuild="$$rpmbuild" \ rpmspec="$$rpmspec" \ rpm-local || exit 1; \ - $(RPMBUILD) \ + ${RPMBUILD} \ --define "_tmppath $$rpmbuild/TMP" \ --define "_topdir $$rpmbuild" \ - --define "dist %{nil}" \ - --define "require_kdir $(LINUX)" \ - --define "require_kobj $(LINUX_OBJ)" \ - --define "require_kver $(LINUX_VERSION)" \ - --define "require_spldir $(SPL)" \ - --define "require_splobj $(SPL_OBJ)" \ - --define "require_splver $(SPL_VERSION)" \ - --define "$(DEBUG_ZFS) 1" \ - --define "$(DEBUG_DMU_TX) 1" \ - --nodeps --rebuild $$rpmpkg || exit 1; \ + $(def) --rebuild $$rpmpkg || exit 1; \ cp $$rpmbuild/RPMS/*/* . || exit 1; \ - $(RM) -R $$rpmbuild + rm -R $$rpmbuild) |