Background.
$ rpmbuild --version RPM version 4.3.3
I am working on a specification file that should handle a list of files in several scenarios. DRY (donβt repeat it yourself), I define the list once as a macro that expands into various helper scripts. Maintaining a list is a pain because I have not seen a way to avoid placing all the files on the same line.
% define LIST \ a \ b
gives an error
% define LIST a \ b \
also gives an error
% define LIST a % define LIST% LIST b
Failed to execute recursion error
, . spec:
Source1: flist %{expand:%global LIST %(cat %{SOURCE1})}
Source1 ( flist):
a \ b \ c
rpm 4.4.6, , .
RPM, . ( make). , script, . , , 3 . , , , , rpmbuild, . , , , . !
, ~/.rpmmacros. .
SPECS/inc/ spec, , , . %foo %include inc/foo.spec. , include %global foo %include inc/foo.spec. , .
%foo
%include inc/foo.spec
%global foo %include inc/foo.spec
.
/env.spec
%global foo %include inc/foo.spec %global bar %include inc/bar.spec #Lots of other common things to all packages
/foo.spec
a b c d
mylib.spec:
%include inc/env.spec Name: mylib Version: X.Y #etc... %foo
, :
%define LIST a\ b\ c
. , -
%define DOSOMETHING rm file1\ rm file2\ rm file3 ... %build %DOSOMETHING
. , . , , .
3 , ,
%define DOSOMETHING rm file1; rm file2; rm file3
, .
%{_sourcedir}/LIST:
%{_sourcedir}/LIST
:
%define process_files() \ for i in %(cat %{_sourcedir}/LIST) do \ echo "process list of files here" \ done
cat file.spec %define MAKE make \\\ status=success \\\ #EOL %build ${MAKE} cat Makefile status?=fail default: echo "status=${status}"
Source: https://habr.com/ru/post/1778184/More articles:How to achieve transparent BackColor on a WinForms source control? - controlsAdding a TrackBar Control to ContextMenu - c #select the link, will automatically check the checkbox to the left of it - jqueryHow to revert previous updates from CVS to eclipse - version-controldjango ModelMultipleChoiceField queryset / filter for already associated objects - filterWhat is the difference between enitityManager.find and entityManager.createQuery? - javaHow to correctly revert to the old version in CVS HEAD using Eclipse? - javaSetting up rails session in ajax post - jqueryhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1778188/what-are-some-different-methods-to-drag-and-move-objects-around-without-using-horizontal-or-vertical-alignment-set-to-left-and-top&usg=ALkJrhgtVJrO_1j0lAUNrzfuE0nV9Xwz8wJavascript to set a flag if another flag is set - javascriptAll Articles