ganto / copr-lxd

RPM spec files for building lxd on Fedora COPR
MIT License
9 stars 2 forks source link

[rpmlint] lxd.spec:440: E: hardcoded-library-path in /usr/lib/%{name} #11

Closed ganto closed 6 years ago

ganto commented 6 years ago

When running rpmlint (rpmlint-1.10-5.fc26.noarch) on the current lxd.spec (for lxd-2.21-1), the following errors are printed:

lxd.spec:337: E: hardcoded-library-path in %{buildroot}/usr/lib/%{name}
A library path is hardcoded to one of the following paths: /lib, /usr/lib. It
should be replaced by something like /%{_lib} or %{_libdir}.

lxd.spec:338: E: hardcoded-library-path in %{buildroot}/usr/lib/%{name}/shutdown
A library path is hardcoded to one of the following paths: /lib, /usr/lib. It
should be replaced by something like /%{_lib} or %{_libdir}.

lxd.spec:440: E: hardcoded-library-path in /usr/lib/%{name}
A library path is hardcoded to one of the following paths: /lib, /usr/lib. It
should be replaced by something like /%{_lib} or %{_libdir}.

lxd.spec:441: E: hardcoded-library-path in /usr/lib/%{name}/*
A library path is hardcoded to one of the following paths: /lib, /usr/lib. It
should be replaced by something like /%{_lib} or %{_libdir}.

0 packages and 1 specfiles checked; 4 errors, 0 warnings.

The origin of this is the shutdown helper script /usr/lib/lxd/shutdown (used by lxd-containers.service) which is installed into an arch-independent library path. The current packaging copies the structure of the Ubuntu package.

Not sure yet, where this would belong according to FHS. Maybe /usr/libexec/lxd-shutdown?

Conan-Kudo commented 6 years ago

It would belong in /usr/libexec/lxd/shutdown. It's worth talking to upstream about supporting /usr/libexec (the libexecdir used on RH/Fedora/Mageia, BSD, and MacOS) as an alternate for /usr/lib (which Debian uses for libexecdir).

ganto commented 6 years ago

Thanks for your input. The affected files are not part of the upstream lxd release but are copied from the Ubuntu package and defined as additional package sources in the spec file. I'll therefore simply adjust the path as it fits for Fedora.

ganto commented 6 years ago

Issue fixed with e02f98fb879bc63194b2f1f3bffee46330937208 and released in lxd-2.21-2