Skip to content
Browse files

Fix some native build problems and sync with internal tree.

  • Loading branch information...
1 parent 6fd12e6 commit 0c4344bd6b3e326cb32f0bb136a2f7e98e49f171 @qbarnes qbarnes committed
View
4 linux/README
@@ -43,5 +43,5 @@ and iptables rules to set the return address on the packets:
An example for IPv6:
sudo ifconfig lo:3 add fc00:1000:0:6::10/128
sudo ifconfig lo:4 add fc00:1000:0:6::21/128
-# iptables -t mangle -A INPUT -m dscp --dscp 10 -j DADDR --set-daddr=fc00:1000:0:6::10
-# iptables -t mangle -A INPUT -m dscp --dscp 11 -j DADDR --set-daddr=fc00:1000:0:6::21
+# ip6tables -t mangle -A INPUT -m dscp --dscp 10 -j DADDR --set-daddr=fc00:1000:0:6::10
+# ip6tables -t mangle -A INPUT -m dscp --dscp 11 -j DADDR --set-daddr=fc00:1000:0:6::21
View
19 linux/iptables-daddr.EL/Makefile.native
@@ -9,15 +9,16 @@ ifneq ($(shell date '+%Y%m%d'),$(RELEASE))
endif
+kverrelvararch := $(shell uname -r)
+karch := $(shell uname -p)
+
kmodtool := ./kmodtool
-uname_r := $(shell uname -r)
-uname_m := $(shell uname -m)
-kmt_verrel := $(shell $(kmodtool) verrel $(uname_r))
-kmt_variant := $(shell $(kmodtool) variant $(uname_r))
+kmt_verrel := $(shell $(kmodtool) verrel $(kverrelvararch))
+kmt_variant := $(shell $(kmodtool) variant $(kverrelvararch))
-PLATFORMS ?= rhel4.$(uname_m)
+PLATFORMS ?= rhel4.$(karch)
-KVERREL_rhel4 = $(patsubst %.$(uname_m),%,$(kmt_verrel))
+KVERREL_rhel4 = $(patsubst %.$(karch),%,$(kmt_verrel))
OSDIST_rhel4 = .EL
DIST_rhel4 = .EL
URL_rhel4 = https://github.com/yahoo/l3dsr
@@ -28,11 +29,11 @@ MKBUILDMKFILE = mk/Makefile.build
BINBUILDMKFILE = mk/Makefile.bpkg
# Just reuse one of the architectures' chroots for the SRPM builds.
-PKGARCH_src = $(uname_m)
+PKGARCH_src = $(karch)
BUILDDIR_rhel4.src ?= build-rhel4-src
-BUILDDIR_rhel4.$(uname_m) ?= build-rhel4-$(uname_m)
-KVARIANTS_rhel4.$(uname_m) ?= $(kmt_variant)
+BUILDDIR_rhel4.$(karch) ?= build-rhel4-$(karch)
+KVARIANTS_rhel4.$(karch) ?= $(kmt_variant)
CREATEENVCOOKIE = .createenv-cookie
PREPENVCOOKIE = .prepenv-cookie
View
14 linux/iptables-daddr.EL/iptables-daddr.spec.m4
@@ -72,8 +72,8 @@ ifelse(__OSDIST__,{{.EL}},{{dnl
%endif
}})dnl
-# hint: this can he overridden with "--define kvariant foo bar" on the
-# rpmbuild command line, e.g. --define 'kvariant "" smp'
+# hint: this can he overridden with "--define kvariants foo bar" on the
+# rpmbuild command line, e.g. --define 'kvariants "" smp'
%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?xenvar} %{?kdumpvar} %{?paevar}}
%{!?kvariants1: %define kvariants1 %{?upvar} %{?smpvar}}
%{!?kvariants2: %define kvariants2 %{?xenvar} %{?kdumpvar} %{?paevar}}
@@ -90,16 +90,16 @@ ifelse(__OSDIST__,{{.EL}},{{dnl
%define kmod_version %{version}
%define kmod_release %{release}
}})dnl
-%{expand:%(%{kmodtool} rpmtemplate_kmp %{kmod_name} %{kverrel} %{kvariants1} 2>/dev/null | sed -e 's@^\(%%preun \)\(.*\)$@%%pre \2\n%{prekmodrm}\n\1\2\n%{preunkmodrm}@g')}
-%{expand:%(%{kmodtool} rpmtemplate_kmp %{kmod_name} %{kverrel} %{kvariants2} 2>/dev/null | sed -e 's@^\(%%preun \)\(.*\)$@%%pre \2\n%{prekmodrm}\n\1\2\n%{preunkmodrm}@g')}
+%{expand:%(%{kmodtool} %{kmodtemplate} %{kmod_name} %{kverrel} %{kvariants1} 2>/dev/null | sed -e 's@^\(%%preun \)\(.*\)$@%%pre \2\n%{prekmodrm}\n\1\2\n%{preunkmodrm}@g')}
+%{expand:%(%{kmodtool} %{kmodtemplate} %{kmod_name} %{kverrel} %{kvariants2} 2>/dev/null | sed -e 's@^\(%%preun \)\(.*\)$@%%pre \2\n%{prekmodrm}\n\1\2\n%{preunkmodrm}@g')}
%description
Enables IPv4 destination address rewriting using iptables rules.
-The %{name} package provides an iptables user-space
+The "iptables-daddr" package provides an iptables user-space
plugin "DADDR" target. The plugin requires installation of a
-"kmod-%{name}" package providing a matching kernel module for
-the running kernel.
+"kmod-iptables-daddr" package providing a matching kernel module
+for the running kernel.
For further information: %{url}
View
20 linux/iptables-daddr.el5/Makefile.native
@@ -9,15 +9,16 @@ ifneq ($(shell date '+%Y%m%d'),$(RELEASE))
endif
+kverrelvararch := $(shell uname -r)
+karch := $(shell uname -p)
+
kmodtool := /usr/lib/rpm/redhat/kmodtool
-uname_r := $(shell uname -r)
-uname_m := $(shell uname -m)
-kmt_verrel := $(shell $(kmodtool) verrel $(uname_r))
-kmt_variant := $(shell $(kmodtool) variant $(uname_r))
+kmt_verrel := $(shell $(kmodtool) verrel $(kverrelvararch))
+kmt_variant := $(shell $(kmodtool) variant $(kverrelvararch))
-PLATFORMS ?= rhel5.$(uname_m)
+PLATFORMS ?= rhel5.$(karch)
-KVERREL_rhel5 = $(patsubst %.$(uname_m),%,$(kmt_verrel))
+KVERREL_rhel5 = $(patsubst %.$(karch),%,$(kmt_verrel))
OSDIST_rhel5 = .el5
DIST_rhel5 = .el5
URL_rhel5 = https://github.com/yahoo/l3dsr
@@ -27,12 +28,11 @@ BUILDRUNCMD = $(BUILDPATH)/runbuildenv
MKBUILDMKFILE = mk/Makefile.build
BINBUILDMKFILE = mk/Makefile.bpkg
-# Just reuse one of the architectures' chroots for the SRPM builds.
-PKGARCH_src = $(uname_m)
+PKGARCH_src = $(karch)
BUILDDIR_rhel5.src ?= build-rhel5-src
-BUILDDIR_rhel5.$(uname_m) ?= build-rhel5-$(uname_m)
-KVARIANTS_rhel5.$(uname_m) ?= $(kmt_variant)
+BUILDDIR_rhel5.$(karch) ?= build-rhel5-$(karch)
+KVARIANTS_rhel5.$(karch) ?= $(kmt_variant)
CREATEENVCOOKIE = .createenv-cookie
PREPENVCOOKIE = .prepenv-cookie
View
2 linux/iptables-daddr.el5/iptables-daddr.spec.m4
@@ -81,7 +81,7 @@ ifelse(__OSDIST__,{{.EL}},{{dnl
# hint: this can he overridden with "--define kvariants foo bar" on the
# rpmbuild command line, e.g. --define 'kvariants "" smp'
-%{!?kvariants: %define kvariants %{?upvar} %{?xenvar} %{?kdumpvar} %{?paevar}}
+%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?xenvar} %{?kdumpvar} %{?paevar}}
# Use kmodtool to generate individual kmod subpackages directives.
# Hack in our own preinstall script.
View
19 linux/iptables-daddr.el6/Makefile.native
@@ -9,15 +9,16 @@ ifneq ($(shell date '+%Y%m%d'),$(RELEASE))
endif
+kverrelvararch := $(shell uname -r)
+karch := $(shell uname -p)
+
kmodtool := ./kmodtool
-uname_r := $(shell uname -r)
-uname_m := $(shell uname -m)
-kmt_verrel := $(shell $(kmodtool) verrel $(uname_r))
-kmt_variant := $(shell $(kmodtool) variant $(uname_r))
+kmt_verrel := $(shell $(kmodtool) verrel $(kverrelvararch))
+kmt_variant := $(shell $(kmodtool) variant $(kverrelvararch))
-PLATFORMS ?= rhel6.$(uname_m)
+PLATFORMS ?= rhel6.$(karch)
-KVERREL_rhel6 = $(patsubst %.$(uname_m),%,$(kmt_verrel))
+KVERREL_rhel6 = $(patsubst %.$(karch),%,$(kmt_verrel))
OSDIST_rhel6 = .el6
DIST_rhel6 = .el6
URL_rhel6 = https://github.com/yahoo/l3dsr
@@ -28,11 +29,11 @@ MKBUILDMKFILE = mk/Makefile.build
BINBUILDMKFILE = mk/Makefile.bpkg
# Just reuse one of the architectures' chroots for the SRPM builds.
-PKGARCH_src = $(uname_m)
+PKGARCH_src = $(karch)
BUILDDIR_rhel6.src ?= build-rhel6-src
-BUILDDIR_rhel6.$(uname_m) ?= build-rhel6-$(uname_m)
-KVARIANTS_rhel6.$(uname_m) ?= $(kmt_variant)
+BUILDDIR_rhel6.$(karch) ?= build-rhel6-$(karch)
+KVARIANTS_rhel6.$(karch) ?= $(kmt_variant)
CREATEENVCOOKIE = .createenv-cookie
PREPENVCOOKIE = .prepenv-cookie
View
2 linux/iptables-daddr.el6/iptables-daddr.spec.m4
@@ -76,7 +76,7 @@ ifelse(__OSDIST__,{{.EL}},{{dnl
# hint: this can he overridden with "--define kvariants foo bar" on the
# rpmbuild command line, e.g. --define 'kvariants "" smp'
-%{!?kvariants: %define kvariants %{?upvar} %{?xenvar} %{?kdumpvar} %{?paevar}}
+%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?xenvar} %{?kdumpvar} %{?paevar}}
# Use kmodtool to generate individual kmod subpackages directives.
# Hack in our own preinstall script.
View
19 linux/iptables-daddr.fc17/Makefile.native
@@ -9,15 +9,16 @@ ifneq ($(shell date '+%Y%m%d'),$(RELEASE))
endif
+kverrelvararch := $(shell uname -r)
+karch := $(shell uname -p)
+
kmodtool := ./kmodtool
-uname_r := $(shell uname -r)
-uname_m := $(shell uname -m)
-kmt_verrel := $(shell $(kmodtool) verrel $(uname_r))
-kmt_variant := $(shell $(kmodtool) variant $(uname_r))
+kmt_verrel := $(shell $(kmodtool) verrel $(kverrelvararch))
+kmt_variant := $(shell $(kmodtool) variant $(kverrelvararch))
-PLATFORMS ?= fc17.$(uname_m)
+PLATFORMS ?= fc17.$(karch)
-KVERREL_fc17 = $(patsubst %.$(uname_m),%,$(kmt_verrel))
+KVERREL_fc17 = $(patsubst %.$(karch),%,$(kmt_verrel))
OSDIST_fc17 = .fc17
DIST_fc17 = .fc17
URL_fc17 = https://github.com/yahoo/l3dsr
@@ -28,11 +29,11 @@ MKBUILDMKFILE = mk/Makefile.build
BINBUILDMKFILE = mk/Makefile.bpkg
# Just reuse one of the architectures' chroots for the SRPM builds.
-PKGARCH_src = $(uname_m)
+PKGARCH_src = $(karch)
BUILDDIR_fc17.src ?= build-fc17-src
-BUILDDIR_fc17.$(uname_m) ?= build-fc17-$(uname_m)
-KVARIANTS_fc17.$(uname_m) ?= $(kmt_variant)
+BUILDDIR_fc17.$(karch) ?= build-fc17-$(karch)
+KVARIANTS_fc17.$(karch) ?= $(kmt_variant)
CREATEENVCOOKIE = .createenv-cookie
PREPENVCOOKIE = .prepenv-cookie
View
23 linux/iptables-daddr.fc17/iptables-daddr.spec.m4
@@ -40,7 +40,9 @@ Source1: kmodtool
%define prekmodrm if [ "$1" -eq 1 ];then %{kmodrm};fi
%define preunkmodrm if [ "$1" -eq 0 ];then %{kmodrm};fi
-ifelse(__OSDIST__,{{.el5}},{{dnl
+ifelse(__OSDIST__,{{.EL}},{{dnl
+%define kverrel %(%{kmodtool} verrel %{?kmod_kernel_version} 2>/dev/null)
+}},__OSDIST__,{{.el5}},{{dnl
%define kverrel %(%{kmodtool} verrel %{?kmod_kernel_version} 2>/dev/null)
}},{{dnl
%define kverrel %(%{kmodtool} verrel %{?kmod_kernel_version}.%{_target_cpu} 2>/dev/null)
@@ -52,7 +54,18 @@ ifelse(__OSDIST__,{{.el5}},{{dnl
%define kdumpvar kdump
%endif
-ifelse(__OSDIST__,{{.el5}},{{dnl
+ifelse(__OSDIST__,{{.EL}},{{dnl
+%ifarch i686
+%define paevar hugemem
+%define smpvar smp
+%endif
+%ifarch x86_64
+%define smpvar smp largesmp
+%endif
+%ifarch i686 ia64 x86_64
+%define xenvar xenU
+%endif
+}},__OSDIST__,{{.el5}},{{dnl
%ifarch i686
%define paevar PAE
%endif
@@ -63,11 +76,13 @@ ifelse(__OSDIST__,{{.el5}},{{dnl
# hint: this can he overridden with "--define kvariants foo bar" on the
# rpmbuild command line, e.g. --define 'kvariants "" smp'
-%{!?kvariants: %define kvariants %{?upvar} %{?xenvar} %{?kdumpvar} %{?paevar}}
+%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?xenvar} %{?kdumpvar} %{?paevar}}
# Use kmodtool to generate individual kmod subpackages directives.
# Hack in our own preinstall script.
-ifelse(__OSDIST__,{{.el5}},{{dnl
+ifelse(__OSDIST__,{{.EL}},{{dnl
+%define kmodtemplate rpmtemplate_kmp
+}},__OSDIST__,{{.el5}},{{dnl
%define kmodtemplate rpmtemplate_kmp
}},{{dnl
%define kmodtemplate rpmtemplate
View
2 linux/mk/Makefile.bpkg
@@ -48,7 +48,7 @@ $(SRPM): $(SSRPM)
$(SSRPM) clean clobber distclean::
$(MAKE) -f mk/Makefile.spkg $(call mkargs_call,\
- KVERREL DIST BUILDPATH \
+ KVERREL KVARIANTS DIST BUILDPATH \
SRCBUILDDIR SRCBUILDRUNCMD) '$@'
clean clobber distclean::
View
4 linux/mk/Makefile.spkg
@@ -5,7 +5,7 @@
include mk/macros.mk package.mk
$(call varchklist_call,\
- KVERREL OSDIST DIST BUILDPATH \
+ KVERREL KVARIANTS OSDIST DIST BUILDPATH \
SRCBUILDDIR SRCBUILDRUNCMD)
@@ -73,8 +73,10 @@ $(ssrpm) : %/SRPMS/$(srpm) : %/SOURCES/$(tarfile) %/SPECS/$(specfile)
$(SRCBUILDRUNCMD) \
"cd '$(BUILDPATH)/$(SRCBUILDDIR)' && \
rpmbuild -bs \
+ --target='$(PKGARCH)' \
--define 'dist $(DIST)' \
--define '_topdir $(BUILDPATH)/$(SRCBUILDDIR)' \
+ --define 'kvariants $(subst ",\",$(KVARIANTS))' \
SPECS/$(specfile)"
clean clobber distclean::

0 comments on commit 0c4344b

Please sign in to comment.
Something went wrong with that request. Please try again.