Skip to contentSkip to conversation

libcap: Add optional support for libattr capabilities

Buildroot Peter Korsgaard 2 participants 6 messages Mar 19, 2013

lore
Share & tools
lore
#0 lore raw

commit: http://git.buildroot.net/buildroot/commit/?id=1bf3d6f8cf3a2dca9ce1c6f3e68b077724f21db6
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

libcap can optionally link to libattr to support extra file capabilities. Link to this library and pull it as dependency if BR2_PACKAGE_ATTR is selected.

[Peter: use LIBCAP_ prefix on variable]
---
 package/libcap/libcap.mk |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
package/libcap/libcap.mk +13 -5
index dcd3a18..6adac73 100644
@@ -15,19 +15,27 @@ LIBCAP_LICENSE_FILES = License
 LIBCAP_DEPENDENCIES = host-libcap
 LIBCAP_INSTALL_STAGING = YES
 
+ifeq ($(BR2_PACKAGE_ATTR),y)
+	LIBCAP_DEPENDENCIES += attr
+	LIBCAP_HAVE_LIBATTR = yes
+else
+	LIBCAP_HAVE_LIBATTR = no
+endif
+
 define LIBCAP_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-		LIBATTR=no BUILD_CC="$(HOSTCC)" BUILD_CFLAGS="$(HOST_CFLAGS)"
+		LIBATTR=$(LIBCAP_HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" \
+		BUILD_CFLAGS="$(HOST_CFLAGS)"
 endef
 
 define LIBCAP_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(STAGING_DIR) \
-		prefix=/usr lib=lib install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+		DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib install
 endef
 
 define LIBCAP_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(TARGET_DIR) \
-		prefix=/usr lib=lib install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+		DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib install
 endef
 
 # progs use fork()
#1 lore raw
Quoted 51 lines · Peter Korsgaard

commit: http://git.buildroot.net/buildroot/commit/?id=1bf3d6f8cf3a2dca9ce1c6f3e68b077724f21db6
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

libcap can optionally link to libattr to support extra file capabilities. Link to this library and pull it as dependency if BR2_PACKAGE_ATTR is selected.

[Peter: use LIBCAP_ prefix on variable]
---
 package/libcap/libcap.mk |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
package/libcap/libcap.mk +13 -5
index dcd3a18..6adac73 100644
@@ -15,19 +15,27 @@ LIBCAP_LICENSE_FILES = License
 LIBCAP_DEPENDENCIES = host-libcap
 LIBCAP_INSTALL_STAGING = YES
 
+ifeq ($(BR2_PACKAGE_ATTR),y)
+       LIBCAP_DEPENDENCIES += attr
+       LIBCAP_HAVE_LIBATTR = yes
+else
+       LIBCAP_HAVE_LIBATTR = no
+endif
+
 define LIBCAP_BUILD_CMDS
        $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-               LIBATTR=no BUILD_CC="$(HOSTCC)" BUILD_CFLAGS="$(HOST_CFLAGS)"
+               LIBATTR=$(LIBCAP_HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" \
+               BUILD_CFLAGS="$(HOST_CFLAGS)"
 endef
 
 define LIBCAP_INSTALL_STAGING_CMDS
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(STAGING_DIR) \
-               prefix=/usr lib=lib install
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+               DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib install
 endef
 
 define LIBCAP_INSTALL_TARGET_CMDS
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(TARGET_DIR) \
-               prefix=/usr lib=lib install
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+               DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib install
 endef
 
 # progs use fork()
Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Peter,

After this commit I am seeing this problem

Applying libcap-2.22-build-system.patch using patch:
patching file libcap/Makefile
patching file Make.Rules
make: *** No rule to make target host-attr', needed by host-libcap-depends'.

I am not sure what tirggers it. Any ideas? host-attr shouldn't be needed as I removed that from LIBCAP_DEPENDENCIES

Signature · 2 lines
Regards,
Markos Chandras
#2 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Markos" == Markos Chandras <[email protected]> writes:

Quoted 50 lines · Peter Korsgaard
Quoted 50 lines

commit: http://git.buildroot.net/buildroot/commit/?id=1bf3d6f8cf3a2dca9ce1c6f3e68b077724f21db6
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

libcap can optionally link to libattr to support extra file capabilities. Link to this library and pull it as dependency if BR2_PACKAGE_ATTR is selected.

[Peter: use LIBCAP_ prefix on variable]

---
package/libcap/libcap.mk | 18 +++++++++++++-----

1 files changed, 13 insertions(+), 5 deletions(-)
package/libcap/libcap.mk +0 -0
index dcd3a18..6adac73 100644
@@ -15,19 +15,27 @@ LIBCAP_LICENSE_FILES = License

LIBCAP_DEPENDENCIES = host-libcap
LIBCAP_INSTALL_STAGING = YES

package/libcap/libcap.mk +7 -0
+ifeq ($(BR2_PACKAGE_ATTR),y)
+       LIBCAP_DEPENDENCIES += attr
+       LIBCAP_HAVE_LIBATTR = yes
+else
+       LIBCAP_HAVE_LIBATTR = no
+endif
+

define LIBCAP_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \

package/libcap/libcap.mk +2 -1
-               LIBATTR=no BUILD_CC="$(HOSTCC)" BUILD_CFLAGS="$(HOST_CFLAGS)"
+               LIBATTR=$(LIBCAP_HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" \
+               BUILD_CFLAGS="$(HOST_CFLAGS)"

endef

define LIBCAP_INSTALL_STAGING_CMDS

package/libcap/libcap.mk +2 -2
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(STAGING_DIR) \
-               prefix=/usr lib=lib install
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+               DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib install

endef

define LIBCAP_INSTALL_TARGET_CMDS

package/libcap/libcap.mk +2 -2
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(TARGET_DIR) \
-               prefix=/usr lib=lib install
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+               DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib install

endef

Quoted 5 lines
Quoted 5 lines
# progs use fork()
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Markos> Peter,

Markos> After this commit I am seeing this problem

Markos> Applying libcap-2.22-build-system.patch using patch:
Markos> patching file libcap/Makefile
Markos> patching file Make.Rules
Markos> make: *** No rule to make target host-attr', needed by host-libcap-depends'.

Markos> I am not sure what tirggers it. Any ideas? host-attr shouldn't be Markos> needed as I removed that from LIBCAP_DEPENDENCIES

It's because HOST_LIBCAP_DEPENDENCIES defaults to the value of LIBCAP_DEPENDENCIES, so you need to explicitly set it to the empty string.

Didn't you see this problem with your version as well? As far as I can see it isn't caused by my rename.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw
Quoted 75 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Markos" == Markos Chandras <[email protected]> writes:

Quoted 50 lines · Peter Korsgaard
Quoted 50 lines

commit: http://git.buildroot.net/buildroot/commit/?id=1bf3d6f8cf3a2dca9ce1c6f3e68b077724f21db6
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

libcap can optionally link to libattr to support extra file capabilities. Link to this library and pull it as dependency if BR2_PACKAGE_ATTR is selected.

[Peter: use LIBCAP_ prefix on variable]

---
package/libcap/libcap.mk | 18 +++++++++++++-----

1 files changed, 13 insertions(+), 5 deletions(-)
package/libcap/libcap.mk +0 -0
index dcd3a18..6adac73 100644
@@ -15,19 +15,27 @@ LIBCAP_LICENSE_FILES = License

LIBCAP_DEPENDENCIES = host-libcap
LIBCAP_INSTALL_STAGING = YES

package/libcap/libcap.mk +7 -0
+ifeq ($(BR2_PACKAGE_ATTR),y)
+       LIBCAP_DEPENDENCIES += attr
+       LIBCAP_HAVE_LIBATTR = yes
+else
+       LIBCAP_HAVE_LIBATTR = no
+endif
+

define LIBCAP_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \

package/libcap/libcap.mk +2 -1
-               LIBATTR=no BUILD_CC="$(HOSTCC)" BUILD_CFLAGS="$(HOST_CFLAGS)"
+               LIBATTR=$(LIBCAP_HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" \
+               BUILD_CFLAGS="$(HOST_CFLAGS)"

endef

define LIBCAP_INSTALL_STAGING_CMDS

package/libcap/libcap.mk +2 -2
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(STAGING_DIR) \
-               prefix=/usr lib=lib install
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+               DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib install

endef

define LIBCAP_INSTALL_TARGET_CMDS

package/libcap/libcap.mk +2 -2
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(TARGET_DIR) \
-               prefix=/usr lib=lib install
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+               DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib install

endef

Quoted 5 lines
Quoted 5 lines
# progs use fork()
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Markos> Peter,

Markos> After this commit I am seeing this problem

Markos> Applying libcap-2.22-build-system.patch using patch:
Markos> patching file libcap/Makefile
Markos> patching file Make.Rules
Markos> make: *** No rule to make target host-attr', needed by host-libcap-depends'.

Markos> I am not sure what tirggers it. Any ideas? host-attr shouldn't be Markos> needed as I removed that from LIBCAP_DEPENDENCIES

It's because HOST_LIBCAP_DEPENDENCIES defaults to the value of LIBCAP_DEPENDENCIES, so you need to explicitly set it to the empty string.

Quoted 5 lines

Didn't you see this problem with your version as well? As far as I can see it isn't caused by my rename.

--
Bye, Peter Korsgaard

Right, ok we replied at the same time. I don't remember getting this problem with my version and I did multiple tests which is very weird. Do you want me to send a follow-up patch or could you fix this yourself?

Signature · 2 lines
Regards,
Markos Chandras
#4 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Markos" == Markos Chandras <[email protected]> writes:

Markos> Right, ok we replied at the same time. I don't remember getting this Markos> problem with my version and I did multiple tests which is very weird. Markos> Do you want me to send a follow-up patch or could you fix this Markos> yourself?

I've already fixed it, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw
In reply to Markos Chandras
Quoted 66 lines · Markos Chandras
Quoted 51 lines · Peter Korsgaard

commit: http://git.buildroot.net/buildroot/commit/?id=1bf3d6f8cf3a2dca9ce1c6f3e68b077724f21db6
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

libcap can optionally link to libattr to support extra file capabilities. Link to this library and pull it as dependency if BR2_PACKAGE_ATTR is selected.

[Peter: use LIBCAP_ prefix on variable]
---
 package/libcap/libcap.mk |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
package/libcap/libcap.mk +13 -5
index dcd3a18..6adac73 100644
@@ -15,19 +15,27 @@ LIBCAP_LICENSE_FILES = License
 LIBCAP_DEPENDENCIES = host-libcap
 LIBCAP_INSTALL_STAGING = YES
 
+ifeq ($(BR2_PACKAGE_ATTR),y)
+       LIBCAP_DEPENDENCIES += attr
+       LIBCAP_HAVE_LIBATTR = yes
+else
+       LIBCAP_HAVE_LIBATTR = no
+endif
+
 define LIBCAP_BUILD_CMDS
        $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-               LIBATTR=no BUILD_CC="$(HOSTCC)" BUILD_CFLAGS="$(HOST_CFLAGS)"
+               LIBATTR=$(LIBCAP_HAVE_LIBATTR) BUILD_CC="$(HOSTCC)" \
+               BUILD_CFLAGS="$(HOST_CFLAGS)"
 endef
 
 define LIBCAP_INSTALL_STAGING_CMDS
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(STAGING_DIR) \
-               prefix=/usr lib=lib install
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+               DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib install
 endef
 
 define LIBCAP_INSTALL_TARGET_CMDS
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(TARGET_DIR) \
-               prefix=/usr lib=lib install
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
+               DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib install
 endef
 
 # progs use fork()
Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Peter,

After this commit I am seeing this problem

Applying libcap-2.22-build-system.patch using patch:
patching file libcap/Makefile
patching file Make.Rules
make: *** No rule to make target host-attr', needed by host-libcap-depends'.

Quoted 6 lines

I am not sure what tirggers it. Any ideas? host-attr shouldn't be needed as I removed that from LIBCAP_DEPENDENCIES

--
Regards,
Markos Chandras

I suspect this is because HOST_LIBCAP_DEPENDENCIES defaults to LIBCAP_DEPENDENCIES and it tries to match 'attr' with a host package. Adding "HOST_LIBCAP_DEPENDENCIES = " (just to make sure not deps are pulled for host package) seems to fixes the problem. Is this an acceptable solution?

Signature · 2 lines
Regards,
Markos Chandras