PKGBUILD 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # Maintainer: Eric Bélanger <eric@archlinux.org>
  2. # Maintainer: Thomas Bächler <thomas@archlinux.org>
  3. pkgbase=lvm2
  4. pkgname=('lvm2' 'device-mapper')
  5. pkgver=2.02.181
  6. pkgrel=1
  7. arch=(x86_64 ppc64le)
  8. url='https://sourceware.org/lvm2/'
  9. license=('GPL2' 'LGPL2.1')
  10. makedepends=('git' 'systemd' 'thin-provisioning-tools')
  11. groups=('base')
  12. validpgpkeys=('88437EF5C077BD113D3B7224228191C1567E2C17' # Alasdair G Kergon <agk@redhat.com>
  13. 'D501A478440AE2FD130A1BE8B9112431E509039F') # Marian Csontos <marian.csontos@gmail.com>
  14. source=("git+https://sourceware.org/git/lvm2.git#tag=v${pkgver//./_}?signed"
  15. 'lvm2_install'
  16. 'lvm2_hook'
  17. 'sd-lvm2_install'
  18. '11-dm-initramfs.rules')
  19. sha256sums=('SKIP'
  20. 'cc51940a8437f3c8339bb9cec7e929b2cc0852ffc8a0b2463e6f67ca2b9950f6'
  21. '97d7c92e4954bc0108e7cd183b2eb5fe7ecc97e6f56369669e6537cb6ed45d80'
  22. 'b749c2da0e9307b0c2c3858d024a19c268e01e393e876a284fe1a302427f72f1'
  23. 'e10f24b57582d6e2da71f7c80732a62e0ee2e3b867fe84591ccdb53e80fa92e0')
  24. prepare() {
  25. cd lvm2/
  26. # remove install section from systemd units that are enabled by default
  27. sed -i -e '/^\[Install\]$/,$d' \
  28. scripts/dm_event_systemd_red_hat.socket.in \
  29. scripts/lvm2_lvmetad_systemd_red_hat.socket.in \
  30. scripts/lvm2_lvmpolld_systemd_red_hat.socket.in \
  31. scripts/lvm2_monitoring_systemd_red_hat.service.in
  32. }
  33. build() {
  34. local _CONFIGUREOPTS=(
  35. --prefix=/usr
  36. --sbindir=/usr/bin
  37. --sysconfdir=/etc
  38. --localstatedir=/var
  39. --enable-applib
  40. --enable-cmdlib
  41. --enable-dmeventd
  42. --enable-lvmetad
  43. --enable-lvmpolld
  44. --enable-pkgconfig
  45. --enable-readline
  46. --enable-udev_rules
  47. --enable-udev_sync
  48. --enable-use-lvmetad
  49. --with-cache=internal
  50. --with-default-dm-run-dir=/run
  51. --with-default-locking-dir=/run/lock/lvm
  52. --with-default-pid-dir=/run
  53. --with-default-run-dir=/run/lvm
  54. --with-systemdsystemunitdir=/usr/lib/systemd/system
  55. --with-thin=internal
  56. --with-udev-prefix=/usr
  57. )
  58. cp -a lvm2/ lvm2-initramfs/
  59. cd lvm2/
  60. ./configure "${_CONFIGUREOPTS[@]}" --enable-udev-systemd-background-jobs
  61. make
  62. # Build legacy udev rule for initramfs
  63. cd ../lvm2-initramfs
  64. ./configure "${_CONFIGUREOPTS[@]}" --enable-udev-systemd-background-jobs=no
  65. cd udev
  66. make 69-dm-lvm-metad.rules
  67. }
  68. package_device-mapper() {
  69. pkgdesc="Device mapper userspace library and tools"
  70. url="http://sourceware.org/dm/"
  71. depends=('glibc' 'libsystemd')
  72. cd lvm2/
  73. make DESTDIR="${pkgdir}" install_device-mapper
  74. # extra udev rule for device-mapper in initramfs
  75. install -D -m644 "${srcdir}/11-dm-initramfs.rules" "${pkgdir}/usr/lib/initcpio/udev/11-dm-initramfs.rules"
  76. # Install dmeventd socket and service
  77. make DESTDIR="${pkgdir}" install_systemd_units
  78. rm -f "${pkgdir}/usr/lib/systemd/system/"{blk-availability.service,lvm2-*}
  79. install -d -m755 "${pkgdir}/usr/lib/systemd/system/sockets.target.wants"
  80. ln -sf ../dm-event.socket "${pkgdir}/usr/lib/systemd/system/sockets.target.wants/dm-event.socket"
  81. }
  82. package_lvm2() {
  83. pkgdesc="Logical Volume Manager 2 utilities"
  84. depends=('bash' "device-mapper>=${pkgver}" 'libsystemd' 'libutil-linux' 'readline' 'thin-provisioning-tools')
  85. conflicts=('lvm' 'mkinitcpio<0.7')
  86. backup=('etc/lvm/lvm.conf'
  87. 'etc/lvm/lvmlocal.conf')
  88. options=('!makeflags')
  89. install=lvm2.install
  90. cd lvm2/
  91. make DESTDIR="${pkgdir}" install_lvm2
  92. # install applib
  93. make -C liblvm DESTDIR="${pkgdir}" install
  94. # /etc directories
  95. install -d "${pkgdir}"/etc/lvm/{archive,backup}
  96. # mkinitcpio hook
  97. install -D -m644 "${srcdir}/lvm2_hook" "${pkgdir}/usr/lib/initcpio/hooks/lvm2"
  98. install -D -m644 "${srcdir}/lvm2_install" "${pkgdir}/usr/lib/initcpio/install/lvm2"
  99. install -D -m644 "${srcdir}/sd-lvm2_install" "${pkgdir}/usr/lib/initcpio/install/sd-lvm2"
  100. # extra udev rule for lvmetad in non-systemd initramfs
  101. install -D -m644 "${srcdir}/lvm2-initramfs/udev/69-dm-lvm-metad.rules" "${pkgdir}/usr/lib/initcpio/udev/69-dm-lvm-metad.rules"
  102. # systemd support
  103. make DESTDIR="${pkgdir}" install_systemd_units
  104. rm -f "${pkgdir}/usr/lib/systemd/system/"dm-*
  105. install -d -m755 "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants"
  106. ln -sf ../lvm2-lvmetad.socket "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants/lvm2-lvmetad.socket"
  107. ln -sf ../lvm2-lvmpolld.socket "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants/lvm2-lvmpolld.socket"
  108. ln -sf ../lvm2-monitor.service "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants/lvm2-monitor.service"
  109. make DESTDIR="${pkgdir}" install_systemd_generators
  110. }