archrelease: copy trunk to staging-x86_64
[arch-packages.git] / lvm2 / trunk / PKGBUILD
blob93d97c134d917b8e847e5a416c077b2e3171f75b
1 # Maintainer: Eric Bélanger <eric@archlinux.org>
2 # Maintainer: Thomas Bächler <thomas@archlinux.org>
4 pkgbase=lvm2
5 pkgname=('lvm2' 'device-mapper')
6 _tag='a6c8d2429ce4d4a13750f271987702d3e2648904' # git rev-parse v${pkgver//./_}
7 pkgver=2.03.21
8 pkgrel=1
9 arch=('x86_64')
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'
17         'lvm2_install'
18         '11-dm-initramfs.rules')
19 sha256sums=('SKIP'
20             '2b3a16ec05e2bc6678e9ebd5ffa8319ebfde29aa260ce004f79f9b8df57d73c9'
21             '8870091ef70b5ea18b18bfcc770f8bda7dcd9d7cc2cc4fe5e4c3ac1f35bbb66a'
22             'e10f24b57582d6e2da71f7c80732a62e0ee2e3b867fe84591ccdb53e80fa92e0')
24 _backports=(
27 prepare() {
28   cd lvm2/
30   local _c
31   for _c in "${_backports[@]}"; do
32     git log --oneline -1 "${_c}"
33     git show "${_c}" -- ':(exclude)WHATS_NEW' | git apply
34   done
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
46 build() {
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
52   cd lvm2/
54   ./configure \
55     CONFIG_SHELL=/bin/bash \
56     --prefix=/usr \
57     --sbindir=/usr/bin \
58     --sysconfdir=/etc \
59     --localstatedir=/var \
60     --enable-cmdlib \
61     --enable-dmeventd \
62     --enable-lvmpolld \
63     --enable-pkgconfig \
64     --enable-readline \
65     --enable-udev_rules \
66     --enable-udev_sync \
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
76   make
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')
88   cd lvm2/
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"
100 package_lvm2() {
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')
109   cd lvm2/
111   make DESTDIR="${pkgdir}" install_lvm2
112   # /etc directories
113   install -d "${pkgdir}"/etc/lvm/{archive,backup}
114   # mkinitcpio hook
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"
119   # systemd support
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