[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: spec file mutations.



Is there no better way to dynamically modify the release field?

[root testserver redhat]# cat SPECS/foo.spec
Summary: foo
Name: foo
Distribution: RedHat
Version: 0
Release: a
Copyright: foo
Group: Utilities/System
Vendor: foo
Packager: foo bar com
BuildRoot: /tmp/foo
AutoReqProv: no
%description
Foo, foo, foo.

%prep
[ "%{child}" != "1" ] && kill $PPID && echo modifying spec file here && \
exec rpmbuild -ba /usr/src/redhat/SPECS/foo.spec --define 'child 1'

# do real prep starting here....

%files
[root testserver redhat]# rpmbuild -ba SPECS/foo.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.14329
+ umask 022
+ cd /usr/src/redhat/BUILD
+ '[' '%{child}' '!=' 1 ']'
+ kill 7053
+ echo modifying spec file here
modifying spec file here
+ exec rpmbuild -ba /usr/src/redhat/SPECS/foo.spec --define 'child 1'
Terminated
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.14330
+ umask 022
+ cd /usr/src/redhat/BUILD
+ '[' 1 '!=' 1 ']'
+ exit 0
Processing files: foo-0-a
Checking for unpackaged file(s): /usr/lib/rpm/check-files /tmp/foo
Wrote: /usr/src/redhat/SRPMS/foo-0-a.src.rpm
Wrote: /usr/src/redhat/RPMS/i386/foo-0-a.i386.rpm
[root testserver redhat]#




On Wed, 21 Sep 2005, Jason Pyeron wrote:



I am looking for a Frankenstein approach to have rpmbuild -ba SPECFILE modify its specfile such that the new specfile is the one included in the srpm.

%prep
# mutate the spec file changing only: release and source0

any suggestions?



--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Partner & Sr. Manager             7 West 24th Street #100     -
- +1 (443) 921-0381                 Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]