LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[PATCH] ipvsadm rpm build for RHEL 4.0

To: Wensong Zhang <wensong@xxxxxxxxxxxx>
Subject: [PATCH] ipvsadm rpm build for RHEL 4.0
Cc: "LinuxVirtualServer.org user..." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Cc: "Nielsen, Steve" <SNielsen@xxxxxxxxxxxx>
From: Horms <horms@xxxxxxxxxxxx>
Date: Fri, 24 Jun 2005 17:24:27 +0900
Hi Wensong, 

this seems good to me, though I haven't tested it.

-- 
Horms

----- Forwarded message from "Nielsen, Steve" <SNielsen@xxxxxxxxxxxx> -----

Subject: patch submission for ipvsadm rpm build for RHEL 4.0
Date: Thu, 23 Jun 2005 11:10:34 -0400
From: "Nielsen, Steve" <SNielsen@xxxxxxxxxxxx>
To: ultramonkey-users@xxxxxxxxxxxxxxx
Reply-to: ultramonkey-users@xxxxxxxxxxxxxxx
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 
        autolearn=unavailable version=3.0.2-stephanie.vergenet.net_2005051000

Here is a patch that will allow the newest ipvsadm to build on RHEL4.0.

Changes made:
* added buildrequires for kernel-source
* autodetect linux version using uname -r and then set include path accordingly
* use rpm --eval '<macro>' to determine SPECS and SOURCES directory. This allow 
the use of rpmmacros

I made these changes against the latest src rpm for ipvsadm from 
linuxvirtualserver.org (1.24-5)

Thanks,
Steve

================

diff -u -r ipvsadm-1.24.orig/ipvsadm.spec.in ipvsadm-1.24.new/ipvsadm.spec.in
--- ipvsadm-1.24.orig/ipvsadm.spec.in   2003-12-20 03:12:56.000000000 -0600
+++ ipvsadm-1.24.new/ipvsadm.spec.in    2005-06-23 10:05:06.983168120 -0500
@@ -11,6 +11,7 @@
 BuildRoot: /var/tmp/%name-%{PACKAGE_VERSION}-root
 Provides: %{name}-%{version}
 Conflicts: piranha <= 0.4.14
+BuildRequires: kernel-source

 %description
 ipvsadm is a utility to administer the IP Virtual Server services
@@ -51,6 +52,11 @@


 %changelog
+* Thu Jun 23 2005 Steve Nielsen <snielsen@xxxxxxxxxxxx>
+- Autodetect linux source version
+- Respect rpmmacros that might be set (by using rpm --eval)
+- Added "BuildRequires: kernel-source"
+
 * Sat Dec 20 2003 Wensong Zhang <wensong@xxxxxxxxxxxx>
 - tidy up the description

diff -u -r ipvsadm-1.24.orig/libipvs/Makefile ipvsadm-1.24.new/libipvs/Makefile
--- ipvsadm-1.24.orig/libipvs/Makefile  2002-12-19 07:53:07.000000000 -0600
+++ ipvsadm-1.24.new/libipvs/Makefile   2005-06-23 09:27:40.524681720 -0500
@@ -1,7 +1,8 @@
 # Makefile for libipvs

 CC     = gcc
-INCLUDE        = -I/usr/src/linux/include
+KERNVER        = $(shell uname -r | sed 's/smp//')
+INCLUDE        = -I/usr/src/linux-$(KERNVER)/include
 CFLAGS     = -Wall -Wunused -Wstrict-prototypes -g -O2

 INCLUDE        += $(shell if [ -f ../../ip_vs.h ]; then    \
diff -u -r ipvsadm-1.24.orig/Makefile ipvsadm-1.24.new/Makefile
--- ipvsadm-1.24.orig/Makefile  2004-10-27 10:53:07.000000000 -0500
+++ ipvsadm-1.24.new/Makefile   2005-06-23 10:04:07.204255896 -0500
@@ -27,13 +27,16 @@

 NAME       = ipvsadm
 VERSION        = $(shell cat VERSION)
-RELEASE        = 5
+RELEASE        = 7
 SCHEDULERS = "$(shell cat SCHEDULERS)"
 PROGROOT   = $(shell basename `pwd`)
 ARCH       = $(shell uname -m)
+KERNVER        = $(shell uname -r | sed 's/smp//')
+RPMSOURCEDIR   = $(shell rpm --eval '%_sourcedir')
+RPMSPECDIR = $(shell rpm --eval '%_specdir')

 CC     = gcc
-INCLUDE        = -I/usr/src/linux/include -I.. -I.
+INCLUDE        = -I/usr/src/linux-$(KERNVER)/include -I.. -I.
 SBIN       = $(BUILD_ROOT)/sbin
 MANDIR     = usr/man
 MAN        = $(BUILD_ROOT)/$(MANDIR)/man8
@@ -128,14 +131,14 @@
        rm -f $(NAME)-$(VERSION)

 rpms:      dist
-       cp $(NAME)-$(VERSION).tar.gz /usr/src/redhat/SOURCES/
-       cp $(NAME).spec /usr/src/redhat/SPECS/
-       (cd /usr/src/redhat/SPECS/ ; $(RPMBUILD) -ba $(NAME).spec)
+       cp $(NAME)-$(VERSION).tar.gz $(RPMSOURCEDIR)/
+       cp $(NAME).spec $(RPMSPECDIR)/
+       (cd $(RPMSPECDIR)/ ; $(RPMBUILD) -ba $(NAME).spec)

 srpm:      dist
-       cp $(NAME)-$(VERSION).tar.gz /usr/src/redhat/SOURCES/
-       cp $(NAME).spec /usr/src/redhat/SPECS/
-       (cd /usr/src/redhat/SPECS/ ; $(RPMBUILD) -bs $(NAME).spec)
+       cp $(NAME)-$(VERSION).tar.gz $(RPMSOURCEDIR)/
+       cp $(NAME).spec $(RPMSPECDIR)/
+       (cd $(RPMSPECDIR)/ ; $(RPMBUILD) -bs $(NAME).spec)

 deb:       debs


-- 
Ultra Monkey - http://www.ultramonkey.org/
To UNSUBSCRIBE, email to lisa@xxxxxxxxxxxxxxx, with a body:
unsubscribe ultramonkey-users your-email-address@xxxxxxxxxxx
where "your-email-address@xxxxxxxxxxx" is YOUR email address.

----- End forwarded message -----

<Prev in Thread] Current Thread [Next in Thread>