Merge branch 'feat/tmpfiles_for_var' into 'master'

Use systemd-tmpfiles for creating /var directories on systemd systems

See merge request pacman/pacman!140
This commit is contained in:
Max Gautier 2025-08-02 22:38:35 +00:00
commit d7748d32fe
2 changed files with 18 additions and 3 deletions

View file

@ -448,9 +448,20 @@ install_data(
'proto/proto.install',
install_dir : join_paths(DATAROOTDIR, 'pacman'))
foreach path : [
systemd = dependency('systemd', required: false)
if systemd.found()
install_data('tmpfiles.conf',
rename: 'pacman.conf',
install_dir: systemd.get_variable(pkgconfig: 'tmpfilesdir'))
var_paths = []
else
var_paths = [
join_paths(LOCALSTATEDIR, 'lib/pacman/'),
join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/'),
]
endif
foreach path : var_paths + [
join_paths(DATAROOTDIR, 'makepkg-template/'),
join_paths(DATAROOTDIR, 'libalpm/hooks/'),
]

4
tmpfiles.conf Normal file
View file

@ -0,0 +1,4 @@
# Setup pacman data and cache directories
d %S/pacman
d %C/pacman/pkg