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