Created attachment 442744 [details, diff] networkmanager-1.2.4.ebuild diff Making check in examples make[1]: Entering directory '/var/tmp/portage/net-misc/networkmanager-1.2.4/work/NetworkManager-1.2.4-abi_x86_64.amd64/examples' make[1]: *** No rule to make target 'check'. Stop. make[1]: Leaving directory '/var/tmp/portage/net-misc/networkmanager-1.2.4/work/NetworkManager-1.2.4-abi_x86_64.amd64/examples' make: *** [Makefile:646: check-recursive] Error 1 The test suite fails because https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66de663c48186cb4143dce52791656f79744f3d9 adds no target check to the makefile. The solution is simple: --- networkmanager-1.2.4.ebuild +++ networkmanager-1.2.4.ebuild @@ -212,8 +212,9 @@ # Disable examples cat > examples/Makefile <<-EOF - .PHONY: all install + .PHONY: all check install all: + check: install: EOF }
commit 0a0d8e884dae8b651662922a3c04922ae5edcbf3 Author: Mike Gilbert <floppym@gentoo.org> Date: Sun Aug 7 21:13:58 2016 -0400 net-misc/networkmanager: add 'check' target to stub Makefile Patch by tka. Bug: https://bugs.gentoo.org/590718 Package-Manager: portage-2.3.0_p16 net-misc/networkmanager/networkmanager-1.2.4.ebuild | 3 ++-
Why are we disabling the examples in this way since 1.2.4?
Also doing this: # Remove any empty directories find "${D}" -type d -empty -delete || die Looks to me like a bit risky... how can we know that we are not removing any directory that could be needed in the future?
(In reply to Pacho Ramos from comment #2) > Why are we disabling the examples in this way since 1.2.4? I think it will less error-prone than the sed applied to Makefile.in. See bug 590432 comment 10.
(In reply to Pacho Ramos from comment #3) > Also doing this: > # Remove any empty directories > find "${D}" -type d -empty -delete || die > > Looks to me like a bit risky... how can we know that we are not removing any > directory that could be needed in the future? ebuilds should not install ANY empty directory. If other packages install things under the same path, and then get unmerged, they will end up removing the empty directory. For volatile directories, the solution is to create them at runtime. For non-volatile directories, keepdir can be used to create a dummy dotfile if necessary. Anyway, I replaced the find call with the following, which is abit more effecient. # Remove empty /run/NetworkManager rmdir "${D}"/run/NetworkManager "${D}"/run || die
(In reply to Mike Gilbert from comment #5) > ebuilds should not install ANY empty directory. If other packages install > things under the same path, and then get unmerged, they will end up removing > the empty directory. > Yeah, but I was checking about other ebuilds in the tree and they are all trying to only remove some concrete and known empty dirs instead of all... then, I was wondering if that would be a problem (if not, maybe it would belong to the new EAPI to stop us from needing to randomly run this cleaning on multiple ebuilds) > For volatile directories, the solution is to create them at runtime. For > non-volatile directories, keepdir can be used to create a dummy dotfile if > necessary. > > Anyway, I replaced the find call with the following, which is abit more > effecient. > > # Remove empty /run/NetworkManager > rmdir "${D}"/run/NetworkManager "${D}"/run || die Nice thanks :) For this case I guess I could report to upstream as it looks NM is creating the dirs when needed at start time (without even relying on tmpfiles.d), then, creating the files at make install time is not really needed. For other stuff relying on tmpfiles.d... I have always wondered what will happen when we don't install that directories if someone tries to start the service. In other distributions that is not a problem because they have hooks for running "systemd-tmpfiles --create" after the installation... but that is not the case of Gentoo :/
(In reply to Mike Gilbert from comment #4) > (In reply to Pacho Ramos from comment #2) > > Why are we disabling the examples in this way since 1.2.4? > > I think it will less error-prone than the sed applied to Makefile.in. See > bug 590432 comment 10. Ah, ok... maybe I could try to suggest to upstream to add a --without-examples option like many other packages do for not needing to carry this forever ;)