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