# --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../haproxy/make-install.patch # Copyright (C) 2008 The OpenSDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- SDE-COPYRIGHT-NOTE-END --- From f2519e98ee14cec14f7d4d834bcb30eac0f05e36 Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Wed, 12 Mar 2008 15:25:35 +0200 Subject: [BUILD] Added support for 'make install' To be flexible while installing haproxy following variables have been added to the Makefile: - DESTDIR useful i.e. while installing in a sandbox (not set by default) - PREFIX defines the default install prefix (default: /usr/local) - SBINDIR defines the dir the haproxy binary gets installed (default: $PREFIX/sbin) diff --git a/Makefile b/Makefile index 5e9b11d..1175877 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,12 @@ # by "haproxy -vv" in CFLAGS. # SILENT_DEFINE may be used to specify other defines which will not be # reported by "haproxy -vv". +# DESTDIR is not set by default and is used for installation only. +# It might be useful to set DESTDIR if you want to install haproxy +# in a sandbox. +# PREFIX is set to "/usr/local" by default and is used for installation only. +# SBINDIR is set to "$(PREFIX)/sbin" by default and is used for installation +# only. # # Other variables : # DLMALLOC_SRC : build with dlmalloc, indicate the location of dlmalloc.c. @@ -48,6 +54,10 @@ # SUBVERS : add a sub-version (eg: platform, model, ...). # VERDATE : force haproxy's release date. +#### Installation options. +DESTDIR = +PREFIX = /usr/local +SBINDIR = $(PREFIX)/sbin #### TARGET system # Use TARGET= to optimize for a specifc target OS among the @@ -441,6 +451,10 @@ src/haproxy.o: src/haproxy.c src/dlmalloc.o: $(DLMALLOC_SRC) $(CC) $(COPTS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $< +install: all + install -d $(DESTDIR)/$(SBINDIR) + install haproxy $(DESTDIR)/$(SBINDIR) + clean: rm -f *.[oas] src/*.[oas] core haproxy test for dir in . src include/* doc; do rm -f $$dir/*~ $$dir/*.rej;done -- 1.5.4 From 8ef166cadc1202fbb00549666870b38eac4b5a27 Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Wed, 12 Mar 2008 15:57:54 +0200 Subject: [BUILD] Added 'install-man' make target for installing the man page This change is also introducing a new variable in the Makefile called MANDIR, which is set to "$PREFIX/share/man" by default. diff --git a/Makefile b/Makefile index 1175877..69f86a1 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,8 @@ # PREFIX is set to "/usr/local" by default and is used for installation only. # SBINDIR is set to "$(PREFIX)/sbin" by default and is used for installation # only. +# MANDIR is set to "$(PREFIX)/share/man" by default and is used for +# installation only. # # Other variables : # DLMALLOC_SRC : build with dlmalloc, indicate the location of dlmalloc.c. @@ -58,6 +60,7 @@ DESTDIR = PREFIX = /usr/local SBINDIR = $(PREFIX)/sbin +MANDIR = $(PREFIX)/man #### TARGET system # Use TARGET= to optimize for a specifc target OS among the @@ -451,7 +454,11 @@ src/haproxy.o: src/haproxy.c src/dlmalloc.o: $(DLMALLOC_SRC) $(CC) $(COPTS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $< -install: all +install-man: + install -d $(DESTDIR)/$(MANDIR)/man1 + install -m 644 doc/haproxy.1 $(DESTDIR)/$(MANDIR)/man1 + +install: install-man all install -d $(DESTDIR)/$(SBINDIR) install haproxy $(DESTDIR)/$(SBINDIR) -- 1.5.4 From c3bd6da8599d92a630d9fa210413132364a4b827 Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Wed, 12 Mar 2008 16:21:05 +0200 Subject: [BUILD] Added 'install-bin' make target diff --git a/Makefile b/Makefile index 69f86a1..00ae883 100644 --- a/Makefile +++ b/Makefile @@ -458,10 +458,12 @@ install-man: install -d $(DESTDIR)/$(MANDIR)/man1 install -m 644 doc/haproxy.1 $(DESTDIR)/$(MANDIR)/man1 -install: install-man all +install-bin: all install -d $(DESTDIR)/$(SBINDIR) install haproxy $(DESTDIR)/$(SBINDIR) +install: install-man install-bin + clean: rm -f *.[oas] src/*.[oas] core haproxy test for dir in . src include/* doc; do rm -f $$dir/*~ $$dir/*.rej;done -- 1.5.4 From 2d216c6d2e335f2fbd02e587e6a93f242beface3 Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Wed, 12 Mar 2008 17:24:49 +0200 Subject: [BUILD] Added 'install-doc' make target This change is also introducing a new make variable called DOCDIR, which is set to "$(PREFIX)/doc/haproxy" by default. diff --git a/Makefile b/Makefile index 00ae883..4a976ac 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,8 @@ # only. # MANDIR is set to "$(PREFIX)/share/man" by default and is used for # installation only. +# DOCDIR is set to "$(PREFIX)/doc/haproxy" by default and is used for +# installation only. # # Other variables : # DLMALLOC_SRC : build with dlmalloc, indicate the location of dlmalloc.c. @@ -61,6 +63,7 @@ DESTDIR = PREFIX = /usr/local SBINDIR = $(PREFIX)/sbin MANDIR = $(PREFIX)/man +DOCDIR = $(PREFIX)/doc/haproxy #### TARGET system # Use TARGET= to optimize for a specifc target OS among the @@ -458,11 +461,17 @@ install-man: install -d $(DESTDIR)/$(MANDIR)/man1 install -m 644 doc/haproxy.1 $(DESTDIR)/$(MANDIR)/man1 +install-doc: + install -d $(DESTDIR)/$(DOCDIR) + for x in configuration architecture haproxy-en haproxy-fr; do \ + install -m 644 doc/$$x.txt $(DESTDIR)/$(DOCDIR) ; \ + done + install-bin: all install -d $(DESTDIR)/$(SBINDIR) install haproxy $(DESTDIR)/$(SBINDIR) -install: install-man install-bin +install: install-doc install-man install-bin clean: rm -f *.[oas] src/*.[oas] core haproxy test -- 1.5.4 From ec119a146f91e7c7e7fd660b69cce05d18b25f42 Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Wed, 12 Mar 2008 18:19:16 +0200 Subject: [BUILD] Removed "/" after '$(DESTDIR)' in install targets SBINDIR, MANDIR and DOCDIR use an absolute path diff --git a/Makefile b/Makefile index 4a976ac..a01dd13 100644 --- a/Makefile +++ b/Makefile @@ -458,18 +458,18 @@ src/dlmalloc.o: $(DLMALLOC_SRC) $(CC) $(COPTS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $< install-man: - install -d $(DESTDIR)/$(MANDIR)/man1 - install -m 644 doc/haproxy.1 $(DESTDIR)/$(MANDIR)/man1 + install -d $(DESTDIR)$(MANDIR)/man1 + install -m 644 doc/haproxy.1 $(DESTDIR)$(MANDIR)/man1 install-doc: - install -d $(DESTDIR)/$(DOCDIR) + install -d $(DESTDIR)$(DOCDIR) for x in configuration architecture haproxy-en haproxy-fr; do \ - install -m 644 doc/$$x.txt $(DESTDIR)/$(DOCDIR) ; \ + install -m 644 doc/$$x.txt $(DESTDIR)$(DOCDIR) ; \ done install-bin: all - install -d $(DESTDIR)/$(SBINDIR) - install haproxy $(DESTDIR)/$(SBINDIR) + install -d $(DESTDIR)$(SBINDIR) + install haproxy $(DESTDIR)$(SBINDIR) install: install-doc install-man install-bin -- 1.5.4 From c316fc1740408eec37174fc11399a92a70069286 Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Wed, 12 Mar 2008 18:28:13 +0200 Subject: [BUILD] Changed 'install' target to install the binaries first diff --git a/Makefile b/Makefile index a01dd13..1676f72 100644 --- a/Makefile +++ b/Makefile @@ -471,7 +471,7 @@ install-bin: all install -d $(DESTDIR)$(SBINDIR) install haproxy $(DESTDIR)$(SBINDIR) -install: install-doc install-man install-bin +install: install-bin install-man install-doc clean: rm -f *.[oas] src/*.[oas] core haproxy test -- 1.5.4