On 12/16/2016 05:03 AM, Mathieu Parent (Debian) wrote: > 2016-12-16 1:24 GMT+01:00 Christian Seiler <christ...@iwakd.de>: >> On 12/15/2016 10:50 PM, Mathieu Parent (Debian) wrote: >>> I need to have access to $DEB_HOST_MULTIARCH in prerm and postinst to >>> create the appropriate symlink with update-alternatives. >>> >>> What is the best way to do this? >> >> Generate them from .in files at the appropriate time, resolving >> the variable manually. See for example: >> >> https://sources.debian.net/src/dietlibc/0.34~cvs20160606-3/debian/rules/#L107-L110 >> https://sources.debian.net/src/dietlibc/0.34%7Ecvs20160606-3/debian/dietlibc-dev.postinst.in/ > > Thanks. > > This is what I've done: > > https://anonscm.debian.org/cgit/pkg-samba/cifs-utils.git/commit/?id=b0fa211e28982d471a988a7f91df32934da64f98
Small side note: in your case (single Arch: any package) I don't think it's necessary to split -arch and -indep override targets (I only do that in dietlibc because it also builds a Arch: all -doc package where I don't want to run the full build), and you could just use a simple override_dh_auto_install: and override_dh_auto_clean:. Doesn't really hurt either, but makes debian/rules more complicated than necessary in your case. > NB: I was a bit confused that dh-exec was not called for maintscript. What do you mean? Whenever I use dh-exec it's either a) for renaming files in debian/*.install or b) for having substvars available in debian/*.install. Ah, now I see, you thought that it might be able to replace substvars in postinst... I don't believe that'll work, since postinst isn't a regular debhelper conffile, but instead always has a shebang - so debhelper will never try to execute it - in contrast to things like debian/*.install, which by default are not executable, so debhelper can distinguish between the "simple file" and "script that produces the actual contents of that file" - it couldn't do that for things that are supposed to be scripts. Regards, Christian