source: packages/utils/lvm2/Makefile @ 20319

Last change on this file since 20319 was 20319, checked in by florian, 7 years ago

[package] lvm2: add new mirror and fix shared library installation

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