I think you need not to doubt the "-f" syntax of spec. It works well for a 
quite long time.
What's the content in the dynamic generated *.files file? Maybe the errors are 
from them.

On Fri, Aug 26, 2011 at 12:37:46AM +0800, Niels Mayer wrote:
> http://wiki.meego.com/Packaging/Guidelines#Handling_Locale_Files
> suggests a way of having a RPM .spec %files macro take a
> dynamically-generated file "%{name}.lang".
>          %files -f %{name}.lang
> 
> This useful "-f" syntax is also suggested here:
>     
> http://www.techrepublic.com/article/making-rpms-part-4-finishing-the-spec-file/5033542
> 
> Unfortunately, whenever I use this form in MeeGo, the only output I
> get is an error message "unsupported stanza format":
> 
> $ /usr/lib64/madde/linux-x86_64/bin/mad rrpmbuild -bb
> /home/npm/appup/qmltube/qtc_packaging/meego.spec
> '%files -f /tmp/%name-qml.files': unsupported stanza format.
> $ /usr/lib64/madde/linux-x86_64/bin/mad rrpmbuild -bb
> /home/npm/appup/qmltube/qtc_packaging/meego.spec
> '%files -f %{buildroot}/qmltube-qml.files': unsupported stanza format.
> $ /usr/lib64/madde/linux-x86_64/bin/mad rrpmbuild -bb
> /home/npm/appup/qmltube/qtc_packaging/meego.spec
> '%files -f /dev/null': unsupported stanza format.
> 
> Googling the source-code, I didn't see any obvious code to process "-f":
>     
> http://meego.gitorious.org/meego-developer-tools/madde/blobs/ffdd033010ed147b42e6b08cb43966499c0fbf85/src/madlib/rrpmbuild.pl
> :
> ...................
>     while (1) {
>       chomp, die "'$_': unsupported stanza format.\n"
>         unless /^\s*%(\w+)\s*(\S*?)\s*$/;
> 
>       if ($1 eq 'package') {
>           push @pkgnames, $2;
>           readpackage ($packages{$2} = [ [ ], { } ]);
>       }
>       elsif ($1 eq 'description') { readlines ($description{$2} = [ ]); }
> 
>       elsif ($1 eq 'prep') {    readignore \@prep; }
>       elsif ($1 eq 'build') {   readlines \@build; }
>       elsif ($1 eq 'install') { readlines \@install; }
>       elsif ($1 eq 'clean') {   readlines \@clean; }
> 
>       elsif ($1 eq 'files') { readfiles ($files{$2} = [ ]); }
>       elsif ($1 eq 'pre') { readlines ($pre{$2} = [ ]); }
>       elsif ($1 eq 'post') { readlines ($post{$2} = [ ]); }
>       elsif ($1 eq 'preun') { readlines ($preun{$2} = [ ]); }
>       elsif ($1 eq 'postun') { readlines ($postun{$2} = [ ]); }
> 
>       elsif ($1 eq 'changelog') { readlines \@changelog; }
> 
>       else { chomp; die "'$1': unsupported stanza macro.\n"; }
>       last if eof I;
>     };
> ...................
> 
> I'm using Qt Creator 2.3RC and
> http://download.meego.com/live/Tools:/SDK:/Host/ versions of MeeGo
> SDK:
> madde-0.7.63-1.1.x86_64, meego-sdk-i586-toolchain-1.1-4.1.x86_64,
> meego-sdk-qt-devel-tools-4.7.2-3.1.x86_64,
> meego-1.2-sdk-ia32-toolchain-1.0-6.1.x86_64,
> meego-sdk-libqtwebkit4-4.7.2-3.1.x86_64, meego-sdk-ia32-5-1.1.noarch,
> meego-sdk-5-1.1.noarch, meego-sdk-common-5-1.1.noarch,
> meego-sdk-libqtxml4-4.7.2-3.1.x86_64,
> meego-sdk-qt-qmake-4.7.2-3.1.x86_64, meego-sdk-armv7l-5-1.1.noarch
> 
> Niels
> http://nielsmayer.com
> 
> PS: The compromise I came up with is to use the traditional form of
> the %files macro and enumerate the directories I want to include and
> use wildcards, e.g. "qml/*.qml" :
>     
> http://ytd-meego.googlecode.com/svn/trunk/playground/qmltube/qtc_packaging/meego.spec
> The resulting MeeGo 1.2 RPM:
>     http://nielsmayer.com/meego/qml/qmltube-1.11.1-1.i586.rpm
>    (Harmattan: http://nielsmayer.com/meego/qml/qmltube_1.11.1_armel.deb )
> However, the package that really needs "%files -f" is the .spec file
> that generated this monster:
>    http://nielsmayer.com/meego/qml/qtzibit-0.1.0-1.i586.rpm
>    ( http://code.google.com/p/qtzibit/
> http://nielsmayer.com/meego/qml/qtzibit_0.1.0_armel.deb )
> _______________________________________________
> MeeGo-dev mailing list
> [email protected]
> http://lists.meego.com/listinfo/meego-dev
> http://wiki.meego.com/Mailing_list_guidelines
_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev
http://wiki.meego.com/Mailing_list_guidelines

Reply via email to