You are not logged in.

#1 2023-01-01 22:49:10

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 180

[SOLVED] Meta-Package: Using package group as dependency

Hello,
I'm creating a meta-package for installing a set of tools. The PKGBUILD content is the following:

pkgname=infosec-tools
pkgver=1.0.0
pkgrel=1
pkgdesc="InfoSec tools"
arch=('any')
license=("custom")
depends=('blackarch-cracker' 'blackarch-crypto')

where "blackarch-cracker" and "blackarch-crypto" are two groups coming from BlackArch repository (added in my pacman.conf file and working correctly).

What I note is that, when I build the package by "makepkg -f -sr --sign", it installs all the tools coming from those two groups and, when it finishes to install, I get the following error:

==> Missing dependencies:
  -> blackarch-cracker
  -> blackarch-crypto
  -> blackarch-crypto
==> Checking buildtime dependencies...
==> ERROR: Could not resolve all dependencies.

I get this error also if I install all the tools related to these two groups and then run "makepkg -f -sr --sign".

So, my doubt is: is not possible to use pkg groups in "depends" on PKGBUILD?

Edit: I tried to do some test also with other groups, like "plasma" and I get the same error. Is there a way to install pkg group instead of listing all the tools in "depends"?

Last edited by D3vil0p3r (2023-01-04 17:48:46)

Offline

#2 2023-01-01 23:23:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: [SOLVED] Meta-Package: Using package group as dependency

No, you have to list the packages.  But you make a PKGBUILD once, why is this an issue?

printf 'depends=( ' >> PKGBUILD
printf "'%s' " $(pacman -Sgq blackarch-cracker blackarch-crypto) >> PKGBUILD
printf ')\n' >> PKGBUILD

Last edited by Trilby (2023-01-01 23:23:57)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2023-01-01 23:30:59

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 180

Re: [SOLVED] Meta-Package: Using package group as dependency

Trilby wrote:

No, you have to list the packages.  But you make a PKGBUILD once, why is this an issue?

printf 'depends=( ' >> PKGBUILD
printf "'%s' " $(pacman -Sgq blackarch-cracker blackarch-crypto) >> PKGBUILD
printf ')\n' >> PKGBUILD

It is a very smart and easy solution for listing directly the packages.

My only concern is: at this point, it is not possible to install automatically new packages that will belong to the pkg group. I should manually add the new packages belonging to the pkg groups.

Offline

#4 2023-01-03 13:28:11

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,919

Re: [SOLVED] Meta-Package: Using package group as dependency

What you want looks like it may be possible with meta-packages , but not with package groups .
Check https://wiki.archlinux.org/title/Meta_p … kage_group for details


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2023-01-04 10:08:22

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 180

Re: [SOLVED] Meta-Package: Using package group as dependency

Thank you guys, the post can be marked as Solved.

Last edited by D3vil0p3r (2023-01-04 10:09:10)

Offline

#6 2023-01-04 12:23:41

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,985
Website

Re: [SOLVED] Meta-Package: Using package group as dependency

Then go ahead and do it. Edit your first post and prepend [SOLVED] to the thread's title.


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#7 2023-01-04 17:47:13

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 180

Re: [SOLVED] Meta-Package: Using package group as dependency

Thank you, I just report here the final solution that starts from the proposal of @Trilby but delete duplicated packages from the output:

sed -i '/depends=/d' PKGBUILD
sed -i '/^$/d' PKGBUILD #Delete all empty lines

printf '\n' >> PKGBUILD #Avoid that the new "depends" string is placed on an existing row
printf 'depends=( ' >> PKGBUILD
printf "'%s' " $(pacman -Sgq blackarch-networking blackarch-defensive | awk '!seen[$0]++')
printf ')\n' >> PKGBUILD

In this way, we prevent to have packages reported in "depends=" more than one time if one package belongs to more than one group.

Thank you again!

Last edited by D3vil0p3r (2023-01-04 17:48:21)

Offline

#8 2023-01-04 21:08:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: [SOLVED] Meta-Package: Using package group as dependency

That looks good.  Note that `sort -u` should be a simpler approach than `awk "!seen[$0]++"`, though they accomplish the same goal.  Though that is an excellent `uniq` implementation in awk (side note, `uniq` is the *nix tool that one might first think to use, but it requires input to be in sorted order, so `sort -u` is the way to go as it is equivalent to `sort | uniq`).

Last edited by Trilby (2023-01-04 21:10:56)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB