[gnome-continuous] Add components needed by gnome-hwtest



commit ac85e32e7e59854047686d42a01c33824d7ed570
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Jun 5 10:01:14 2014 -0400

    Add components needed by gnome-hwtest
    
    Populate the hwtest tree with the external components needed for the
    GNOME Hardware Testing Project. These are:
    
     gnome-hwtest: The GNOME Hardware testing scripts (included in minimal
      since we want to have the subset used for running the tests in the
      runtime image)
    
     gjs-minimal: a version of GJS built without GTK+ and Cairo support -
      gnome-hwtest uses this for its runtime.
    
     iPXE: Used to network boot with iSCSI support
    
     GRUB: Used to find the partition we want to boot into
    
     dnsmasq: Used as a dhcp server for exporting boot parameters from
      the controller to the target machines.
    
     lighttpd: Used to export files to the target machines from the controller
    
     tgt: Used to export boot images over iSCSI (It turns out this is a
      somewhat obsolete daemon - the kernel support for iSCSI targets plus
      targetcli would be the modern way to do it. tgt works for our needs,
      but it could be switched over to targetcli later.)
    
     open-iscsi: Used to mount iscsi volumes on the target machine.
    
     socat: Used for exporting logs from the target to the controller.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732394

 manifest.json                             |   62 ++++++++-
 patches/dnsmasq-buildsys.patch            |  126 +++++++++++++++++
 patches/ipxe-buildsys.patch               |  140 +++++++++++++++++++
 patches/ipxe-disable-isos.patch           |   60 ++++++++
 patches/iscsi-assume-netlink-number.patch |   44 ++++++
 patches/iscsi-buildsys.patch              |  160 ++++++++++++++++++++++
 patches/iscsi-install-iscsistart.patch    |   25 ++++
 patches/iscsi-no-iscsiuio.patch           |   64 +++++++++
 patches/iscsi-no-static-build.patch       |   28 ++++
 patches/socat-buildsys.patch              |   27 ++++
 patches/socat-disable-man-pages.patch     |   49 +++++++
 patches/tgt-buildsys.patch                |  213 +++++++++++++++++++++++++++++
 patches/tgt-cflags.patch                  |   78 +++++++++++
 patches/tgt-disable-man.patch             |  111 +++++++++++++++
 14 files changed, 1186 insertions(+), 1 deletions(-)
---
diff --git a/manifest.json b/manifest.json
index 578ff04..55433da 100644
--- a/manifest.json
+++ b/manifest.json
@@ -35,8 +35,14 @@
                 "savannah": "git:git://git.savannah.gnu.org/",
                 "debian": "git:git://anonscm.debian.org/",
                "netfilter": "git:git://git.netfilter.org/",
+                "lighttpd": "git:git://git.lighttpd.net/",
+                "dnsmasq": "git:git://thekelleys.org.uk/",
+                "ipxe": "git:git://git.ipxe.org/",
+                "socat": "git:git://repo.or.cz/",
                "cgwalters": "git:git://github.com/cgwalters/",
-                "anholt": "git:git://github.com/anholt/"},
+                "anholt": "git:git://github.com/anholt/",
+                "fujita": "git:git://github.com/fujita/",
+                "mikechristie" : "git:git://github.com/mikechristie/"},
 
   "patches": {"src": "gnome:gnome-continuous",
               "subdir": "patches"},
@@ -812,6 +818,11 @@
                                 "--disable-intl-api"]},
 
                {"src": "gnome:gjs",
+                 "name": "gjs-minimal",
+                 "component": "hwtest",
+                "config-opts": ["--without-cairo", "--without-gtk"]},
+
+               {"src": "gnome:gjs",
                 "config-opts": ["--enable-installed-tests"]},
 
                {"src": "gnome:ostree",
@@ -821,6 +832,55 @@
                                 "--with-dracut",
                                 "--enable-installed-tests"]},
 
+               {"src": "gnome:gnome-hwtest",
+                 "component": "minimal",
+                 "initramfs-depends": true},
+
+               {"src": "mikechristie:open-iscsi",
+                 "component": "minimal",
+                "initramfs-depends": true,
+                "patches": ["iscsi-no-iscsiuio.patch",
+                             "iscsi-no-static-build.patch",
+                             "iscsi-assume-netlink-number.patch",
+                             "iscsi-install-iscsistart.patch",
+                             "iscsi-buildsys.patch"]},
+
+                {"src": "socat:socat.git",
+                 "component": "minimal",
+                "patches": ["socat-disable-man-pages.patch",
+                             "socat-buildsys.patch"]},
+
+                {"src": "dnsmasq:dnsmasq.git",
+                 "component": "hwtest",
+                "patches": ["dnsmasq-buildsys.patch"]},
+
+                {"src": "ipxe:ipxe.git",
+                 "component": "hwtest",
+                "patches": ["ipxe-buildsys.patch",
+                             "ipxe-disable-isos.patch"]},
+
+               {"src": "savannah:grub.git",
+                 "component": "hwtest",
+                 "cflags": { "x86_64": "" },
+                 "config-opts": ["--with-platform=pc",
+                                 "--disable-grub-mkfont",
+                                 "--enable-liblzma=no",
+                                 "--enable-device-mapper=no",
+                                 "--enable-libzfs=no"]},
+
+               {"src": "fujita:tgt",
+                 "component": "hwtest",
+                "patches": ["tgt-cflags.patch",
+                             "tgt-buildsys.patch",
+                             "tgt-disable-man.patch"],
+                 "config-opts": ["--disable-man"]},
+
+               {"src": "lighttpd:lighttpd/lighttpd-1.x",
+                 "name": "lighttpd",
+                 "tag": "lighttpd-1.4.x",
+                 "component": "hwtest",
+                "config-opts": ["--without-pcre"]},
+
                 {"src": "ibus:ibus.git",
                 "patches": ["ibus-builddir.patch",
                             "ibus-dconf-update.patch"],
diff --git a/patches/dnsmasq-buildsys.patch b/patches/dnsmasq-buildsys.patch
new file mode 100644
index 0000000..4100e2e
--- /dev/null
+++ b/patches/dnsmasq-buildsys.patch
@@ -0,0 +1,126 @@
+From bb692e640149cf40b8e1e671026c79666ed6db55 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Mon, 14 Apr 2014 10:46:19 -0700
+Subject: [PATCH] Add a configure script to provide a standard build API
+
+Even though dnsmasq doesn't need checks at configure time, a
+configure script with standard options provides useful compatibility
+with automated build systems. Add such a script that generates a
+wrapper makefile in the build directory. Making this work without
+a separate builddir is difficult without requiring GNUmake and using
+includes.
+---
+ configure | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 101 insertions(+)
+ create mode 100755 configure
+
+diff --git a/configure b/configure
+new file mode 100755
+index 0000000..5ebd15a
+--- /dev/null
++++ b/configure
+@@ -0,0 +1,101 @@
++#!/bin/sh
++
++# This script provides basic compatibility with automake configure scripts
++# for use in automated build systems. See:
++#
++# https://people.gnome.org/~walters/docs/build-api.txt
++
++# We only work buildir != srcdir ; fixing this would require requiring
++# GNUmake so we could use an include rather than a wrapper script
++#buildapi-variable-require-builddir
++
++topdir=`dirname $0`
++
++if [ "`cd $topdir && pwd`" = "`pwd`" ] ; then
++    echo 1>&2 "A separate builddir is required"
++    exit 1
++fi
++
++print_help() {
++    echo "--prefix=DIR                Install files in DIR (default /usr)"
++    echo "--sbindir=DIR               Install files in DIR (default PREFIX/sbin)"
++    echo "--datadir=DIR               Install data files in DIR (default PREFIX/share)"
++    echo "--mandir=DIR                Install man pages in DIR (default DATADIR/man)"
++    echo "--localedir=DIR     Install translations in DIR (default DATADIR/locale)"
++}
++
++prefix=/usr
++if expr "$topdir" : / > /dev/null ; then
++    makeargs="topdir=$topdir"
++else
++    makeargs='topdir=$(CURDIR)'/"$topdir"
++fi
++
++makeargs="$makeargs"' BUILDDIR=$(CURDIR)'
++
++while [ $# '>' 0 ] ; do
++    option=`expr "$1" : '\([^=]*\)='`
++    optarg=
++    consume_next=false
++    if [ x$option != x ]; then
++        optarg=`expr "$1" : '[^=]*=\(.*\)'`
++        shift
++    else
++        option=$1
++        shift
++        if expr "$option" : '-' > /dev/null ; then
++            consume_next=true
++            optarg=$1
++        fi
++    fi
++
++    case $option in
++        --prefix)
++            makeargs="$makeargs PREFIX='$optarg'"
++            ;;
++        --sbindir)
++            makeargs="$makeargs BINDIR='$optarg'"
++            ;;
++        --datadir)
++            makeargs="$makeargs DATADIR='$optarg'"
++            ;;
++        --mandir)
++            makeargs="$makeargs MANDIR='$optarg'"
++            ;;
++        --localedir)
++            makeargs="$makeargs LOCALEDIR='$optarg'"
++            ;;
++        CFLAGS)
++            makeargs="$makeargs CFLAGS='$optarg'"
++            ;;
++        --with-*|--without-*|--enable-*|--disable-*)
++            consume_next=false
++            ;;
++        --help)
++            print_help
++            exit
++            ;;
++    esac
++
++    if $consume_next ; then
++        shift
++    fi
++done
++
++output_var() {
++    if [ x"$2" != x"" ] ; then
++        echo $1 ?= $2
++    fi
++}
++
++cat > Makefile <<EOF
++MAKEARGS = -C $topdir $makeargs
++all:
++      \$(MAKE) \$(MAKEARGS) all
++
++install:
++      \$(MAKE) \$(MAKEARGS) install
++
++clean:
++      \$(MAKE) \$(MAKEARGS) clean
++EOF
+-- 
+1.9.0
+
diff --git a/patches/ipxe-buildsys.patch b/patches/ipxe-buildsys.patch
new file mode 100644
index 0000000..b1f6ff1
--- /dev/null
+++ b/patches/ipxe-buildsys.patch
@@ -0,0 +1,140 @@
+From e17a50783d45ba298b009d223134176a205be96f Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Mon, 14 Apr 2014 12:13:55 -0700
+Subject: [PATCH] Add a simple configure script for gnome-continuous
+ integration
+
+Add a configure script that follows the gnome-continuous build
+API and a makefile to install the generated boot images into
+/usr/share/ipxe.
+---
+ .gitignore |  1 +
+ Makefile   | 34 ++++++++++++++++++++++++++++++++
+ configure  | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 101 insertions(+)
+ create mode 100644 .gitignore
+ create mode 100644 Makefile
+ create mode 100755 configure
+
+diff --git a/.gitignore b/.gitignore
+new file mode 100644
+index 0000000..aee2e4c
+--- /dev/null
++++ b/.gitignore
+@@ -0,0 +1 @@
++config.mk
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..167bcdf
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,34 @@
++include config.mk
++
++BOOT_IMAGES =                   \
++      src/bin/ipxe.dsk  \
++      src/bin/ipxe.iso  \
++      src/bin/ipxe.lkrn \
++      src/bin/ipxe.pxe  \
++      src/bin/ipxe.usb  \
++      src/bin/undionly.kpxe
++
++DOC_FILES =           \
++      COPYING         \
++      COPYRIGHTS      \
++      README
++
++all: build
++
++build:
++      $(MAKE) -C src
++
++clean:
++      $(MAKE) -C src clean
++
++install: build
++      install -m 0755 -d $(DESTDIR)$(PKGDATADIR)
++      for i in $(BOOT_IMAGES) ; do                         \
++              install -m 0644 $$i $(DESTDIR)$(PKGDATADIR); \
++      done
++      install -m 0755 -d $(DESTDIR)$(DOCDIR)
++      for i in $(DOC_FILES) ; do                       \
++              install -m 0644 $$i $(DESTDIR)$(DOCDIR); \
++      done
++
++.PHONY: all build clean install
+diff --git a/configure b/configure
+new file mode 100755
+index 0000000..d34cbfa
+--- /dev/null
++++ b/configure
+@@ -0,0 +1,66 @@
++#!/bin/sh
++
++# This script provides basic compatibility with automake configure scripts
++# for use in automated build systems. See:
++#
++# https://people.gnome.org/~walters/docs/build-api.txt
++
++# Declares that this project only works when srcdir == builddir.
++#buildapi-variable-no-builddir
++
++print_help() {
++    echo "--prefix=DIR                Install files in DIR (default /usr)"
++    echo "--datadir=DIR               Install data files in DIR (default PREFIX/share)"
++    echo "--docdir=DIR                Install documentation files in DIR (default DATADIR/doc/ipxe)"
++}
++
++prefix=/usr
++datadir='$(PREFIX)/share'
++docdir='$(DIRDIR)/doc/ipxe'
++
++while [ $# '>' 0 ] ; do
++    option=`expr "$1" : '\([^=]*\)='`
++    optarg=
++    consume_next=false
++    if [ x$option != x ]; then
++        optarg=`expr "$1" : '[^=]*=\(.*\)'`
++        shift
++    else
++        option=$1
++        shift
++        if expr "$option" : '-' > /dev/null ; then
++            consume_next=true
++            optarg=$1
++        fi
++    fi
++
++    case $option in
++        --prefix)
++            prefix=$optarg
++            ;;
++        --datadir)
++            datadir=$optarg
++            ;;
++        --docdir)
++            docdir=$optarg
++            ;;
++        --with-*|--without-*|--enable-*|--disable-*)
++            consume_next=false
++            ;;
++        --help)
++            print_help
++            exit
++            ;;
++    esac
++
++    if $consume_next ; then
++        shift
++    fi
++done
++
++cat > config.mk <<EOF
++PREFIX=$prefix
++DATADIR=$datadir
++PKGDATADIR=$datadir/ipxe
++DOCDIR=$docdir
++EOF
+-- 
+1.9.0
+
diff --git a/patches/ipxe-disable-isos.patch b/patches/ipxe-disable-isos.patch
new file mode 100644
index 0000000..67007aa
--- /dev/null
+++ b/patches/ipxe-disable-isos.patch
@@ -0,0 +1,60 @@
+From 4c1af8ce60501a3b4f1affd755eb80d10b589fd3 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Mon, 14 Apr 2014 18:15:28 -0700
+Subject: [PATCH] Disable ISO generation
+
+Building ISO's requires genisofs, which we don't currently have in
+gnome-continuous. Since we don't need ISO's, just disable generation.
+---
+ Makefile                      | 1 -
+ src/Makefile                  | 2 +-
+ src/arch/i386/Makefile.pcbios | 8 ++++----
+ 3 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 167bcdf..e8819f5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,7 +2,6 @@ include config.mk
+ 
+ BOOT_IMAGES =                   \
+       src/bin/ipxe.dsk  \
+-      src/bin/ipxe.iso  \
+       src/bin/ipxe.lkrn \
+       src/bin/ipxe.pxe  \
+       src/bin/ipxe.usb  \
+diff --git a/src/Makefile b/src/Makefile
+index ea987b8..777d848 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -108,7 +108,7 @@ INCDIRS            += include .
+ # Default build target: build the most common targets and print out a
+ # helpfully suggestive message
+ #
+-ALL           := bin/blib.a bin/ipxe.dsk bin/ipxe.lkrn bin/ipxe.iso \
++ALL           := bin/blib.a bin/ipxe.dsk bin/ipxe.lkrn \
+                  bin/ipxe.usb bin/ipxe.pxe bin/undionly.kpxe bin/rtl8139.rom \
+                  bin/8086100e.mrom bin/80861209.rom bin/10500940.rom \
+                  bin/10222000.rom bin/10ec8139.rom bin/1af41000.rom \
+diff --git a/src/arch/i386/Makefile.pcbios b/src/arch/i386/Makefile.pcbios
+index 50e9314..192c84c 100644
+--- a/src/arch/i386/Makefile.pcbios
++++ b/src/arch/i386/Makefile.pcbios
+@@ -46,10 +46,10 @@ LIST_NAME_rom := ROMS
+ LIST_NAME_mrom := ROMS
+ 
+ # rule to make a non-emulation ISO boot image
+-NON_AUTO_MEDIA        += iso
+-%iso: %lkrn util/geniso
+-      $(QM)$(ECHO) "  [GENISO] $@"
+-      $(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) VERSION="$(VERSION)" bash util/geniso -o $@ $<
++#NON_AUTO_MEDIA       += iso
++#%iso:        %lkrn util/geniso
++#     $(QM)$(ECHO) "  [GENISO] $@"
++#     $(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) VERSION="$(VERSION)" bash util/geniso -o $@ $<
+ 
+ # rule to make a floppy emulation ISO boot image
+ NON_AUTO_MEDIA        += liso
+-- 
+1.9.0
+
diff --git a/patches/iscsi-assume-netlink-number.patch b/patches/iscsi-assume-netlink-number.patch
new file mode 100644
index 0000000..6bc994d
--- /dev/null
+++ b/patches/iscsi-assume-netlink-number.patch
@@ -0,0 +1,44 @@
+From 20daea0e06a3ae27fde748898413d48c153ee5bb Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Sat, 19 Apr 2014 02:07:27 -0400
+Subject: [PATCH 3/4] Remove obsolete checks for the correct netlink number
+
+The netlink number for iSCSI was fixed in 2005 to 8 - there's
+no reason to try and find the kernel sources to auto-detect it.
+---
+ usr/Makefile | 18 +-----------------
+ 1 file changed, 1 insertion(+), 17 deletions(-)
+
+diff --git a/usr/Makefile b/usr/Makefile
+index 48c77b3..84dc4c8 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -2,24 +2,8 @@
+ 
+ OSNAME=$(shell uname -s)
+ 
+-# allow users to override these
+-# eg to compile for a kernel that you aren't currently running
+-KERNELRELEASE ?= $(shell uname -r)
+-KSRC ?= /lib/modules/$(KERNELRELEASE)/build
+-
+-KSUBLEVEL=$(shell cat $(KSRC)/Makefile | awk -F= '/^SUBLEVEL =/ {print $$2}' | \
+-                      sed 's/^[ \t]*//;s/[ \t]*$$//')
+-
+ ifeq ($(OSNAME),Linux)
+-      ifeq ($(KSUBLEVEL),11)
+-              IPC_CFLAGS=-DNETLINK_ISCSI=12 -D_GNU_SOURCE
+-      else
+-      ifeq ($(KSUBLEVEL),12)
+-              IPC_CFLAGS=-DNETLINK_ISCSI=12 -D_GNU_SOURCE
+-      else
+-              IPC_CFLAGS=-DNETLINK_ISCSI=8 -D_GNU_SOURCE
+-      endif
+-      endif
++IPC_CFLAGS=-DNETLINK_ISCSI=8 -D_GNU_SOURCE
+ IPC_OBJ=netlink.o
+ else
+ ifeq ($(OSNAME),FreeBSD)
+-- 
+1.9.0
+
diff --git a/patches/iscsi-buildsys.patch b/patches/iscsi-buildsys.patch
new file mode 100644
index 0000000..96eaf04
--- /dev/null
+++ b/patches/iscsi-buildsys.patch
@@ -0,0 +1,160 @@
+From 39fae3fddd1651b3f988175180e61e45215c5278 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Sat, 19 Apr 2014 02:23:40 -0400
+Subject: [PATCH] Add a configure script to provide a standard build API
+
+Even though open-iscsi doesn't need checks at configure time, a
+configure script with standard options provides useful compatibility
+with automated build systems. Add such a script that generates a
+config.mk that the makefiles include. Passing options directly
+to make without running configure is still supported.
+---
+ Makefile       | 14 +++++----
+ configure      | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ utils/Makefile |  3 +-
+ 3 files changed, 106 insertions(+), 7 deletions(-)
+ create mode 100755 configure
+
+diff --git a/Makefile b/Makefile
+index e7dbe1d..64a2f78 100644
+--- a/Makefile
++++ b/Makefile
+@@ -6,12 +6,14 @@
+ # that you want everything installed into.
+ DESTDIR ?= 
+ 
+-prefix = /usr
+-exec_prefix = /
+-sbindir = $(exec_prefix)/sbin
+-bindir = $(exec_prefix)/bin
+-mandir = $(prefix)/share/man
+-etcdir = /etc
++-include config.mk
++
++prefix ?= /usr
++exec_prefix ?= /
++sbindir ?= $(exec_prefix)/sbin
++bindir ?= $(exec_prefix)/bin
++mandir ?= $(prefix)/share/man
++etcdir ?= /etc
+ initddir = $(etcdir)/init.d
+ 
+ MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 # iscsiuio/docs/iscsiuio.8
+diff --git a/configure b/configure
+new file mode 100755
+index 0000000..3681672
+--- /dev/null
++++ b/configure
+@@ -0,0 +1,96 @@
++#!/bin/sh
++
++# This script provides basic compatibility with automake configure scripts
++# for use in automated build systems. See:
++#
++# https://people.gnome.org/~walters/docs/build-api.txt
++
++# Declares that this project only works when srcdir == builddir.
++#buildapi-variable-no-builddir
++
++print_help() {
++    echo "--prefix=DIR                Install files in DIR (default /usr)"
++    echo "--libdir=DIR                Install library files in DIR/tgt (default PREFIX/lib)"
++    echo "--sysconfdir=DIR    Install configuration files in DIR (default /etc)"
++    echo "--datadir=DIR               Install data files in DIR (default $PREFIX/share)"
++    echo "--mandir=DIR                Install configuration files in DIR (default DATADIR/man)"
++    echo "--docdir=DIR                Install documentation files in DIR (default DATADIR/doc/tgt)"
++    echo "--sbindir=DIR               Install binaries in DIR (default DATADIR/sbin)"
++    echo "--with-ceph         Enable support for the Ceph distributed file system"
++    echo "--with-glfs         Enable support for GlusterFS"
++    echo "--disable-man         Disable building and installing man pages"
++}
++
++prefix=/usr
++exec_prefix='$(prefix)'
++bindir='$(prefix)/bin'
++sbindir='$(exec_prefix)/sbin'
++datadir='$(prefix)/share'
++mandir='$(datadir)/man'
++sysconfdir='$(prefix)/etc'
++CFLAGS='-O2 -g'
++
++while [ $# '>' 0 ] ; do
++    option=`expr "$1" : '\([^=]*\)='`
++    optarg=
++    consume_next=false
++    if [ x$option != x ]; then
++        optarg=`expr "$1" : '[^=]*=\(.*\)'`
++        shift
++    else
++        option=$1
++        shift
++        if expr "$option" : '-' > /dev/null ; then
++            consume_next=true
++            optarg=$1
++        fi
++    fi
++
++    case $option in
++        --prefix)
++            prefix=$optarg
++            ;;
++        --exec_prefix)
++            exec_prefix=$optarg
++            ;;
++        --sysconfdir)
++            sysconfdir=$optarg
++            ;;
++        --mandir)
++            mandir=$optarg
++            ;;
++        --datadir)
++            docdir=$optarg
++            ;;
++        --sbindir)
++            mandir=$optarg
++            ;;
++        CFLAGS)
++            CFLAGS=$optarg
++            ;;
++        --with-*|--without-*|--enable-*|--disable-*)
++            consume_next=false
++            ;;
++        --help)
++            print_help
++            exit
++            ;;
++    esac
++
++    if $consume_next ; then
++        shift
++    fi
++done
++
++cat > config.mk <<EOF
++prefix = $prefix
++exec_prefix = $exec_prefix
++sbindir = $sbindir
++bindir = $bindir
++mandir = $mandir
++etcdir = $sysconfdir
++OPTFLAGS = $CFLAGS
++export OPTFLAGS
++EOF
++
++make utils/open-isns/Makefile
+diff --git a/utils/Makefile b/utils/Makefile
+index 2c7e891..3e4ff6b 100644
+--- a/utils/Makefile
++++ b/utils/Makefile
+@@ -1,6 +1,7 @@
+ # This Makefile will work only with GNU make.
+ 
+-CFLAGS += $(OPTFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g
++OPTFLAGS ?= -O2 -g
++CFLAGS += $(OPTFLAGS) -fno-inline -Wall -Wstrict-prototypes
+ PROGRAMS = iscsi-iname
+ 
+ all: $(PROGRAMS)
+-- 
+1.9.0
+
diff --git a/patches/iscsi-install-iscsistart.patch b/patches/iscsi-install-iscsistart.patch
new file mode 100644
index 0000000..42866f4
--- /dev/null
+++ b/patches/iscsi-install-iscsistart.patch
@@ -0,0 +1,25 @@
+From 654b8cd5ee4a1561961cf98c4dba6c17b61a285a Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Mon, 21 Apr 2014 17:46:47 -0400
+Subject: [PATCH] Install iscsistart
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 64a2f78..634c9ed 100644
+--- a/Makefile
++++ b/Makefile
+@@ -17,7 +17,7 @@ etcdir ?= /etc
+ initddir = $(etcdir)/init.d
+ 
+ MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 # iscsiuio/docs/iscsiuio.8
+-PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname # iscsiuio/src/unix/iscsiuio
++PROGRAMS = usr/iscsid usr/iscsiadm usr/iscsistart utils/iscsi_discovery utils/iscsi-iname # 
iscsiuio/src/unix/iscsiuio
+ INSTALL = install
+ ETCFILES = etc/iscsid.conf
+ IFACEFILES = etc/iface.example
+-- 
+1.9.0
+
diff --git a/patches/iscsi-no-iscsiuio.patch b/patches/iscsi-no-iscsiuio.patch
new file mode 100644
index 0000000..8b35a7a
--- /dev/null
+++ b/patches/iscsi-no-iscsiuio.patch
@@ -0,0 +1,64 @@
+From 6b6601ac72df9d6a9cd489b0c231123df9448800 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Sat, 19 Apr 2014 02:02:32 -0400
+Subject: [PATCH 2/4] Don't build iscsiuio
+
+For gnome-continuous, we don't need a user-space network driver
+for certain Broadcom cards.
+---
+ Makefile | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 79bad84..e7dbe1d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -14,8 +14,8 @@ mandir = $(prefix)/share/man
+ etcdir = /etc
+ initddir = $(etcdir)/init.d
+ 
+-MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 iscsiuio/docs/iscsiuio.8
+-PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname iscsiuio/src/unix/iscsiuio
++MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 # iscsiuio/docs/iscsiuio.8
++PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname # iscsiuio/src/unix/iscsiuio
+ INSTALL = install
+ ETCFILES = etc/iscsid.conf
+ IFACEFILES = etc/iface.example
+@@ -26,20 +26,20 @@ IFACEFILES = etc/iface.example
+ 
+ all: user
+ 
+-user: utils/open-isns/Makefile iscsiuio/Makefile
++user: utils/open-isns/Makefile # iscsiuio/Makefile
+       $(MAKE) -C utils/open-isns
+       $(MAKE) -C utils/sysdeps
+       $(MAKE) -C utils/fwparam_ibft
+       $(MAKE) -C usr
+       $(MAKE) -C utils
+-      $(MAKE) -C iscsiuio
++#     $(MAKE) -C iscsiuio
+       @echo
+       @echo "Compilation complete                 Output file"
+       @echo "-----------------------------------  ----------------"
+       @echo "Built iSCSI daemon:                  usr/iscsid"
+       @echo "Built management application:        usr/iscsiadm"
+       @echo "Built boot tool:                     usr/iscsistart"
+-      @echo "Built iscsiuio daemon:               iscsiuio/src/unix/iscsiuio"
++#     @echo "Built iscsiuio daemon:               iscsiuio/src/unix/iscsiuio"
+       @echo
+       @echo "Read README file for detailed information."
+ 
+@@ -68,8 +68,8 @@ clean:
+       $(MAKE) -C utils/fwparam_ibft clean
+       $(MAKE) -C utils clean
+       $(MAKE) -C usr clean
+-      $(MAKE) -C kernel clean
+-      $(MAKE) -C iscsiuio clean
++#     $(MAKE) -C kernel clean
++#     $(MAKE) -C iscsiuio clean
+       $(MAKE) -C utils/open-isns clean
+       $(MAKE) -C utils/open-isns distclean
+ 
+-- 
+1.9.0
+
diff --git a/patches/iscsi-no-static-build.patch b/patches/iscsi-no-static-build.patch
new file mode 100644
index 0000000..956ed9f
--- /dev/null
+++ b/patches/iscsi-no-static-build.patch
@@ -0,0 +1,28 @@
+From 864e0c7d2760c5af4d3bd3470fcb06829d6feb19 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Sat, 19 Apr 2014 01:48:33 -0400
+Subject: [PATCH] iscsistart: don't build statically
+
+On a modern system, we'll have shared libc even in an initrd.
+---
+ usr/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/usr/Makefile b/usr/Makefile
+index 3d8ee22..48c77b3 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -61,8 +61,8 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
+       $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
+ 
+ iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
+-              iscsistart.o statics.o
+-      $(CC) $(CFLAGS) -static $^ -o $@
++              iscsistart.o
++      $(CC) $(CFLAGS) $^ -o $@
+ clean:
+       rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
+ 
+-- 
+1.9.0
+
diff --git a/patches/socat-buildsys.patch b/patches/socat-buildsys.patch
new file mode 100644
index 0000000..8e0adc7
--- /dev/null
+++ b/patches/socat-buildsys.patch
@@ -0,0 +1,27 @@
+From d9870a8096978172710466b937bf05b7f7f7a9f9 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Tue, 22 Apr 2014 21:09:58 -0400
+Subject: [PATCH 2/2] Add an autogen.sh that calls configure
+
+Even though the the only command that needs to be run is autoconf,
+having a standard name for the script that generates configure is
+useful for automated build systems. See:
+
+https://people.gnome.org/~walters/docs/build-api.txt
+---
+ autogen.sh | 3 +++
+ 1 file changed, 3 insertions(+)
+ create mode 100755 autogen.sh
+
+diff --git a/autogen.sh b/autogen.sh
+new file mode 100755
+index 0000000..bf42772
+--- /dev/null
++++ b/autogen.sh
+@@ -0,0 +1,3 @@
++#!/bin/sh
++
++autoconf
+-- 
+1.9.0
+
diff --git a/patches/socat-disable-man-pages.patch b/patches/socat-disable-man-pages.patch
new file mode 100644
index 0000000..e1fa73f
--- /dev/null
+++ b/patches/socat-disable-man-pages.patch
@@ -0,0 +1,49 @@
+From 63524630fa58fc2475de6ad9a2fcd24ddb53adfc Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Tue, 22 Apr 2014 21:07:00 -0400
+Subject: [PATCH 1/2] Disable man page generation and installation
+
+---
+ Makefile.in | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 88af935..104bf24 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -73,7 +73,7 @@ HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.
+       xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h
+ 
+ 
+-DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 
doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css 
doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html doc/socat-genericsocket.html
++DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/xio.help 
FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html 
doc/socat-multicast.html doc/socat-tun.html doc/socat-genericsocket.html
+ SHFILES = daemon.sh mail.sh ftp.sh readline.sh \
+       socat_buildscript_for_android.sh
+ TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
+@@ -95,7 +95,7 @@ scmclean: gitclean
+ gitclean: distclean docclean
+       rm -f Makefile.bak configure
+ 
+-doc: doc/socat.1 doc/socat.html
++doc:
+ 
+ docclean:
+       rm -f doc/socat.1 doc/socat.html
+@@ -131,13 +131,12 @@ doc: doc/xio.help
+ strip: progs
+       strip $(PROGS)
+ 
+-install: progs $(srcdir)/doc/socat.1
++install: progs
+       mkdir -p $(DESTDIR)$(BINDEST)
+       $(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST)
+       $(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST)
+       $(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST)
+       mkdir -p $(DESTDIR)$(MANDEST)/man1
+-      $(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/
+ 
+ uninstall:
+       rm -f $(DESTDIR)$(BINDEST)/socat
+-- 
+1.9.0
+
diff --git a/patches/tgt-buildsys.patch b/patches/tgt-buildsys.patch
new file mode 100644
index 0000000..5a4aeb2
--- /dev/null
+++ b/patches/tgt-buildsys.patch
@@ -0,0 +1,213 @@
+From 8203bc712637ddeb393b3c4b5dffa40d6c7289e2 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Mon, 14 Apr 2014 07:18:19 -0700
+Subject: [PATCH] Add a configure script to provide a standard build API
+
+Even though tgt doesn't need checks at configure time, a
+configure script with standard options provides useful compatibility
+with automated build systems. Add such a script that generates a
+config.mk that the makefiles include. Passing options directly
+to make without running configure is still supported.
+
+Operation of CFLAGS is improved so defines/includes still work
+correctly if you run 'make CFLAGS=-O1'
+---
+ .gitignore       |   3 ++
+ Makefile         |   2 ++
+ conf/Makefile    |   2 ++
+ configure        | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ doc/Makefile     |   7 ++--
+ scripts/Makefile |   2 ++
+ usr/Makefile     |   5 ++-
+ 7 files changed, 125 insertions(+), 3 deletions(-)
+ create mode 100755 configure
+
+diff --git a/.gitignore b/.gitignore
+index 8c28cb7..8b9bef1 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -33,3 +33,6 @@ usr/tgtimg
+ 
+ # cscope files
+ cscope.*
++
++# generate by configure
++config.mk
+diff --git a/Makefile b/Makefile
+index 15f2834..281ee8b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,6 +3,8 @@ VERSION ?= 1.0.48
+ CHECK_CC = cgcc
+ CHECK_CC_FLAGS = '$(CHECK_CC) -Wbitwise -Wno-return-void -no-compile $(ARCH)'
+ 
++-include config.mk
++
+ # Define a common prefix where binaries and docs install
+ PREFIX ?= /usr
+ 
+diff --git a/conf/Makefile b/conf/Makefile
+index bff222f..9a6ed0e 100644
+--- a/conf/Makefile
++++ b/conf/Makefile
+@@ -1,3 +1,5 @@
++-include ../config.mk
++
+ sysconfdir ?= /etc
+ 
+ EXAMPLES = targets.conf.example targets.conf.vtl.L700 targets.conf.vtl.MSL2024
+diff --git a/configure b/configure
+new file mode 100755
+index 0000000..817ae5a
+--- /dev/null
++++ b/configure
+@@ -0,0 +1,107 @@
++#!/bin/sh
++
++# This script provides basic compatibility with automake configure scripts
++# for use in automated build systems. See:
++#
++# https://people.gnome.org/~walters/docs/build-api.txt
++
++# Declares that this project only works when srcdir == builddir.
++#buildapi-variable-no-builddir
++
++print_help() {
++    echo "--prefix=DIR                Install files in DIR (default /usr)"
++    echo "--libdir=DIR                Install library files in DIR/tgt (default PREFIX/lib)"
++    echo "--sysconfdir=DIR    Install configuration files in DIR (default /etc)"
++    echo "--datadir=DIR               Install data files in DIR (default $PREFIX/share)"
++    echo "--mandir=DIR                Install configuration files in DIR (default DATADIR/man)"
++    echo "--docdir=DIR                Install documentation files in DIR (default DATADIR/doc/tgt)"
++    echo "--sbindir=DIR               Install binaries in DIR (default DATADIR/sbin)"
++    echo "--with-ceph         Enable support for the Ceph distributed file system"
++    echo "--with-glfs         Enable support for GlusterFS"
++}
++
++while [ $# '>' 0 ] ; do
++    option=`expr "$1" : '\([^=]*\)='`
++    optarg=
++    consume_next=false
++    if [ x$option != x ]; then
++        optarg=`expr "$1" : '[^=]*=\(.*\)'`
++        shift
++    else
++        option=$1
++        shift
++        if expr "$option" : '-' > /dev/null ; then
++            consume_next=true
++            optarg=$1
++        fi
++    fi
++
++    case $option in
++        --prefix)
++            prefix=$optarg
++            ;;
++        --libdir)
++            # Compatibility - 'make libdir=/usr/lib/tgt' was already supported
++            _libdir=$optarg
++            ;;
++        --sysconfdir)
++            sysconfdir=$optarg
++            ;;
++        --mandir)
++            mandir=$optarg
++            ;;
++        --datadir)
++            docdir=$optarg
++            ;;
++        --docdir)
++            docdir=$optarg
++            ;;
++        --sbindir)
++            mandir=$optarg
++            ;;
++        CFLAGS)
++            CFLAGS=$optarg
++            ;;
++        --with-ceph)
++            CEPH_RBD=true
++            consume_next=false
++            ;;
++        --with-glfs)
++            GLFS_BD=true
++            consume_next=false
++            ;;
++        --with-*|--without-*|--enable-*|--disable-*)
++            consume_next=false
++            ;;
++        --help)
++            print_help
++            exit
++            ;;
++    esac
++
++    if $consume_next ; then
++        shift
++    fi
++done
++
++output_var() {
++    if [ x"$2" != x"" ] ; then
++        echo $1 ?= $2
++    fi
++}
++
++(
++    output_var PREFIX $prefix
++    output_var _libdir $_libdir
++    output_var sysconfdir $sysconfdir
++    output_var mandir $mandir
++    output_var datadir $datadir
++    output_var docdir $docdir
++    output_var sbindir $sbindir
++    # support empty CFLAGS
++    if [ x${CFLAGS+set} = xset ] ; then
++        echo CFLAGS ?= $CFLAGS
++    fi
++    output_var CEPH_RBD $CEPH_RBD
++    output_var GLFS_BD $GLFS_BD
++) > config.mk
+diff --git a/doc/Makefile b/doc/Makefile
+index 0516dc8..fc34ee3 100644
+--- a/doc/Makefile
++++ b/doc/Makefile
+@@ -1,5 +1,8 @@
+-mandir ?= $(PREFIX)/share/man
+-docdir ?= $(PREFIX)/share/doc/tgt
++-include ../config.mk
++
++datadir ?= $(PREFIX)/share
++mandir ?= $(datadir)/man
++docdir ?= $(datadir)/doc/tgt
+ 
+ MANPAGES = manpages/tgtadm.8 manpages/tgt-admin.8 manpages/tgtimg.8 \
+               manpages/tgt-setup-lun.8 manpages/tgtd.8
+diff --git a/scripts/Makefile b/scripts/Makefile
+index db88911..7bce519 100644
+--- a/scripts/Makefile
++++ b/scripts/Makefile
+@@ -1,3 +1,5 @@
++-include ../config.mk
++
+ sbindir ?= $(PREFIX)/sbin
+ 
+ SCRIPTS += tgt-setup-lun tgt-admin
+diff --git a/usr/Makefile b/usr/Makefile
+index a2d2b32..f5ae6c8 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -1,5 +1,8 @@
++-include ../config.mk
++
+ sbindir ?= $(PREFIX)/sbin
+-libdir ?= $(PREFIX)/lib/tgt
++_libdir ?= $(PREFIX)/lib
++libdir ?= $(_libdir)/tgt
+ 
+ ifneq ($(DEBUG),)
+ CFLAGS += -g -O0 -ggdb -rdynamic
+-- 
+1.9.3
+
diff --git a/patches/tgt-cflags.patch b/patches/tgt-cflags.patch
new file mode 100644
index 0000000..3cb0ceb
--- /dev/null
+++ b/patches/tgt-cflags.patch
@@ -0,0 +1,78 @@
+From fe8cad69c38582f4292ed8d80b5288eca4f45430 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Mon, 14 Apr 2014 08:21:30 -0700
+Subject: [PATCH] Improve handling of CFLAGS
+
+Previously if CFLAGS was specified in the environment, all builtin
+CFLAGS were appended to it, including options like -O2 that might conflict with
+specified options.
+
+If CFLAGS was specified on the make command line, it completely overrode
+the builtin CFLAGS, including essential options like defines.
+
+Improve the handling so that core options (-g/-O) are overriden by
+user-specified values, then include directories and defines are added on.
+---
+ usr/Makefile | 28 +++++++++++++++-------------
+ 1 file changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/usr/Makefile b/usr/Makefile
+index 6234f3f..9418be2 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -1,12 +1,19 @@
+ sbindir ?= $(PREFIX)/sbin
+ libdir ?= $(PREFIX)/lib/tgt
+ 
++ifneq ($(DEBUG),)
++CFLAGS += -g -O0 -ggdb -rdynamic
++else
++CFLAGS ?= -g -O2
++override CFLAGS += -fno-strict-aliasing
++endif
++
+ ifneq ($(shell test -e /usr/include/linux/signalfd.h && echo 1),)
+-CFLAGS += -DUSE_SIGNALFD
++override CFLAGS += -DUSE_SIGNALFD
+ endif
+ 
+ ifneq ($(shell test -e /usr/include/sys/timerfd.h && echo 1),)
+-CFLAGS += -DUSE_TIMERFD
++override CFLAGS += -DUSE_TIMERFD
+ endif
+ 
+ TGTD_OBJS += $(addprefix iscsi/, conn.o param.o session.o \
+@@ -22,7 +29,7 @@ MODULES += bs_glfs.so
+ endif
+ 
+ ifneq ($(shell test -e /usr/include/sys/eventfd.h && test -e /usr/include/libaio.h && echo 1),)
+-CFLAGS += -DUSE_EVENTFD
++override CFLAGS += -DUSE_EVENTFD
+ TGTD_OBJS += bs_aio.o
+ LIBS += -laio
+ endif
+@@ -34,16 +41,11 @@ endif
+ 
+ INCLUDES += -I.
+ 
+-CFLAGS += -D_GNU_SOURCE
+-CFLAGS += $(INCLUDES)
+-ifneq ($(DEBUG),)
+-CFLAGS += -g -O0 -ggdb -rdynamic
+-else
+-CFLAGS += -g -O2 -fno-strict-aliasing
+-endif
+-CFLAGS += -Wall -Wstrict-prototypes -fPIC
+-CFLAGS += -DTGT_VERSION=\"$(VERSION)$(EXTRAVERSION)\"
+-CFLAGS += -DBSDIR=\"$(DESTDIR)$(libdir)/backing-store\"
++override CFLAGS += -D_GNU_SOURCE
++override CFLAGS += $(INCLUDES)
++override CFLAGS += -Wall -Wstrict-prototypes -fPIC
++override CFLAGS += -DTGT_VERSION=\"$(VERSION)$(EXTRAVERSION)\"
++override CFLAGS += -DBSDIR=\"$(DESTDIR)$(libdir)/backing-store\"
+ 
+ LIBS += -lpthread -ldl
+ 
+-- 
+1.9.0
+
diff --git a/patches/tgt-disable-man.patch b/patches/tgt-disable-man.patch
new file mode 100644
index 0000000..d1f7eb6
--- /dev/null
+++ b/patches/tgt-disable-man.patch
@@ -0,0 +1,111 @@
+From 7266a6c9a4a31dbf7ac6a561a579331ee58403d8 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Mon, 14 Apr 2014 08:11:09 -0700
+Subject: [PATCH] Add the ability to disable manual page generation
+
+In some circumstances it's useful to build tgt even if the XSL
+manual pages can't be built because of the need for xlstproc
+and stylesheets. Add a DISABLE_MAN make variable and a corresponding
+--disable-man configure variable.
+---
+ configure    |  6 ++++++
+ doc/Makefile | 30 ++++++++++++++++++++++--------
+ 2 files changed, 28 insertions(+), 8 deletions(-)
+
+diff --git a/configure b/configure
+index 817ae5a..9cc5265 100755
+--- a/configure
++++ b/configure
+@@ -18,6 +18,7 @@ print_help() {
+     echo "--sbindir=DIR               Install binaries in DIR (default DATADIR/sbin)"
+     echo "--with-ceph         Enable support for the Ceph distributed file system"
+     echo "--with-glfs         Enable support for GlusterFS"
++    echo "--disable-man         Disable building and installing man pages"
+ }
+ 
+ while [ $# '>' 0 ] ; do
+@@ -70,6 +71,10 @@ while [ $# '>' 0 ] ; do
+             GLFS_BD=true
+             consume_next=false
+             ;;
++        --disable-man)
++            DISABLE_MAN=true
++            consume_next=false
++            ;;
+         --with-*|--without-*|--enable-*|--disable-*)
+             consume_next=false
+             ;;
+@@ -104,4 +109,5 @@ output_var() {
+     fi
+     output_var CEPH_RBD $CEPH_RBD
+     output_var GLFS_BD $GLFS_BD
++    output_var DISABLE_MAN $DISABLE_MAN
+ ) > config.mk
+diff --git a/doc/Makefile b/doc/Makefile
+index fc34ee3..611fec5 100644
+--- a/doc/Makefile
++++ b/doc/Makefile
+@@ -4,13 +4,25 @@ datadir ?= $(PREFIX)/share
+ mandir ?= $(datadir)/man
+ docdir ?= $(datadir)/doc/tgt
+ 
+-MANPAGES = manpages/tgtadm.8 manpages/tgt-admin.8 manpages/tgtimg.8 \
+-              manpages/tgt-setup-lun.8 manpages/tgtd.8
+-
+ DOCS = README.iscsi README.iser \
+           README.lu_configuration README.mmc tmf.txt \
+           README.rbd
+ 
++.PHONY:all install clean
++all:
++install:
++clean:
++
++.PHONY: install-docs
++install: install-docs
++install-docs: $(DOCS)
++      install -d -m 755 $(DESTDIR)$(docdir)
++      install -m 644 $(DOCS) $(DESTDIR)$(docdir)
++
++ifeq ($(DISABLE_MAN),)
++MANPAGES = manpages/tgtadm.8 manpages/tgt-admin.8 manpages/tgtimg.8 \
++              manpages/tgt-setup-lun.8 manpages/tgtd.8
++
+ XSLTPROC = /usr/bin/xsltproc
+ XMLMAN = manpages/tgtd.8 manpages/tgtadm.8 manpages/tgtimg.8 \
+               manpages/tgt-admin.8 manpages/targets.conf.5 \
+@@ -19,11 +31,11 @@ XMLHTML = htmlpages/tgtd.8.html htmlpages/tgtadm.8.html \
+               htmlpages/tgtimg.8.html htmlpages/tgt-admin.8.html \
+               htmlpages/targets.conf.5.html htmlpages/tgt-setup-lun.8.html
+ 
+-.PHONY:all
+ all: xmlman xmlhtml
+ 
+-.PHONY: install
+-install: $(MANPAGES) $(DOCS)
++.PHONY: install-man
++install: install-man
++install-man: $(MANPAGES) $(DOCS)
+       install -d -m 755 $(DESTDIR)$(mandir)/man8
+       install -m 644 $(MANPAGES) $(DESTDIR)$(mandir)/man8
+       install -d -m 755 $(DESTDIR)$(docdir)
+@@ -31,8 +43,9 @@ install: $(MANPAGES) $(DOCS)
+       install -d -m 755 $(DESTDIR)$(docdir)/html
+       install -m 644 $(XMLHTML) $(DESTDIR)$(docdir)/html
+ 
+-.PHONY: clean
+-clean:
++.PHONY: clean-man
++clean: clean-man
++clean-man:
+       rm -f $(XMLMAN) $(XMLHTML)
+       -rm -f manpages htmlpages
+ 
+@@ -76,3 +89,4 @@ xmlman: $(XMLMAN)
+ 
+ xmlhtml: $(XMLHTML)
+ 
++endif
+-- 
+1.9.0
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]