From cd95c69c1a754f8121b0c09eebdab4023b7ef64a Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 4 Dec 2007 11:44:59 +0000 Subject: [PATCH] (*) first try at madwifi (*) packages that build with 'make srpm' : set BUILD-FROM-SRPM rather than rely on name (*) SPECFILE is passed to make srpm (*) specfiles in SPECS/ named after package as for MAKE/ (*) spec2make exports .rpm-arch as well --- Makefile | 8 +++++--- groups/planetlab.xml | 1 + planetlab-tags.mk | 1 + planetlab.mk | 26 +++++++++++++++++++++----- spec2make.c | 3 +++ 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 5313fb03..d60edadf 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,8 @@ # is refreshed with createrepo prior to running rpmbuild # (*) package-RPMFLAGS: Miscellaneous RPM flags # (*) package-RPMBUILD: If not rpmbuild - mostly used for sudo'ing rpmbuild +# (*) package-BUILD-FROM-SRPM: set this to any non-empty value, if your package is able to produce +# a source rpms by running 'make srpm' # #################### modules # Required information about the various modules (set this in e.g. planetlab-tags.mk) @@ -226,7 +228,7 @@ repo: RPMS/yumgroups.xml # define stage1_variables $(1).spec = $(notdir $($(1)-SPEC)) -$(1).specpath = SPECS/$(notdir $($(1)-SPEC)) +$(1).specpath = SPECS/$(1).spec $(1).module = $(firstword $($(1)-MODULES)) endef @@ -415,7 +417,7 @@ srpms: $(ALLSRPMS) # usage: target_source_rpm package # select upon the package name, whether it contains srpm or not define target_source_rpm -ifeq "$(subst srpm,,$(1))" "$(1)" +ifeq "$($(1)-BUILD-FROM-SRPM)" "" $($(1).srpm): $($(1).specpath) .rpmmacros $($(1).tarballs) mkdir -p BUILD SRPMS tmp @(echo -n "XXXXXXXXXXXXXXX -- BEG SRPM $(1) (using SOURCES) " ; date) @@ -428,7 +430,7 @@ $($(1).srpm): $($(1).specpath) .rpmmacros $($(1).codebase) mkdir -p BUILD SRPMS tmp @(echo -n "XXXXXXXXXXXXXXX -- BEG SRPM $(1) (using make srpm) " ; date) $(if $($(1).all-devel-rpm-paths), $(RPM-INSTALL-DEVEL) $($(1).all-devel-rpm-paths)) - make -C $($(1).codebase) srpm && \ + make -C $($(1).codebase) srpm SPECFILE=$(HOME)/$($(1).specpath) && \ rm -f SRPMS/$(notdir $($(1).srpm)) && \ ln $($(1).codebase)/$(notdir $($(1).srpm)) SRPMS/$(notdir $($(1).srpm)) $(if $($(1)-DEPEND-DEVEL-RPMS), $(RPM-UNINSTALL-DEVEL) $($(1)-DEPEND-DEVEL-RPMS)) diff --git a/groups/planetlab.xml b/groups/planetlab.xml index 70975cf1..21cc2d74 100644 --- a/groups/planetlab.xml +++ b/groups/planetlab.xml @@ -99,6 +99,7 @@ vconfig + madwifi util-vserver util-vserver-build util-vserver-lib diff --git a/planetlab-tags.mk b/planetlab-tags.mk index 9379d1c6..6808cbc3 100644 --- a/planetlab-tags.mk +++ b/planetlab-tags.mk @@ -5,6 +5,7 @@ build-SVNPATH := http://svn.planet-lab.org/svn/build/trunk # linux-tree-SVNPATH := http://svn.planet-lab.org/svn/linux-2.6/branches/2.6.20 linux-patches-SVNPATH := http://svn.planet-lab.org/svn/linux-2.6/trunk # +madwifi-SVNPATH := http://svn.planet-lab.org/svn/madwifi/trunk libnl-SVNPATH := http://svn.planet-lab.org/svn/libnl/trunk util-vserver-SVNPATH := http://svn.planet-lab.org/svn/util-vserver/branches/scholz util-vserver-pl-SVNPATH := http://svn.planet-lab.org/svn/util-vserver-pl/trunk diff --git a/planetlab.mk b/planetlab.mk index 97c8d6b8..34be23de 100644 --- a/planetlab.mk +++ b/planetlab.mk @@ -16,14 +16,15 @@ # so the source rpm is created by running make srpm in the codebase # -srpm-kernel-MODULES := linux-patches -srpm-kernel-SPEC := kernel-2.6-planetlab.spec +kernel-MODULES := linux-patches +kernel-SPEC := kernel-2.6-planetlab.spec +kernel-BUILD-FROM-SRPM := yes ifeq ($(HOSTARCH),i386) -srpm-kernel-RPMFLAGS:= --target i686 +kernel-RPMFLAGS:= --target i686 else -srpm-kernel-RPMFLAGS:= --target $(HOSTARCH) +kernel-RPMFLAGS:= --target $(HOSTARCH) endif -KERNELS += srpm-kernel +KERNELS += kernel kernel: $(KERNELS) kernel-clean: $(foreach package,$(KERNELS),$(package)-clean) @@ -39,6 +40,21 @@ IN_BOOTSTRAPFS += $(KERNELS) # turns out myplc installs kernel-vserver IN_MYPLC += $(KERNELS) +# +# madwifi +# +# [thierry] - temporarily use onelab's svn +# +madwifi-MODULES := madwifi +madwifi-SPEC := madwifi.spec +madwifi-BUILD-FROM-SRPM := yes +madwifi-DEPEND-DEVEL-RPMS := kernel-devel +madwifi-SPECVARS = kernel_version=$(kernel.rpm-version) \ + kernel_release=$(kernel.rpm-release) \ + kernel_arch=$(kernel.rpm-arch) +IN_BOOTSTRAPFS += madwifi +ALL += madwifi + # # libnl # diff --git a/spec2make.c b/spec2make.c index 5b405ed9..77ddec95 100644 --- a/spec2make.c +++ b/spec2make.c @@ -195,6 +195,9 @@ main(int argc, char *argv[]) } } + /* export arch */ + printf ("%s.rpm-arch := %s\n",package_name,target); + spec = freeSpec(spec); done: -- 2.43.0