[Ovirt-devel] [PATCH appliance] autoconfiscate

Jim Meyering jim at meyering.net
Thu Sep 11 13:46:38 UTC 2008


release.mk: Copy from ../node
autogen.sh: Likewise.
Makefile.am: New file.  List distributed files.
configure.ac: Set package name.
---

Tested via "make -f ... build" on F9.

 .gitignore   |   21 ++++++++++++++++++---
 Makefile     |   38 --------------------------------------
 Makefile.am  |   37 +++++++++++++++++++++++++++++++++++++
 autogen.sh   |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac |    6 ++++++
 release.mk   |    9 +++++----
 6 files changed, 124 insertions(+), 45 deletions(-)
 delete mode 100644 Makefile
 create mode 100644 Makefile.am
 create mode 100755 autogen.sh
 create mode 100644 configure.ac

diff --git a/.gitignore b/.gitignore
index a2ea3e5..cd5ff32 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,19 @@
-repos.ks
-ovirt-appliance.xml
-ovirt-appliance-sda.raw
+*~
+INSTALL
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache/
+config.h
+config.h.in
+config.log
+config.status
+configure
+install-sh
+missing
+ovirt-appliance-*.tar.gz
 ovirt-appliance-sda.qcow
+ovirt-appliance-sda.raw
+ovirt-appliance.xml
+repos.ks
+stamp-h1
diff --git a/Makefile b/Makefile
deleted file mode 100644
index a743d29..0000000
--- a/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-# FEDORA_URL env var can be set to the root of a fedora mirror
-# OVIRT_URL env var can be set to the root of an ovirt.org mirror
-# SKIP_COMPRESS_IMAGE env var an be set to 1 to skip qcow compression
-# that contains the install tree
-pkg_name = ovirt-appliance
-
-all: rpms
-include release.mk
-
-ifdef SKIP_COMPRESS_IMAGE
-RPM_FLAGS += --define "skip_compress_image 1"
-endif
-
-ifdef FEDORA_URL
-RPM_FLAGS += --define "fedora_url $(FEDORA_URL)"
-endif
-
-ifdef OVIRT_URL
-RPM_FLAGS += --define "ovirt_url $(OVIRT_URL)"
-endif
-
-clean:
-	rm -rf $(pkg_name)-*
-
-distclean: clean
-	rm -rf tmp repos.ks rpm-build
-
-tar: clean common-install.ks common-pkgs.ks common-post.ks ovirt-appliance.ks repos.ks.in
-	mkdir -p $(NV)
-	cp -a common-install.ks common-pkgs.ks common-post.ks COPYING \
-		create-$(pkg_name) gettree.sh Makefile $(pkg_name).ks \
-		$(pkg_name).spec release.mk repos.ks.in $(NV)
-	mkdir -p rpm-build
-	tar zcvf rpm-build/$(NV).tar $(NV)
-	cp version rpm-build/
-	rm -rf $(NV)
-
-.PHONY: clean distclean all tar
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..b59086a
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,37 @@
+# Copyright (C) 2008 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.  A copy of the GNU General Public License is
+# also available at http://www.gnu.org/copyleft/gpl.html.
+
+EXTRA_DIST =			\
+  .gitignore			\
+  common-install.ks		\
+  common-pkgs.ks		\
+  common-post.ks		\
+  create-ovirt-appliance	\
+  gettree.sh			\
+  ovirt-appliance.ks		\
+  ovirt-appliance.spec		\
+  release.mk			\
+  repos.ks.in			\
+  version
+
+include release.mk
+
+pkg_name = $(PACKAGE_NAME)
+.PHONY: tar
+tar: dist
+	mkdir -p rpm-build/BUILDROOT
+	cp version $(distdir).tar.gz rpm-build
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..0d2c99c
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+# Run this to generate configure and Makefile
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+THEDIR=`pwd`
+(
+  cd $srcdir
+  die=0
+
+  (autoconf --version) < /dev/null > /dev/null 2>&1 || {
+	  echo
+	  echo "You must have autoconf installed."
+	  echo "Download the appropriate package for your distribution,"
+	  echo "or see http://www.gnu.org/software/autoconf"
+	  die=1
+  }
+
+  (libtool --version) < /dev/null > /dev/null 2>&1 || {
+	  echo
+	  echo "You must have libtool installed."
+	  echo "Download the appropriate package for your distribution,"
+	  echo "or see http://www.gnu.org/software/libtool"
+	  die=1
+  }
+
+  (automake --version) < /dev/null > /dev/null 2>&1 || {
+	  echo
+	  die=1
+	  echo "You must have automake installed."
+	  echo "Download the appropriate package for your distribution,"
+	  echo "or see http://www.gnu.org/software/automake"
+  }
+
+  test $die = 1 && exit 1
+
+  test -f ovirt-appliance.spec || {
+	  echo "You must run this script in the top-level directory"
+	  exit 1
+  }
+
+  if test -z "$*"; then
+	  echo "I am going to run ./configure with no arguments - if you wish "
+	  echo "to pass any to it, please specify them on the $0 command line."
+  fi
+
+  aclocal
+  autoheader
+  automake --add-missing
+  autoconf
+  ./configure "$@"
+)
+
+if test "x$OBJ_DIR" != x; then
+    mkdir -p "$OBJ_DIR"
+    cd "$OBJ_DIR"
+fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..3f0fa6e
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,6 @@
+# note: the version number here is overridden by the one in release.mk
+AC_INIT([ovirt-appliance], [0.1], [ovirt-devel at redhat.com])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/release.mk b/release.mk
index b89bd86..7d9ddd0 100644
--- a/release.mk
+++ b/release.mk
@@ -2,13 +2,14 @@
 # It expects the including Makefile to define the "pkg_name" 
 # variable, as well as a file named "version" in the current directory.

-ARCH		:= $(shell uname -i)
-VERSION		:= $(shell awk '{ print $$1 }' version)
-RELEASE		:= $(shell awk '{ print $$2 }' version)
+srcdir		?= .
+ARCH		= $(shell uname -i)
+VERSION		= $(shell awk '{ print $$1 }' $(srcdir)/version)
+RELEASE		= $(shell awk '{ print $$2 }' $(srcdir)/version)
 NEWVERSION	= $$(awk 'BEGIN { printf "%.2f", $(VERSION) + .01 }')
 NEWRELEASE	= $$(($(RELEASE) + 1))
 X		= $$(awk '{ split($$2,r,"."); \
-                            printf("%d.%d\n", r[1], r[2]+1) }' version)
+			  printf("%d.%d\n", r[1], r[2]+1) }' $(srcdir)/version)
 git_head	= $$(git log -1 --pretty=format:%h)
 GITRELEASE	= $(X).$$(date --utc +%Y%m%d%H%M)git$(git_head)
 DIST		= $$(rpm --eval '%{dist}')
-- 
1.6.0.1.308.gede4c




More information about the ovirt-devel mailing list