PKGBUILD 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. # Maintainer (artix): Artoo <artoo@artixlinux.org>
  3. # Contributor: Christian Hesse <mail@eworm.de>
  4. # Contributor: Dave Reisner <dreisner@archlinux.org>
  5. # Contributor: Tom Gundersen <teg@jklm.no>
  6. _pkgbase=systemd-stable
  7. pkgbase=udev
  8. pkgname=('udev' 'libudev' 'esysusers' 'etmpfiles')
  9. pkgdesc='Userspace device file manager'
  10. _tag='b16ce4c7ab80665b65345ea030c51a5c758fe66b' # git rev-parse v${_tag_name}
  11. _tag_name=252.5
  12. pkgver="${_tag_name/-/}"
  13. pkgrel=1
  14. arch=('x86_64')
  15. arch+=('i686' 'armv7h')
  16. url='https://www.github.com/systemd/systemd'
  17. license=('GPL2' 'LGPL2.1')
  18. makedepends=('acl' 'kmod' 'util-linux' 'hwdata' 'libcap' 'kbd' 'gperf'
  19. 'intltool' 'git' 'meson' 'docbook-xsl' 'rsync' 'python-jinja')
  20. options=('strip')
  21. validpgpkeys=('63CDA1E5D3FC22B998D20DD6327F26951A015CC4' # Lennart Poettering <lennart@poettering.net>
  22. 'A9EA9081724FFAE0484C35A1A81CEA22BC8C7E2E' # Luca Boccassi <luca.boccassi@gmail.com>
  23. '9A774DB5DB996C154EBBFBFDA0099A18E29326E1' # Yu Watanabe <watanabe.yu+github@gmail.com>
  24. '5C251B5FC54EB2F80F407AAAC54CA336CFEB557E') # Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
  25. _alpm=57bcc7fee22d75df96fd546ee7215166cdfb1233
  26. source=("git+https://github.com/systemd/systemd-stable#tag=${_tag}" #?signed
  27. "git+https://github.com/systemd/systemd#tag=v${_tag_name%.*}" #?signed
  28. '0001-Use-Arch-Linux-device-access-groups.patch'
  29. initcpio-{hook,install}-udev
  30. "git+https://gitea.artixlinux.org/artix/alpm-hooks.git#commit=${_alpm}"
  31. meson-install-tags.patch
  32. meson-artix.patch
  33. udev-log-msg.patch)
  34. sha512sums=('SKIP'
  35. 'SKIP'
  36. 'f26db75129f1f9a7b7235d77e4ec490864fa0a203431f515873443b227da3db7034d8d81f7974f23fc6fbeaa91727244ac8ab82762f02e87fb92ea19a6bd931f'
  37. '32606b42856b5f3ea7f485143e532671f58986237e14c58ea5ab17383dc39a375cb6c738c8a2db9e4a8c8be88ea44a876d6bbed129cb2f5c9aa3f8228b04d927'
  38. '38eed28d42ac8f70bc8d1058ace35f137f7f5c972442ee14b98c2146202e0615aa584304edbd59e8608d1b6bec3cb391fc69b25393740f6eabd8fc5ad3bde64f'
  39. 'SKIP'
  40. 'e936a4b245400140d2cb4ed250fe23639bc3aaf81fb958b9b10dc1ff5aeb094f37b657e044bf35e832fd4a69dccea5b19ef45d20852ce3aa49325ae2e59d8f51'
  41. 'a26003ddcac5a83ec1fec040b36ff46816869028dc79aebb2646f9f2ed090e6358601f911c9d6a04b426c7f3367595e12716e411fca34ffce59d718b067e4e5c'
  42. '268817ee63ca0b03d2a10bb952837052c1fa80a5d2f0fe933d2aa3d61a09d286f188a6358107114964930fcef7057392f9520f875a83f6e265d2f4bc2564c26e')
  43. _backports=(
  44. )
  45. _reverts=(
  46. )
  47. prepare() {
  48. cd "$_pkgbase"
  49. # add upstream repository for cherry-picking
  50. git remote add -f upstream ../systemd
  51. local _c
  52. for _c in "${_backports[@]}"; do
  53. git log --oneline -1 "${_c}"
  54. git cherry-pick -n "${_c}"
  55. done
  56. for _c in "${_reverts[@]}"; do
  57. git log --oneline -1 "${_c}"
  58. git revert -n "${_c}"
  59. done
  60. patch -Np1 -i ../meson-install-tags.patch
  61. patch -Np1 -i ../meson-artix.patch
  62. patch -Np1 -i ../udev-log-msg.patch
  63. # Replace cdrom/dialout/tape groups with optical/uucp/storage
  64. patch -Np1 -i ../0001-Use-Arch-Linux-device-access-groups.patch
  65. }
  66. build() {
  67. local _meson_options=()
  68. _meson_options+=(
  69. -Dversion-tag="${_tag_name/-/\~}-${pkgrel}-parabola"
  70. -Dshared-lib-tag="${pkgver}-${pkgrel}"
  71. -Dmode=release
  72. -Dstandalone-binaries=true
  73. -Dsysusers=true
  74. -Dtmpfiles=true
  75. -Dhwdb=true
  76. -Dblkid=true
  77. -Dgshadow=true
  78. -Dinstall-sysconfdir-standalone=true
  79. -Ddefault-udevd-symlink='udevd'
  80. -Ddefault-udevd-dir='/usr/bin'
  81. -Dsbat-distro='artix'
  82. -Dsbat-distro-summary='Artix Linux'
  83. -Dsbat-distro-pkgname="${pkgname}"
  84. -Dsbat-distro-version="${pkgver}"
  85. -Dtests=true
  86. -Dlink-udev-shared=false
  87. -Dlink-boot-shared=false
  88. -Dman=false
  89. -Ddns-servers=''
  90. -Dntp-servers=''
  91. -Defi=false
  92. -Dsysvinit-path=
  93. -Ddefault-dnssec=no
  94. -Dadm-group=false
  95. -Danalyze=false
  96. -Dapparmor=false
  97. -Daudit=false
  98. -Dbacklight=false
  99. -Dbinfmt=false
  100. -Dbzip2=false
  101. -Dcoredump=false
  102. -Ddbus=false
  103. -Delfutils=false
  104. -Denvironment-d=false
  105. -Dfdisk=false
  106. -Dgcrypt=false
  107. -Dglib=false
  108. -Dgnutls=false
  109. -Dhibernate=false
  110. -Dhostnamed=false
  111. -Didn=false
  112. -Dima=false
  113. -Dinitrd=false
  114. -Dfirstboot=false
  115. -Dkernel-install=false
  116. -Dldconfig=false
  117. -Dlibcryptsetup=false
  118. -Dlibcurl=false
  119. -Dlibfido2=false
  120. -Dlibidn=false
  121. -Dlibidn2=false
  122. -Dlibiptc=false
  123. -Dlocaled=false
  124. -Dlogind=false
  125. -Dlz4=false
  126. -Dmachined=false
  127. -Dmicrohttpd=false
  128. -Dnetworkd=false
  129. -Dnscd=false
  130. -Dnss-myhostname=false
  131. -Dnss-resolve=false
  132. -Dnss-systemd=false
  133. -Doomd=false
  134. -Dopenssl=false
  135. -Dp11kit=false
  136. -Dpam=false
  137. -Dpcre2=false
  138. -Dpolkit=false
  139. -Dportabled=false
  140. -Dpstore=false
  141. -Dpwquality=false
  142. -Drandomseed=false
  143. -Dresolve=false
  144. -Drfkill=false
  145. -Dseccomp=false
  146. -Dsmack=false
  147. -Dsysext=false
  148. -Dtimedated=false
  149. -Dtimesyncd=false
  150. -Dtpm=false
  151. -Dqrencode=false
  152. -Dquotacheck=false
  153. -Duserdb=false
  154. -Dutmp=false
  155. -Dvconsole=false
  156. -Dwheel-group=false
  157. -Dxdg-autostart=false
  158. -Dxkbcommon=false
  159. -Dxz=false
  160. -Dzlib=false
  161. -Dzstd=false
  162. )
  163. artix-meson "$_pkgbase" build "${_meson_options[@]}"
  164. local _targets=()
  165. _targets+=(
  166. udev:shared_library
  167. src/libudev/libudev.pc
  168. udevadm
  169. systemd-hwdb
  170. src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,dmi_memory_id,scsi_id,v4l_id}
  171. src/udev/udev.pc
  172. rules.d/{50-udev-default,64-btrfs}.rules
  173. hwdb.d/60-autosuspend-chromiumos.hwdb
  174. man/{libudev.3,udev.conf.5,hwdb.7,udev.7,udevadm.8}
  175. systemd-{sysusers,tmpfiles}.standalone
  176. sysusers.d/basic.conf
  177. tmpfiles.d/{etc,static-nodes-permissions,var}.conf
  178. man/{sysusers,tmpfiles}.d.5
  179. man/systemd-{sysusers,tmpfiles}.8
  180. factory/templates/locale.conf
  181. systemd-detect-virt
  182. test/sys
  183. test-udev
  184. test-fido-id-desc
  185. test-udev-builtin
  186. test-udev-event
  187. test-udev-node
  188. test-udev-util
  189. systemd-runtest.env
  190. test-tmpfiles
  191. )
  192. meson compile -C build "${_targets[@]}"
  193. }
  194. check() {
  195. local tests=()
  196. tests+=(
  197. test-sysusers.standalone
  198. test-systemd-tmpfiles.standalone
  199. test-tmpfiles
  200. rule-syntax-check
  201. test-fido-id-desc
  202. test-udev-builtin
  203. test-udev-event
  204. test-udev-node
  205. test-udev-util
  206. # udev-test
  207. test-libudev
  208. test-libudev-sym
  209. test-udev-device-thread
  210. )
  211. meson test -C build --print-errorlogs "${tests[@]}"
  212. }
  213. _inst_doc(){
  214. install -d "${pkgdir}"/usr/share/doc/"${pkgname}"
  215. install -vm644 "$_pkgbase"/LICENSE.* "${pkgdir}"/usr/share/doc/"${pkgname}"
  216. }
  217. _inst_man_udev() {
  218. local x="$1" y=${1##*.}
  219. install -d "${pkgdir}"/usr/share/man/man"$y"
  220. install -vm644 build/man/"$x" "${pkgdir}"/usr/share/man/man"$y"
  221. }
  222. _inst_man_utils() {
  223. local u="$1"
  224. install -d "${pkgdir}"/usr/share/man/man{5,8}
  225. install -vm644 build/man/"$u".d.5 "${pkgdir}"/usr/share/man/man5
  226. install -vm644 build/man/systemd-"$u".8 "${pkgdir}"/usr/share/man/man8/"$u".8
  227. }
  228. package_udev() {
  229. pkgdesc='Userspace device file manager'
  230. depends=('acl' 'libacl.so' 'kmod' 'libkmod.so'
  231. 'util-linux' 'libblkid.so' 'libudev' 'hwdata' 'kbd')
  232. provides=("udev=$pkgver")
  233. provides+=('eudev')
  234. replaces=('eudev')
  235. meson install -C build --destdir "$pkgdir" --no-rebuild --tags udev,udev-devel,libudev-devel
  236. mv -v "${pkgdir}"/usr/bin/systemd-hwdb "${pkgdir}"/usr/bin/udev-hwdb
  237. for m in libudev.3 udev.conf.5 udev.7 udevadm.8; do
  238. _inst_man_udev "$m"
  239. done
  240. _inst_doc
  241. # initcpio
  242. install -vD -m0644 initcpio-install-udev "${pkgdir}"/usr/lib/initcpio/install/udev
  243. install -vD -m0644 initcpio-hook-udev "${pkgdir}"/usr/lib/initcpio/hooks/udev
  244. # pacman hooks
  245. make -C alpm-hooks DESTDIR="${pkgdir}" install_udev
  246. }
  247. package_libudev() {
  248. pkgdesc='udev library for enumerating and introspecting local devices'
  249. depends=('gcc-libs')
  250. provides=('libudev.so')
  251. provides+=(''libeudev')
  252. replaces=('libeudev')
  253. meson install -C build --destdir "$pkgdir" --no-rebuild --tags libudev
  254. }
  255. package_esysusers() {
  256. pkgdesc='the sysusers.d binary'
  257. groups=('base-devel')
  258. depends=('gcc-libs' 'libxcrypt')
  259. meson install -C build --destdir "$pkgdir" --no-rebuild --tags sysusers
  260. mv -v "${pkgdir}"/usr/bin/systemd-sysusers.standalone "${pkgdir}"/usr/bin/sysusers
  261. _inst_man_utils sysusers
  262. _inst_doc
  263. # pacman hooks
  264. make -C alpm-hooks DESTDIR="${pkgdir}" install_sysusers
  265. }
  266. package_etmpfiles() {
  267. pkgdesc='the tmpfiles.d binary'
  268. groups=('base-devel')
  269. depends=('acl' 'libacl.so' 'libcap' 'libcap.so')
  270. meson install -C build --destdir "$pkgdir" --no-rebuild --tags tmpfiles
  271. mv -v "${pkgdir}"/usr/bin/systemd-tmpfiles.standalone "${pkgdir}"/usr/bin/tmpfiles
  272. _inst_man_utils tmpfiles
  273. _inst_doc
  274. # pacman hooks
  275. make -C alpm-hooks DESTDIR="${pkgdir}" install_tmpfiles
  276. }