]> git.proxmox.com Git - mirror_spl-debian.git/blame - config/rpm.am
Merge branch 'upstream'
[mirror_spl-debian.git] / config / rpm.am
CommitLineData
716154c5
BB
1###############################################################################
2# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
3# Copyright (C) 2007 The Regents of the University of California.
4# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
5###############################################################################
287b2fb1 6# Build targets for RPM packages.
716154c5
BB
7###############################################################################
8
287b2fb1 9srpm-modules:
016432fb 10if CONFIG_KERNEL
287b2fb1 11 $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" srpm-common
016432fb 12endif
287b2fb1
BB
13
14srpm-utils:
016432fb 15if CONFIG_USER
287b2fb1 16 $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" srpm-common
016432fb 17endif
287b2fb1
BB
18
19srpm: srpm-modules srpm-utils
20
d83d25c2
PS
21rpm-dkms: srpm-modules
22if CONFIG_KERNEL
23 $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" dkms-common
24endif
25
287b2fb1 26rpm-modules: srpm-modules
016432fb 27if CONFIG_KERNEL
287b2fb1 28 $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" rpm-common
016432fb 29endif
287b2fb1
BB
30
31rpm-utils: srpm-utils
016432fb 32if CONFIG_USER
287b2fb1 33 $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" rpm-common
016432fb 34endif
287b2fb1 35
d83d25c2 36rpm: rpm-modules rpm-utils rpm-dkms
287b2fb1 37
86933a6e 38rpm-local:
287b2fb1
BB
39 @(if test "${HAVE_RPMBUILD}" = "no"; then \
40 echo -e "\n" \
41 "*** Required util ${RPMBUILD} missing. Please install the\n" \
42 "*** package for your distribution which provides ${RPMBUILD},\n" \
43 "*** re-run configure, and try again.\n"; \
44 exit 1; \
45 fi; \
86933a6e
BB
46 mkdir -p $(rpmbuild)/TMP && \
47 mkdir -p $(rpmbuild)/BUILD && \
48 mkdir -p $(rpmbuild)/RPMS && \
49 mkdir -p $(rpmbuild)/SRPMS && \
287b2fb1
BB
50 mkdir -p $(rpmbuild)/SPECS && \
51 cp $(rpmspec) $(rpmbuild)/SPECS && \
52 mkdir -p $(rpmbuild)/SOURCES && \
53 cp $(distdir).tar.gz $(rpmbuild)/SOURCES)
86933a6e 54
d83d25c2
PS
55dkms-common:
56 rpmpkg=$(pkg)-$(SPL_META_VERSION)-$(SPL_META_RELEASE).src.rpm; \
57 rpmspec=$(pkg).spec; \
58 rpmdkms=$(pkg)-dkms-$(SPL_META_VERSION)-$(SPL_META_RELEASE).noarch.rpm;\
59 rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
60 $(MAKE) $(AM_MAKEFLAGS) \
61 rpmbuild="$$rpmbuild" \
62 rpmspec="$$rpmspec" \
63 rpm-local || exit 1; \
64 $(RPMBUILD) \
65 --define "_tmppath $$rpmbuild/TMP" \
66 --define "_topdir $$rpmbuild" \
67 --define "dist %{nil}" \
68 --define "_without_kernel 1" \
69 --define "_without_kernel_debug 1" \
70 --define "_with_kernel_dkms 1" \
71 --nodeps --rebuild $$rpmpkg || exit 1; \
72 cp $$rpmbuild/RPMS/noarch/$$rpmdkms . || exit 1; \
73 $(RM) -R $$rpmbuild
74
86933a6e
BB
75srpm-common: dist
76 rpmpkg=$(pkg)-$(SPL_META_VERSION)-$(SPL_META_RELEASE).src.rpm; \
77 rpmspec=$(pkg).spec; \
78 rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
79 $(MAKE) $(AM_MAKEFLAGS) \
80 rpmbuild="$$rpmbuild" \
81 rpmspec="$$rpmspec" \
82 rpm-local || exit 1; \
287b2fb1 83 $(RPMBUILD) \
86933a6e
BB
84 --define "_tmppath $$rpmbuild/TMP" \
85 --define "_topdir $$rpmbuild" \
86 --define "build_src_rpm 1" \
87 --define "dist %{nil}" \
88 --nodeps -bs $$rpmbuild/SPECS/$$rpmspec || exit 1; \
89 cp $$rpmbuild/SRPMS/$$rpmpkg . || exit 1; \
90 $(RM) -R $$rpmbuild
91
92rpm-common:
93 rpmpkg=$(pkg)-$(SPL_META_VERSION)-$(SPL_META_RELEASE).src.rpm; \
94 rpmspec=$(pkg).spec; \
95 rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
96 $(MAKE) $(AM_MAKEFLAGS) \
97 rpmbuild="$$rpmbuild" \
98 rpmspec="$$rpmspec" \
99 rpm-local || exit 1; \
287b2fb1 100 ${RPMBUILD} \
86933a6e
BB
101 --define "_tmppath $$rpmbuild/TMP" \
102 --define "_topdir $$rpmbuild" \
103 --define "dist %{nil}" \
104 --define "require_kdir $(LINUX)" \
105 --define "require_kobj $(LINUX_OBJ)" \
106 --define "require_kver $(LINUX_VERSION)" \
3c208a54
BB
107 --define "$(DEBUG_SPL) 1" \
108 --define "$(DEBUG_LOG) 1" \
109 --define "$(DEBUG_KMEM) 1" \
110 --define "$(DEBUG_KMEM_TRACKING) 1" \
86933a6e
BB
111 --nodeps --rebuild $$rpmpkg || exit 1; \
112 cp $$rpmbuild/RPMS/*/* . || exit 1; \
113 $(RM) -R $$rpmbuild