Some devices may not have subsystem symlinks, therefore we cannot rely
on that to check if device is valid. Instead, check uevent file which
should be always present in valid device.
Reference: https://github.com/openwrt/openwrt/issues/12350
One of the problems with udev is that systemd cannot be built
statically[1]. With libudev-zero, on the other hand, no code changes
are required to be able to do a static-only build, only Makefile
changes.
With this change, it's possible to "make install-static" to do a
static-only build of libudev-zero.
[1]: https://github.com/systemd/systemd/pull/20621#issuecomment-912014839
Bitwise AND operation can produce value that may be larger than
test_bit() return value. Convert result to bool using `!!` to
avoid integer overflow.
Fixes: #33
Current libudev-zero source code doesn't have license information in source files.
This patch add license information to source files based on SPDX standard.
Currently, "-soname" set at "libudev.so.1", but building library file name was "libudev.so".
Typical shared library structure as a follow;
libudev.so -> libudev.so.1
libudev.so.1
Current installation is reversed.
This patch fix this.
Ubuntu/Debian style file placement are ;
No.1 libudev.so and libudev.so.1 in /lib or /lib/arch/
No.2 libudev.h in /usr/include
No.3 libudev.pc in /usr/lib/pkgconfig or /usr/lib/arch/pkgconfig
Current Makefile can install No.1 and No.2 pattern by
"make PREFIX=/usr LIBDIR=/lib INCLUDEDIR=/usr/include install",
but it can't install No.3 pattern.
This patch added PKGCONFIGDIR environment variable to achieve all install pattern by
"make PREFIX=/usr LIBDIR=/lib INCLUDEDIR=/usr/include PKGCONFIGDIR=/usr/lib install"