also install required files for HAVE_INCLUDES
[buildroot.git] / package / lvm2 / lvm2.mk
blob8628559aa7b4c39414c6aee993da91216cb4ff29
1 #############################################################
3 # lvm2
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>
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.
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.
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
26 LVM2_BASEVER=2.02
27 LVM2_PATCH=28
28 LVM2_VERSION=$(LVM2_BASEVER).$(LVM2_PATCH)
29 LVM2_SOURCE:=LVM2.$(LVM2_VERSION).tgz
30 LVM2_SITE:=ftp://sources.redhat.com/pub/lvm2
31 LVM2_CAT:=$(ZCAT)
32 LVM2_DIR:=$(BUILD_DIR)/LVM2.$(LVM2_VERSION)
33 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
34 LVM2_TARGET_SBINS=$(foreach lvm2sbin, $(LVM2_SBIN), $(TARGET_DIR)/sbin/$(lvm2sbin))
36 $(DL_DIR)/$(LVM2_SOURCE):
37 $(WGET) -P $(DL_DIR) $(LVM2_SITE)/$(LVM2_SOURCE)
39 lvm2-source: $(DL_DIR)/$(LVM2_SOURCE)
41 $(LVM2_DIR)/.unpacked: $(DL_DIR)/$(LVM2_SOURCE)
42 $(LVM2_CAT) $(DL_DIR)/$(LVM2_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
43 touch $(LVM2_DIR)/.unpacked
45 $(LVM2_DIR)/.configured: $(LVM2_DIR)/.unpacked
46 (cd $(LVM2_DIR); rm -rf config.cache; \
47 $(TARGET_CONFIGURE_OPTS) \
48 $(TARGET_CONFIGURE_ARGS) \
49 ac_cv_have_decl_malloc=yes \
50 gl_cv_func_malloc_0_nonnull=yes \
51 ac_cv_func_malloc_0_nonnull=yes \
52 ac_cv_func_calloc_0_nonnull=yes \
53 ac_cv_func_realloc_0_nonnull=yes \
54 ./configure \
55 --target=$(GNU_TARGET_NAME) \
56 --host=$(GNU_TARGET_NAME) \
57 --build=$(GNU_HOST_NAME) \
58 $(DISABLE_NLS) \
59 $(DISABLE_LARGEFILE) \
60 --with-user=$(shell id -un) --with-group=$(shell id -gn) \
62 touch $(LVM2_DIR)/.configured
64 $(LVM2_TARGET_SBINS): $(LVM2_DIR)/.configured
65 $(MAKE) CC=$(TARGET_CC) -C $(LVM2_DIR) DESTDIR=$(STAGING_DIR)
66 $(MAKE) CC=$(TARGET_CC) -C $(LVM2_DIR) DESTDIR=$(STAGING_DIR) install
67 for binary in $(LVM2_SBIN); do echo $$binary; cp -a $(STAGING_DIR)/sbin/$$binary $(TARGET_DIR)/sbin; done
69 lvm2: dm $(LVM2_TARGET_SBINS)
71 lvm2-clean:
72 $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(LVM2_DIR) uninstall
73 -$(MAKE) -C $(LVM2_DIR) clean
75 lvm2-dirclean:
76 rm -rf $(LVM2_DIR)
78 #############################################################
80 # Toplevel Makefile options
82 #############################################################
83 ifeq ($(BR2_PACKAGE_LVM2),y)
84 TARGETS+=lvm2
85 endif