1 # Maintainer: Eric Bélanger <eric@archlinux.org>
2 # Maintainer: Thomas Bächler <thomas@archlinux.org>
5 pkgname=('lvm2' 'device-mapper')
6 _tag='a6c8d2429ce4d4a13750f271987702d3e2648904' # git rev-parse v${pkgver//./_}
10 url='https://sourceware.org/lvm2/'
11 license=('GPL2' 'LGPL2.1')
12 makedepends=('git' 'systemd' 'libaio' 'thin-provisioning-tools')
13 validpgpkeys=('88437EF5C077BD113D3B7224228191C1567E2C17' # Alasdair G Kergon <agk@redhat.com>
14 'D501A478440AE2FD130A1BE8B9112431E509039F') # Marian Csontos <marian.csontos@gmail.com>
15 source=("git+https://sourceware.org/git/lvm2.git#tag=${_tag}?signed"
16 '0001-udev-initcpio.patch'
18 '11-dm-initramfs.rules')
20 '2b3a16ec05e2bc6678e9ebd5ffa8319ebfde29aa260ce004f79f9b8df57d73c9'
21 '8870091ef70b5ea18b18bfcc770f8bda7dcd9d7cc2cc4fe5e4c3ac1f35bbb66a'
22 'e10f24b57582d6e2da71f7c80732a62e0ee2e3b867fe84591ccdb53e80fa92e0')
31 for _c in "${_backports[@]}"; do
32 git log --oneline -1 "${_c}"
33 git show "${_c}" -- ':(exclude)WHATS_NEW' | git apply
36 # prepare for non-systemd initcpio
37 patch -Np1 --output='udev/69-dm-lvm-initcpio.rules.in' < ../0001-udev-initcpio.patch
39 # remove install section from systemd units that are enabled by default
40 sed -i -e '/^\[Install\]$/,$d' \
41 scripts/dm_event_systemd_red_hat.socket.in \
42 scripts/lvm2_lvmpolld_systemd_red_hat.socket.in \
43 scripts/lvm2_monitoring_systemd_red_hat.service.in
47 # build system requires bash:
48 # https://www.redhat.com/archives/linux-lvm/2020-January/msg00004.html
49 # https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html
50 export CONFIG_SHELL=/bin/bash
55 CONFIG_SHELL=/bin/bash \
59 --localstatedir=/var \
67 --enable-write_install \
68 --with-cache=internal \
69 --with-default-dm-run-dir=/run \
70 --with-default-locking-dir=/run/lock/lvm \
71 --with-default-pid-dir=/run \
72 --with-default-run-dir=/run/lvm \
73 --with-systemdsystemunitdir=/usr/lib/systemd/system \
74 --with-thin=internal \
75 --with-udev-prefix=/usr
78 make -C udev/ 69-dm-lvm-initcpio.rules
81 package_device-mapper() {
82 pkgdesc="Device mapper userspace library and tools"
83 url="http://sourceware.org/dm/"
84 depends=('glibc' 'systemd-libs' 'libudev.so')
85 provides=('libdevmapper.so'
86 'libdevmapper-event.so')
90 make DESTDIR="${pkgdir}" install_device-mapper
91 # extra udev rule for device-mapper in initramfs
92 install -D -m0644 "${srcdir}/11-dm-initramfs.rules" "${pkgdir}/usr/lib/initcpio/udev/11-dm-initramfs.rules"
93 # Install dmeventd socket and service
94 make DESTDIR="${pkgdir}" install_systemd_units
95 rm -f "${pkgdir}/usr/lib/systemd/system/"{blk-availability.service,lvm2-*}
96 install -d -m0755 "${pkgdir}/usr/lib/systemd/system/sockets.target.wants"
97 ln -sf ../dm-event.socket "${pkgdir}/usr/lib/systemd/system/sockets.target.wants/dm-event.socket"
101 pkgdesc="Logical Volume Manager 2 utilities"
102 depends=('bash' "device-mapper>=${pkgver}" 'systemd-libs'
103 'libudev.so' 'util-linux-libs' 'libblkid.so' 'readline' 'libreadline.so'
104 'thin-provisioning-tools' 'libaio' 'libaio.so')
105 conflicts=('lvm' 'mkinitcpio<0.7')
106 backup=('etc/lvm/lvm.conf'
107 'etc/lvm/lvmlocal.conf')
111 make DESTDIR="${pkgdir}" install_lvm2
113 install -d "${pkgdir}"/etc/lvm/{archive,backup}
115 install -D -m0644 "${srcdir}/lvm2_install" "${pkgdir}/usr/lib/initcpio/install/lvm2"
116 ln -s lvm2 "${pkgdir}/usr/lib/initcpio/install/sd-lvm2"
117 # extra udev rule for non-systemd initramfs
118 install -D -m0644 udev/69-dm-lvm-initcpio.rules "${pkgdir}/usr/lib/initcpio/udev/69-dm-lvm.rules"
120 make DESTDIR="${pkgdir}" install_systemd_units
121 rm -f "${pkgdir}/usr/lib/systemd/system/"dm-*
122 install -d -m0755 "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants"
123 ln -sf ../lvm2-lvmpolld.socket "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants/lvm2-lvmpolld.socket"
124 ln -sf ../lvm2-monitor.service "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants/lvm2-monitor.service"
125 make DESTDIR="${pkgdir}" install_systemd_generators