From jason.vas.dias at gmail.com Thu Jun 9 23:02:29 2022 From: jason.vas.dias at gmail.com (Jason Vas Dias) Date: Fri, 10 Jun 2022 00:02:29 +0100 Subject: best spec macro language reference ? help needed ... Message-ID: Hi - Sorry my RPM skills are a bit rusty. I am trying to get a %{warn:...} message printed during spec file evaluation which prints different strings based on whether a variable has value 1 or value 0 (NOT whether it is non-%{nil}!) : $ rpm --eval '%define aVar 1 %define isEN() %["%1==1"] %define EnStr() %{?%{isEN:%1}:%1 is Enabled}%{!?%{isEN:%1}:%1 is not Enabled} %{warn: %{EnStr:aVar}}' warning: aVar}:aVar is not Enabled If someone could please point out where I am going wrong, or where I might find a more comprehensive / the best Spec File Macro Langurage Reference document, I'd be much obliged. Thanks & Best Regards, Jason From jason.vas.dias at gmail.com Sun Jun 19 16:06:41 2022 From: jason.vas.dias at gmail.com (Jason Vas Dias) Date: Sun, 19 Jun 2022 17:06:41 +0100 Subject: How to disable AutoReqProv on shebangs for a specific script file ? In-Reply-To: References: Message-ID: Good day - I am trying to develop a .spec file for an RPM that ships a template script that references a non-existent dependency in its she-bang line: '#!' How to disable autoreqprov from including that non-existent file in %requires ? ie. the resultant RPM ends up with 'Requires: ', simply because an executable script, not meant to be run by any code on the host, references it in its shebang line. I think changing the script to be not executable is not the correct answer here - now all scripts that depend on it being executable have to be modified to do a 'chmod +x' on it. This is not an acceptable workaround for RPM needlessly injecting an unwanted 'Requires' that I can't get rid of. This is for a package that CAN produce an Android application, and that script WOULD be executed by such an application, on Android, but is in no way 'used by' any software running on the Linux host - there is a "template" Android install directory in shipped in /usr/share/${pkg}/Android/ in which all file's permissions are correct for eventual execution on an Android platform . There ought to be some way of removing specific unwanted auto-injected Requires ! Is there ? Thanks in advance for any replies, Best Regards, Jason From mhroncok at redhat.com Sun Jun 19 16:16:44 2022 From: mhroncok at redhat.com (=?UTF-8?Q?Miro_Hron=c4=8dok?=) Date: Sun, 19 Jun 2022 18:16:44 +0200 Subject: How to disable AutoReqProv on shebangs for a specific script file ? In-Reply-To: References: Message-ID: <00b35643-1ccc-eaae-59d9-aad6bfc5a612@redhat.com> On 19. 06. 22 18:06, Jason Vas Dias wrote: > Good day - > > I am trying to develop a .spec file for an RPM that ships > a template script that references a non-existent > dependency in its she-bang line: > > '#!' > > How to disable autoreqprov from including that > non-existent file in %requires ? https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/ %global __requires_exclude_from ^...$ Use a regular expression with the template's path. Or alternatively: %global __requires_exclude ^...$ Use a regular expression of . -- Miro Hron?ok -- Phone: +420777974800 IRC: mhroncok From jason.vas.dias at gmail.com Sun Jun 19 20:00:28 2022 From: jason.vas.dias at gmail.com (Jason Vas Dias) Date: Sun, 19 Jun 2022 21:00:28 +0100 Subject: How to disable AutoReqProv on shebangs for a specific script file ? In-Reply-To: <00b35643-1ccc-eaae-59d9-aad6bfc5a612@redhat.com> References: <00b35643-1ccc-eaae-59d9-aad6bfc5a612@redhat.com> Message-ID: Aha, yes, thank you very much, Miro, that works! From pmatilai at redhat.com Mon Jun 20 08:54:56 2022 From: pmatilai at redhat.com (Panu Matilainen) Date: Mon, 20 Jun 2022 11:54:56 +0300 Subject: How to disable AutoReqProv on shebangs for a specific script file ? In-Reply-To: References: Message-ID: On 6/19/22 19:06, Jason Vas Dias wrote: > Good day - > > I am trying to develop a .spec file for an RPM that ships > a template script that references a non-existent > dependency in its she-bang line: > > '#!' > > How to disable autoreqprov from including that > non-existent file in %requires ? > > ie. the resultant RPM ends up with > 'Requires: ', > simply because an executable script, not > meant to be run by any code on the host, > references it in its shebang line. > I think changing the script to be > not executable is not the correct > answer here - now all scripts that > depend on it being executable have > to be modified to do a 'chmod +x' > on it. This is not an acceptable > workaround for RPM needlessly > injecting an unwanted 'Requires' > that I can't get rid of. You can chmod -x the script in the spec to disable dependency generation on it, but still make it executable in the package with %attr(0755,-,-) (or such) in the %files section. - Panu -