lvm2.mk 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #############################################################
  2. #
  3. # lvm2
  4. #
  5. #############################################################
  6. # Copyright (C) 2005 by Richard Downer <rdowner@gmail.com>
  7. # Derived from work
  8. # Copyright (C) 2001-2005 by Erik Andersen <andersen@codepoet.org>
  9. # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU Library General Public License as
  13. # published by the Free Software Foundation; either version 2 of the
  14. # License, or (at your option) any later version.
  15. #
  16. # This program is distributed in the hope that it will be useful, but
  17. # WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. # Library General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU Library General Public
  22. # License along with this program; if not, write to the Free Software
  23. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  24. # USA
  25. LVM2_BASEVER=2.00
  26. LVM2_PATCH=33
  27. LVM2_VERSION=$(LVM2_BASEVER).$(LVM2_PATCH)
  28. LVM2_SOURCE:=LVM2.$(LVM2_VERSION).tgz
  29. LVM2_SITE:=ftp://sources.redhat.com/pub/lvm2
  30. LVM2_CAT:=zcat
  31. LVM2_DIR:=$(BUILD_DIR)/LVM2.$(LVM2_VERSION)
  32. 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
  33. LVM2_TARGET_SBINS=$(foreach lvm2sbin, $(LVM2_SBIN), $(TARGET_DIR)/sbin/$(lvm2sbin))
  34. $(DL_DIR)/$(LVM2_SOURCE):
  35. $(WGET) -P $(DL_DIR) $(LVM2_SITE)/$(LVM2_SOURCE)
  36. $(LVM2_DIR)/.unpacked: $(DL_DIR)/$(LVM2_SOURCE)
  37. $(LVM2_CAT) $(DL_DIR)/$(LVM2_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  38. touch $(LVM2_DIR)/.unpacked
  39. $(LVM2_DIR)/.configured: $(LVM2_DIR)/.unpacked
  40. (cd $(LVM2_DIR); rm -rf config.cache; \
  41. $(TARGET_CONFIGURE_OPTS) \
  42. CFLAGS="$(TARGET_CFLAGS)" \
  43. ./configure \
  44. --target=$(GNU_TARGET_NAME) \
  45. --host=$(GNU_TARGET_NAME) \
  46. --build=$(GNU_HOST_NAME) \
  47. $(DISABLE_NLS) \
  48. $(DISABLE_LARGEFILE) \
  49. --with-user=$(shell id -un) --with-group=$(shell id -gn) \
  50. );
  51. touch $(LVM2_DIR)/.configured
  52. $(LVM2_TARGET_SBINS): $(LVM2_DIR)/.configured
  53. $(MAKE) CC=$(TARGET_CC) -C $(LVM2_DIR)
  54. $(MAKE) CC=$(TARGET_CC) -C $(LVM2_DIR) install prefix=$(STAGING_DIR) exec_prefix=$(STAGING_DIR)
  55. for binary in $(LVM2_SBIN); do echo $$binary; cp -a $(STAGING_DIR)/sbin/$$binary $(TARGET_DIR)/sbin; done
  56. lvm2: uclibc dm $(LVM2_TARGET_SBINS)
  57. lvm2-clean:
  58. $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(LVM2_DIR) uninstall
  59. -$(MAKE) -C $(LVM2_DIR) clean
  60. lvm2-dirclean:
  61. rm -rf $(LVM2_DIR)
  62. #############################################################
  63. #
  64. # Toplevel Makefile options
  65. #
  66. #############################################################
  67. ifeq ($(strip $(BR2_PACKAGE_LVM2)),y)
  68. TARGETS+=lvm2
  69. endif