You are not logged in.

#1 2014-11-22 19:49:55

TE
Member
Registered: 2014-06-21
Posts: 78

[SOLVED] subpackage - how to not install by default with main package?

I'm having a dickens of a time figuring this out - I split an existing single package into two; having added systemd units I want to offer a child package that is an optional install of those units (the software works without systemd - 100% optional).

When upgrading from the previous single package or just trying to install the (new) main package in it's current form, the subpackage "petrified-systemd" is always getting sucked in to install. What am I doing wrong here? I want the parent package to install without dragging in the child -- only if you specifically name the child should it get installed is what I'm after:

pkgbase=petrified
pkgname=('petrified' 'petrified-systemd')
pkgver=1.0.2
pkgrel=3
changelog=petrified.archlog
arch=('any')
url="https://github.com/troyengel/petrified"
license=('GPL3')
options=('emptydirs')
source=("https://github.com/troyengel/petrified/archive/v${pkgver}.tar.gz")
md5sums=('8e515895a38f69e341f3098fd2191b25')

package_petrified() {
  pkgdesc="Bash client to update dynamic DNS at freedns.afraid.org"
  depends=('util-linux' 'coreutils' 'bash' 'iproute2' 'curl')
  backup=('etc/petrified.conf')
  install=petrified.archinst

  cd "${srcdir}/${pkgbase}-${pkgver}"

  # Install the system bits
  install -Dm0755 petrified "${pkgdir}/usr/bin/petrified"
  install -Dm0600 petrified.conf "${pkgdir}/etc/petrified.conf" 
  install -dm0755 "${pkgdir}/var/cache/petrified"

  # Install examples for the user
  install -dm0755 "${pkgdir}/usr/share/doc/${pkgname}/extra"
  install -m0644 README.md "${pkgdir}/usr/share/doc/${pkgname}"
  install -m0644 extra/* "${pkgdir}/usr/share/doc/${pkgname}/extra"
}

package_petrified-systemd() {
  pkgdesc="Unit files for petrified systemd usage"
  depends=('petrified' 'systemd')

  cd "${srcdir}/${pkgbase}-${pkgver}"

  # Systemd files
  install -dm0755 "${pkgdir}/usr/lib/systemd/system"
  install -m0644 systemd/petrified.target systemd/petrified.timer \
                 systemd/petrified@.service \
                 "${pkgdir}/usr/lib/systemd/system"
}

All the other parts are on github and/or AUR if needed, just holler. I've looked at a couple of other packages (mesa, systemd, etc.) that have child packages and mine seems to look the same, but it's giving me the wrong results I want. sad

Last edited by TE (2014-11-22 20:41:16)

Offline

#2 2014-11-22 20:01:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] subpackage - how to not install by default with main package?

Are you passing makepkg the --pkg flag?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-11-22 20:05:26

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

Re: [SOLVED] subpackage - how to not install by default with main package?

The above question is relevant if you are concerned about it building both packages, but is this the issue, or is it that both are being installed?

Just don't use the -i flag, build the packages and install only the one you want.  If you are using an AUR helper that is doing this, then the solution is even easier: don't use that helper.


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

Offline

#4 2014-11-22 20:20:23

TE
Member
Registered: 2014-06-21
Posts: 78

Re: [SOLVED] subpackage - how to not install by default with main package?

Ahhh, my bad for forgetting that -- the behaviour is when you 'yaourt -S petrified' -- the process is dragging in the child when I don't want it to... so are y'all saying this is a problem with yaourt and not my PKGBUILD? (that would explain why I can't figure it out...)

Offline

#5 2014-11-22 20:40:54

TE
Member
Registered: 2014-06-21
Posts: 78

Re: [SOLVED] subpackage - how to not install by default with main package?

OK thanks for the hint Trilby - it's this code, it's passing pacman the name of a directory and not the unique file(s):

$ grep 'su_pacman -U' /usr/lib/yaourt/pkgbuild.sh
		su_pacman -U $SP_ARG "${PACMAN_U_ARG[@]}" "${PACMAN_S_ARG[@]}" "$YPKGDEST"/!(*.sig) ||

I've been fighting the wrong thing. sad /me sighs...

Offline

Board footer

Powered by FluxBB