Only in ipvsadm.new/: .Makefile.swp Only in ipvsadm.new/: .done diff -ru ipvsadm/Makefile ipvsadm.new/Makefile --- ipvsadm/Makefile Wed Jun 5 11:00:23 2002 +++ ipvsadm.new/Makefile Wed Jun 5 14:39:41 2002 @@ -22,6 +22,14 @@ # : Added autodetection of libpot # : Added BUILD_ROOT support # Wensong : Changed the OBJS according to detection +# Horms : Build recursively +# : Dist done in place +# : Install sysconfig file as appropriate +# : Distcheck tries to build from dist tar ball +# : Distclean cleans the tree rather than building it +# : Destination directories can be configured +# : using environment variables +# : Include net/ip_vs.h in dest tar ball # NAME = ipvsadm @@ -29,16 +37,19 @@ RELEASE = 7 SCHEDULERS = "$(shell cat SCHEDULERS)" -CC = gcc -CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -O2 -SBIN = $(BUILD_ROOT)/sbin -MANDIR = usr/man -MAN = $(BUILD_ROOT)/$(MANDIR)/man8 -INIT = $(BUILD_ROOT)/etc/rc.d/init.d -MKDIR = mkdir -INSTALL = install -INCLUDE = -I/usr/src/linux/include -I.. -I. -STATIC_LIBS = libipvs/libipvs.a +CC = gcc +INCLUDE = -I/usr/src/linux/include -I$(PWD) -I$(PWD)/net -I$(PWD)/.. +CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -O2 $(INCLUDE) +SBINDIR = /sbin +SBIN_DIR = $(BUILD_ROOT)/$(SBINDIR) +MANDIR = /usr/man +MAN_DIR = $(BUILD_ROOT)/$(MANDIR)/man8 +INITDIR = /etc/init.d +INIT_DIR = $(BUILD_ROOT)/$(INITDIR) +SYSCONFIGDIR = /etc/sysconfig +SYSCONFIG_DIR = $(BUILD_ROOT)/$(SYSCONFIGDIR) +MKDIR = mkdir +INSTALL = install ##################################### @@ -64,50 +75,92 @@ POPT_DEFINE = -DHAVE_POPT endif -OBJS = ipvsadm.o config_stream.o dynamic_array.o +SRC = $(wildcard *.c) +HDR = $(wildcard *.h) +MAN = $(wildcard *.8) +SBIN_SCRIPT = ipvsadm-restore ipvsadm-save +BIN = ipvsadm +OBJS = $(SRC:.c=.o) +SPEC_IN = ipvsadm.spec.in +SPEC = $(SPEC_IN:.in=) LIBS = $(POPT_LIB) DEFINES = -DVERSION=\"$(VERSION)\" -DSCHEDULERS=\"$(SCHEDULERS)\" \ $(POPT_DEFINE) $(IP_VS_H_DEFINE) +EXTRA_DIST= Makefile README SCHEDULERS VERSION ipvsadm.c ipvsadm.sh \ +ipvsadm.sysconfig +DIST = $(SRC) $(HDR) $(MAN) $(SBIN_SCRIPT) $(SPEC) $(SPEC_IN) $(EXTRA_DIST) +STATIC_LIBS = libipvs/libipvs.a +SUBDIRS = debian libipvs .PHONY = all clean install dist distclean rpm rpms -all: ipvsadm +all: subdir-all $(BIN) + +subdir-all: + for i in $(SUBDIRS); do \ + make -C $$i all; \ + done -ipvsadm: $(OBJS) $(STATIC_LIBS) - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) +$(BIN): $(OBJS) + $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(STATIC_LIBS) install: ipvsadm strip ipvsadm - if [ ! -d $(SBIN) ]; then $(MKDIR) -p $(SBIN); fi - $(INSTALL) -m 0755 ipvsadm $(SBIN) - $(INSTALL) -m 0755 ipvsadm-save $(SBIN) - $(INSTALL) -m 0755 ipvsadm-restore $(SBIN) - [ -d $(MAN) ] || $(MKDIR) -p $(MAN) - $(INSTALL) -m 0644 ipvsadm.8 $(MAN) - $(INSTALL) -m 0644 ipvsadm-save.8 $(MAN) - $(INSTALL) -m 0644 ipvsadm-restore.8 $(MAN) - if [ -d $(INIT) ]; then \ - $(INSTALL) -m 0755 ipvsadm.sh $(INIT)/ipvsadm; \ + if [ ! -d $(SBIN_DIR) ]; then $(MKDIR) -p $(SBIN_DIR); fi + for i in $(SBIN_SCRIPT) $(BIN); do\ + $(INSTALL) -m 0755 $$i $(SBIN_DIR);\ + done + if [ ! -d $(MAN_DIR) ]; then $(MKDIR) -p $(MAN_DIR); fi + for i in $(MAN); do\ + $(INSTALL) -m 644 $$i $(MAN_DIR);\ + done + if [ -d $(INIT_DIR) ]; then \ + $(INSTALL) -m 0755 ipvsadm.sh $(INIT_DIR)/ipvsadm; \ fi + if [ -d $(SYSCONFIG_DIR) ]; then \ + $(INSTALL) -m 0644 ipvsadm.sysconfig \ + $(SYSCONFIG_DIR)/ipvsadm;\ + fi + for i in $(SUBDIRS); do \ + make -C $$i install; \ + done clean: - rm -f ipvsadm $(NAME).spec $(NAME)-$(VERSION).tar.gz - rm -rf debian/tmp - find . -name '*.[ao]' -o -name "*~" -o -name "*.orig" \ - -o -name "*.rej" -o -name core | xargs rm -f - -distclean: dist - -dist: clean - sed -e "s/@@VERSION@@/$(VERSION)/g" \ - -e "s/@@RELEASE@@/$(RELEASE)/g" \ - < ipvsadm.spec.in > ipvsadm.spec - ( cd .. ; tar czvf $(NAME)-$(VERSION).tar.gz \ - --exclude CVS \ - --exclude $(NAME)-$(VERSION).tar.gz \ - ipvsadm ; \ - mv $(NAME)-$(VERSION).tar.gz ipvsadm ) + rm -f $(BIN) $(NAME).spec $(NAME)-$(VERSION).tar.gz + rm -f *.[ao] *~ *.orig *.rej core + for i in $(SUBDIRS); do \ + make -C $$i clean; \ + done + +distclean-1: + rm -rf "$(NAME)-$(VERSION)/" "$(NAME)-$(VERSION).tar" \ + "$(NAME)-$(VERSION).tar.gz" +distclean: distclean-1 clean + rm -rf "$(NAME)-$(VERSION)/" "$(NAME)-$(VERSION).tar" \ + "$(NAME)-$(VERSION).tar.gz" + +dist: distclean-1 $(SPEC) + mkdir "$(NAME)-$(VERSION)/" + cp $(DIST) "$(NAME)-$(VERSION)/" + mkdir "$(NAME)-$(VERSION)/net/" + cp ../ip_vs.h "$(NAME)-$(VERSION)/net/" + for i in $(SUBDIRS); do \ + DISTDIR="../$(NAME)-$(VERSION)/$$i" make -C $$i dist; \ + done + tar -cf "$(NAME)-$(VERSION).tar" "$(NAME)-$(VERSION)/" + gzip --best "$(NAME)-$(VERSION).tar" + rm -rf "$(NAME)-$(VERSION)/" + +distcheck: dist + tar -zxf "$(NAME)-$(VERSION).tar.gz" + ( cd "$(NAME)-$(VERSION)";\ + BUILD_ROOT="$(PWD)/.done/" make distclean all install) + rm -r "$(NAME)-$(VERSION)/" + @echo "#######################################################" + @echo "# $(NAME)-$(VERSION).tar.gz is ready for distribution" + @echo "#######################################################" + rpm: rpms rpms: dist @@ -120,7 +173,10 @@ debs: dpkg-buildpackage -%.o: %.c - $(CC) $(CFLAGS) $(INCLUDE) $(DEFINES) -o $@ -c $< +%.o: %.c + $(CC) $(CFLAGS) $(DEFINES) -o $@ -c $< -include $(shell echo */Makefile) +%.spec: %.spec.in + sed -e "s/@@VERSION@@/$(VERSION)/g" \ + -e "s/@@RELEASE@@/$(RELEASE)/g" \ + < $< > $@ diff -ru ipvsadm/README ipvsadm.new/README --- ipvsadm/README Thu Jan 24 23:23:51 2002 +++ ipvsadm.new/README Wed Jun 5 10:38:01 2002 @@ -1,6 +1,6 @@ -------------------------------------------------------------------------- -ipvsadm - Version 1.20 - 18th September 2001 +ipvsadm - Version 1.21 - 17th May 2002 This is free software. See below for details. @@ -28,7 +28,8 @@ /usr/man/man8/ipvsadm.8 /usr/man/man8/ipvsadm-save.8 /usr/man/man8/ipvsadm-restore.8 - /etc/rc.d/init.d/ipvsadm + /etc/init.d/ipvsadm + /etc/sysconfig/ipvsadm This will be done automatically when calling make install in the source directory. Only in ipvsadm: config_stream.o Only in ipvsadm.new/debian: Makefile Only in ipvsadm: dynamic_array.o Only in ipvsadm: ipvsadm Only in ipvsadm.new/: ipvsadm-1.20.tar.gz Only in ipvsadm: ipvsadm.o diff -ru ipvsadm/ipvsadm.sh ipvsadm.new/ipvsadm.sh --- ipvsadm/ipvsadm.sh Thu May 10 23:17:41 2001 +++ ipvsadm.new/ipvsadm.sh Wed Jun 5 10:38:01 2002 @@ -28,9 +28,9 @@ fi # Use the funtions provided by Red Hat or use our own -if [ -f /etc/rc.d/init.d/functions ] +if [ -f /etc/init.d/functions ] then - . /etc/rc.d/init.d/functions + . /etc/init.d/functions else function action { echo "$1" Only in ipvsadm.new/: ipvsadm.spec diff -ru ipvsadm/ipvsadm.spec.in ipvsadm.new/ipvsadm.spec.in --- ipvsadm/ipvsadm.spec.in Thu Jan 24 23:23:51 2002 +++ ipvsadm.new/ipvsadm.spec.in Wed Jun 5 13:55:35 2002 @@ -7,7 +7,7 @@ Copyright: GNU General Public Licence URL: http://www.LinuxVirtualServer.org/ Group: Applications/System -Source0: http://www.LinuxVirtualServer.org/software/ipvsadm-%{version}.tar.gz +Source0: http://www.LinuxVirtualServer.org/software/%{name}-%{version}.tar.gz BuildRoot: /var/tmp/%name-%{PACKAGE_VERSION}-root Docdir: %{prefix}/doc Provides: %{name}-%{version} @@ -19,7 +19,7 @@ %prep -%setup -n ipvsadm +%setup -n %{name}-%{version} %build @@ -28,14 +28,17 @@ %install rm -rf $RPM_BUILD_ROOT -mkdir -p ${RPM_BUILD_ROOT}/{sbin,%{_mandir}/man8,etc/rc.d/init.d} -make install BUILD_ROOT=${RPM_BUILD_ROOT} MANDIR=%{_mandir} +mkdir -p ${RPM_BUILD_ROOT}/{sbin,%{_mandir}/man8,etc/{init.d,sysconfig}} +make install BUILD_ROOT=${RPM_BUILD_ROOT} MANDIR=%{_mandir} \ + SBINDIR=/sbin INITDIR=%{_sysconfdir}/init.d \ + SYSCONFIGDIR=%{_sysconfdir}/sysconfig %files %defattr(-,root,root) %doc README -%config /etc/rc.d/init.d/ipvsadm +%config /etc/init.d/ipvsadm +%config /etc/sysconfig/ipvsadm /sbin/ipvsadm* %{_mandir}/man8/ipvsadm* @@ -52,6 +55,10 @@ %changelog +* Fri Jun 5 2002 Horms +- Include /etc/sysconfig/ipvsadm in RPM +- Install init script into /etc/init.d instead of /etc/init.d/rc.d + * Thu Dec 16 2001 Wensong Zhang - Changed to install ipvsadm man pages according to the %{_mandir} Only in ipvsadm.new/: ipvsadm.sysconfig diff -ru ipvsadm/libipvs/Makefile ipvsadm.new/libipvs/Makefile --- ipvsadm/libipvs/Makefile Wed Sep 19 00:42:54 2001 +++ ipvsadm.new/libipvs/Makefile Wed Jun 5 13:54:10 2002 @@ -1,2 +1,46 @@ +# ipvsadm - IP Virtual Server ADMinistration program +# for IPVS NetFilter Module in kernel 2.4 +# +# Version: $Id: Makefile,v 1.18 2002/05/30 13:00:24 wensong Exp $ +# +# Authors: Wensong Zhang +# Peter Kese +# +# This file: +# +# ChangeLog +# +# Horms : Added recusion -libipvs/libipvs.a: libipvs/libipvs.a(libipvs/libipvs.o) +SRC = $(wildcard *.c) +HDR = $(wildcard *.h) +OBJ = $(SRC:.c=.o) +STATIC_LIB = libipvs.a +EXTRA_DIST = Makefile +DIST = $(EXTRA_DIST) $(SRC) $(HDR) + +.PHONY = all clean install dist distclean rpm rpms + +all: $(STATIC_LIB) + +$(STATIC_LIB): $(OBJ) + ar rv $(STATIC_LIB) $(OBJ) + +install: + +clean: + rm -f *.[ao] *~ *.orig *.rej core + +distclean: clean + +dist: + mkdir "$(DISTDIR)/" + cp $(DIST) "$(DISTDIR)/" + for i in $(SUBDIRS); do \ + DISTDIR="../$(DISTDIR)/$i" make -C $$i dist; \ + done + +libipvs.a: libipvs.o + +%.o: %.c + $(CC) $(CFLAGS) $(DEFINES) -o $@ -c $< Only in ipvsadm/libipvs: libipvs.a