Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Banky <martin.banky@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 03/10] lvm2: convert to autotargets and bump to 2.02.74
Date: Tue,  5 Oct 2010 01:22:36 -0700	[thread overview]
Message-ID: <1286266963-23413-3-git-send-email-Martin.Banky@gmail.com> (raw)
In-Reply-To: <1286266963-23413-1-git-send-email-Martin.Banky@gmail.com>

Signed-off-by: Martin Banky <Martin.Banky@gmail.com>
---
 package/lvm2/lvm2.mk |  153 +++++++++++++++++---------------------------------
 1 files changed, 51 insertions(+), 102 deletions(-)

diff --git a/package/lvm2/lvm2.mk b/package/lvm2/lvm2.mk
index 2bd6b8b..b359b97 100644
--- a/package/lvm2/lvm2.mk
+++ b/package/lvm2/lvm2.mk
@@ -3,115 +3,64 @@
 # lvm2
 #
 #############################################################
-# Copyright (C) 2005 by Richard Downer <rdowner@gmail.com>
-# Derived from work
-# Copyright (C) 2001-2005 by Erik Andersen <andersen@codepoet.org>
-# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-LVM2_BASEVER=2.02
-LVM2_DMVER=1.02
-LVM2_PATCH=50
-LVM2_VERSION=$(LVM2_BASEVER).$(LVM2_PATCH)
-LVM2_SOURCE:=LVM2.$(LVM2_VERSION).tgz
-LVM2_SITE:=ftp://sources.redhat.com/pub/lvm2
-LVM2_CAT:=$(ZCAT)
-LVM2_DIR:=$(BUILD_DIR)/LVM2.$(LVM2_VERSION)
-LVM2_SBIN:=lvchange lvcreate lvdisplay lvextend lvm lvmchange lvmdiskscan lvmsadc lvmsar lvreduce lvremove lvrename lvresize lvs lvscan pvchange pvcreate pvdisplay pvmove pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan vgsplit
-LVM2_DMSETUP_SBIN:=dmsetup
-LVM2_LIB:=libdevmapper.so.$(LVM2_DMVER)
-LVM2_TARGET_SBINS=$(foreach lvm2sbin, $(LVM2_SBIN), $(TARGET_DIR)/sbin/$(lvm2sbin))
-LVM2_TARGET_DMSETUP_SBINS=$(foreach lvm2sbin, $(LVM2_DMSETUP_SBIN), $(TARGET_DIR)/sbin/$(lvm2sbin))
-LVM2_TARGET_LIBS=$(foreach lvm2lib, $(LVM2_LIB), $(TARGET_DIR)/lib/$(lvm2lib))
-
-$(DL_DIR)/$(LVM2_SOURCE):
-	 $(call DOWNLOAD,$(LVM2_SITE),$(LVM2_SOURCE))
-
-lvm2-source: $(DL_DIR)/$(LVM2_SOURCE)
-
+LVM2_VERSION = 2.02.74
+LVM2_SOURCE = LVM2.$(LVM2_VERSION).tgz
+LVM2_SITE = ftp://sources.redhat.com/pub/lvm2
+LVM2_INSTALL_STAGING = YES
+
+LVM2_BINS = dmsetup fsadm lvchange lvconvert lvcreate lvdisplay lvextend lvm \
+		lvmchange lvmconf lvmdiskscan lvmdump lvmsadc lvmsar lvreduce lvremove \
+		lvrename lvresize lvs lvscan pvchange pvck pvcreate pvdisplay pvmove \
+		pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore vgchange vgck \
+		vgconvert vgcreate vgdisplay vgexport vgextend vgimport vgimportclone \
+		vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan vgsplit
 
 ifeq ($(BR2_PACKAGE_READLINE),y)
-LVM2_DEPENDENCIES+=readline
+LVM2_DEPENDENCIES += readline
 else
 # v2.02.44: disable readline usage, or binaries are linked against provider
 # of "tgetent" (=> ncurses) even if it's not used..
-LVM2_CONF_OPT+=--disable-readline
+LVM2_CONF_OPT += --disable-readline
 endif
 
-
-$(LVM2_DIR)/.unpacked: $(DL_DIR)/$(LVM2_SOURCE)
-	$(LVM2_CAT) $(DL_DIR)/$(LVM2_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
-	touch $(LVM2_DIR)/.unpacked
-
-$(LVM2_DIR)/.configured: $(LVM2_DIR)/.unpacked
-	(cd $(LVM2_DIR); rm -rf config.cache; \
-		$(TARGET_CONFIGURE_OPTS) \
-		$(TARGET_CONFIGURE_ARGS) \
-		./configure $(QUIET) \
-		--target=$(GNU_TARGET_NAME) \
-		--host=$(GNU_TARGET_NAME) \
-		--build=$(GNU_HOST_NAME) \
-		$(DISABLE_NLS) \
-		$(DISABLE_LARGEFILE) \
-		--with-user=$(shell id -un) --with-group=$(shell id -gn) \
-		$(LVM2_CONF_OPT) \
-	)
-	touch $(LVM2_DIR)/.configured
-
-
-$(LVM2_DIR)/.built: $(LVM2_DIR)/.configured
-	$(MAKE1) -C $(LVM2_DIR) DESTDIR=$(STAGING_DIR)
-	$(MAKE1) -C $(LVM2_DIR) DESTDIR=$(STAGING_DIR) install
-	# Fixup write permissions so that the files can be overwritten
-	# several times in the $(TARGET_DIR)
-	chmod 755 $(STAGING_DIR)/sbin/lvm
-	chmod 755 $(STAGING_DIR)/sbin/dmsetup
-	chmod 644 $(STAGING_DIR)/lib/$(LVM2_LIB)
-	touch $(LVM2_DIR)/.built
-
-
-$(LVM2_TARGET_SBINS) $(LVM2_TARGET_DMSETUP_SBINS): $(LVM2_DIR)/.built
-	cp -a $(STAGING_DIR)/sbin/$(notdir $@) $@
-	touch $@
-
-$(LVM2_TARGET_LIBS): $(LVM2_DIR)/.built
-	cp -a $(STAGING_DIR)/lib/$(notdir $@) $@
-	touch $@
-
-
 ifeq ($(BR2_PACKAGE_LVM2_DMSETUP_ONLY),y)
-lvm2: $(LVM2_TARGET_DMSETUP_SBINS) $(LVM2_TARGET_LIBS)
-else
-lvm2: $(LVM2_TARGET_SBINS) $(LVM2_TARGET_DMSETUP_SBINS) $(LVM2_TARGET_LIBS)
+LVM2_MAKE_OPT = device-mapper
+LVM2_INSTALL_STAGING_OPT = DESTDIR=$$(STAGING_DIR) device-mapper_install
+LVM2_INSTALL_TARGET_OPT = DESTDIR=$$(STAGING_DIR) device-mapper_install
 endif
 
-
-lvm2-clean:
-	$(MAKE) DESTDIR=$(TARGET_DIR) -C $(LVM2_DIR) uninstall
-	-$(MAKE) -C $(LVM2_DIR) clean
-
-lvm2-dirclean:
-	rm -rf $(LVM2_DIR)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_LVM2),y)
-TARGETS+=lvm2
-endif
+define LVM2_STAGING_FILE_PERMS_FIXUP
+	chmod 755 $(STAGING_DIR)/usr/sbin/lvm
+	chmod 755 $(STAGING_DIR)/usr/sbin/fsadm
+	chmod 755 $(STAGING_DIR)/usr/sbin/dmsetup
+	chmod 755 $(STAGING_DIR)/usr/sbin/lvmconf
+	chmod 755 $(STAGING_DIR)/usr/sbin/lvmdump
+	chmod 755 $(STAGING_DIR)/usr/sbin/vgimportclone
+	chmod 644 $(STAGING_DIR)/usr/lib/libdevmapper.so
+endef
+
+LVM2_POST_INSTALL_STAGING_HOOKS += LVM2_STAGING_FILE_PERMS_FIXUP
+
+define LVM2_TARGET_FILE_PERMS_FIXUP
+	chmod 755 $(TARGET_DIR)/usr/sbin/lvm
+	chmod 755 $(TARGET_DIR)/usr/sbin/fsadm
+	chmod 755 $(TARGET_DIR)/usr/sbin/dmsetup
+	chmod 755 $(TARGET_DIR)/usr/sbin/lvmconf
+	chmod 755 $(TARGET_DIR)/usr/sbin/lvmdump
+	chmod 755 $(TARGET_DIR)/usr/sbin/vgimportclone
+	chmod 644 $(TARGET_DIR)/usr/lib/libdevmapper.so
+endef
+
+LVM2_POST_INSTALL_TARGET_HOOKS += LVM2_TARGET_FILE_PERMS_FIXUP
+
+define LVM2_UNINSTALL_STAGING_CMDS
+	rm -f $(addprefix $(STAGING_DIR)/usr/sbin/,$(LVM2_BINS))
+	rm -f $(addprefix $(STAGING_DIR)/usr/lib/,libdevmapper.so*)
+endef
+
+define LVM2_UNINSTALL_TARGET_CMDS
+	rm -f $(addprefix $(TARGET_DIR)/usr/sbin/,$(LVM2_BINS))
+	rm -f $(addprefix $(TARGET_DIR)/usr/lib/,libdevmapper.so*)
+endef
+
+$(eval $(call AUTOTARGETS,package,lvm2))
-- 
1.7.3.1

  parent reply	other threads:[~2010-10-05  8:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05  8:22 [Buildroot] [PATCH 01/10] input-tools: convert to gentargets Martin Banky
2010-10-05  8:22 ` [Buildroot] [PATCH 02/10] lsof: convert to gentargets and bump to 4.84 Martin Banky
2010-12-12 16:58   ` Thomas Petazzoni
2010-10-05  8:22 ` Martin Banky [this message]
2010-12-12 16:59   ` [Buildroot] [PATCH 03/10] lvm2: convert to autotargets and bump to 2.02.74 Thomas Petazzoni
2010-10-05  8:22 ` [Buildroot] [PATCH 04/10] memtester: convert to gentargets and bump to 4.2.0 Martin Banky
2010-12-12 17:11   ` Thomas Petazzoni
2010-10-05  8:22 ` [Buildroot] [PATCH 05/10] microcom: convert to gentargets Martin Banky
2010-10-05  9:21   ` Thomas Petazzoni
2010-10-05 18:54     ` Martin Banky
2010-10-05 19:48       ` Peter Korsgaard
2010-10-05 21:05         ` Martin Banky
2010-10-05 21:13           ` Peter Korsgaard
2010-10-05 21:58             ` Martin Banky
2010-12-12 17:12         ` Thomas Petazzoni
2010-10-05  8:22 ` [Buildroot] [PATCH 06/10] microperl: " Martin Banky
2010-10-05  9:19   ` Thomas Petazzoni
2010-10-05 19:10     ` Martin Banky
2010-10-05  8:22 ` [Buildroot] [PATCH 07/10] mii-diag: convert to gentargets and bump to 2.11.3 Martin Banky
2010-10-05  8:22 ` [Buildroot] [PATCH 08/10] alsa-utils: convert to autotargets and bump to 1.0.23 Martin Banky
2010-10-05  8:22 ` [Buildroot] [PATCH 09/10] mplayer: convert to gentargets Martin Banky
2010-10-06  3:42   ` Chih-Min Chao
2010-10-06  5:55     ` Martin Banky
2010-10-08 20:45   ` Sergio Monteiro Basto
2010-10-10 21:50     ` Martin Banky
2010-12-12 21:12   ` Thomas Petazzoni
2010-10-05  8:22 ` [Buildroot] [PATCH 10/10] netplug: convert to gentargets and bump to 1.2.9.2 Martin Banky
2010-10-05  9:17 ` [Buildroot] [PATCH 01/10] input-tools: convert to gentargets Thomas Petazzoni
2010-10-05 18:38   ` Martin Banky
2010-10-05 19:26     ` Martin Banky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286266963-23413-3-git-send-email-Martin.Banky@gmail.com \
    --to=martin.banky@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox