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