Fixup TABs; Update to 2.02.60
[openwrt/svn-archive/archive.git] / utils / lvm2 / Makefile
1 #
2 # Copyright (C) 2009, 2010 Stefan Monnier
3 #
4 # This is free software, licensed under the GNU General Public License v3+.
5 # See /LICENSE for more information.
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=LVM2
10 PKG_VERSION:=2.02.60
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
14 PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2/
15 PKG_MD5SUM:=33e0e0f4b4582d495ff619696c634b2a
16 # 2.02.43 = fc34655706a2aa116b92328b24fad619
17 # 2.02.44 = 4ed7b99903a6fc5165b7b0b8def42486
18 # 2.02.53 = f9ae3579bf15467b7f1d7aea8b9ed9b3
19 # 2.02.60 = 33e0e0f4b4582d495ff619696c634b2a
20
21 # OpenWRT normally expects the tarball to expand into
22 # $(PKG_NAME)-$(PKG_VERSION), and this magic incantation seems to make it
23 # understand that LVM2's tarball expands into $(PKG_NAME).$(PKG_VERSION).
24 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/libdevmapper
29 SECTION:=libs
30 CATEGORY:=Libraries
31 SUBMENU:=disc
32 DEPENDS:=+kmod-dm
33 TITLE:=The Linux Kernel Device Mapper userspace library
34 URL:=http://sourceware.org/dm/
35 endef
36
37 define Package/libdevmapper/description
38 The Linux Kernel Device Mapper is the LVM (Linux Logical Volume Management)
39 Team\'s implementation of a minimalistic kernel-space driver that handles
40 volume management, while keeping knowledge of the underlying device layout
41 in user-space. This makes it useful for not only LVM, but EVMS, software
42 raid, and other drivers that create "virtual" block devices.
43 .
44 This package contains the (user-space) shared library for accessing the
45 device-mapper; it allows usage of the device-mapper through a clean,
46 consistent interface (as opposed to through kernel ioctls).
47 endef
48
49 define Package/lvm2
50 SECTION:=utils
51 CATEGORY:=Utilities
52 SUBMENU:=disc
53 TITLE:=The Linux Logical Volume Manager
54 DEPENDS:=+libdevmapper +libreadline
55 URL:=http://sourceware.org/lvm2/
56 endef
57
58 define Package/lvm2/description
59 This is LVM2, the rewrite of The Linux Logical Volume Manager. LVM
60 supports enterprise level volume management of disk and disk subsystems
61 by grouping arbitrary disks into volume groups. The total capacity of
62 volume groups can be allocated to logical volumes, which are accessed as
63 regular block devices.
64 endef
65
66 # I got problems building with readline, so I originally just disabled it.
67 # I've since added patch 100-readline-link which fixes the problem instead.
68 # CONFIGURE_ARGS += --disable-readline
69
70 # Apparently we have problems when "read"ing using O_DIRECT, maybe because
71 # of uClibc. More specifically, with O_DIRECT lvm becomes erratic, showing
72 # non-deterministic behavior: `lvs', `pvs' and friends can return anything
73 # from empty lists, to completely correct result, as well as checksum errors,
74 # complaints about missing volume groups, ... each run of the command can
75 # return something different. The "root" of the problem is (maybe among
76 # other places) in the "_io" function in dev-io.c, where calls to the "read"
77 # function often return garbage, although not always. There's nothing
78 # obviously wrong with the dev-io.c code, so the bug may just as well be in
79 # uClibc or in the kernel (it appeared on the MIPS platform and could be
80 # related to cache coherency issues).
81 # Debian Lenny's lvm2 also disables O_DIRECT on "arm armeb hppa mips mipsel".
82 CONFIGURE_ARGS += --disable-o_direct
83
84 define Build/InstallDev
85 mkdir -p $(1)/usr/include
86 $(INSTALL_DATA) $(PKG_BUILD_DIR)/include/libdevmapper.h $(1)/usr/include/
87 mkdir -p $(1)/usr/lib
88 $(CP) $(PKG_BUILD_DIR)/libdm/ioctl/libdevmapper.so $(1)/usr/lib/
89 mkdir -p $(1)/usr/lib/pkgconfig
90 $(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig/
91 endef
92
93 define Package/libdevmapper/install
94 $(INSTALL_DIR) $(1)/usr/lib
95 $(INSTALL_DATA) $(PKG_BUILD_DIR)/libdm/libdevmapper.so.* $(1)/usr/lib/
96 endef
97
98 # This rule only installs the `lvm' executable. Debian also installs
99 # a whole bunch of symlinks so that instead of `lvm <foo>' you can directly
100 # run `<foo>'.
101 define Package/lvm2/install
102 $(INSTALL_DIR) $(1)/sbin
103 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/lvm $(1)/sbin/
104 $(INSTALL_DIR) $(1)/etc/lvm
105 $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/example.conf $(1)/etc/lvm/lvm.conf
106 $(INSTALL_DIR) $(1)/etc/init.d
107 $(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2
108 endef
109
110 define Package/lvm2/conffiles
111 /etc/lvm/lvm.conf
112 endef
113
114 $(eval $(call BuildPackage,libdevmapper))
115 $(eval $(call BuildPackage,lvm2))