[PATCH 2/2] fedora/buildrpm.sh: Add build script for RPMs
Prarit Bhargava
prarit at redhat.com
Fri Jan 13 13:54:19 UTC 2017
On 01/13/2017 08:38 AM, Prarit Bhargava wrote:
> On 01/12/2017 06:53 PM, Alex Hung wrote:
>> On 2017-01-12 03:03 PM, Prarit Bhargava wrote:
>>> This script automatically builds the RPM specified in fwts.spec.
>>> It is built locally in this tree, fwts/fedora/rpm/...
>>>
>>> Signed-off-by: Prarit Bhargava <prarit at redhat.com>
>>> ---
>>> fedora/buildrpm.sh | 27 +++++++++++++++++++++++++++
>>> 1 file changed, 27 insertions(+)
>>> create mode 100755 fedora/buildrpm.sh
>>>
>>> diff --git a/fedora/buildrpm.sh b/fedora/buildrpm.sh
>>> new file mode 100755
>>> index 000000000000..c9a67088432d
>>> --- /dev/null
>>> +++ b/fedora/buildrpm.sh
>>> @@ -0,0 +1,27 @@
>>> +#!/bin/bash
>>> +#
>>> +# Script to build Fedora and Red Hat fwts rpms
>>> +#
>>> +# NOTE: release changes should be made directly to the fwts.spec file
>>> +# and not this script. This script reads from fwts.spec to determine the
>>> +# values of major, minor, and submajor values.
>>> +
>>> +#setup RPM env
>>> +RPMBUILD=$(if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
>>> + else echo rpm; fi)
>>> +RPM="$(pwd)/rpm"
>>> +mkdir -p $RPM/SOURCES $RPM/BUILD $RPM/SRPMS $RPM/SPECS
>>> +
>>> +# get the tarball
>>> +major=$(cat fwts.spec | grep -m 1 major | awk -F " " ' { print $3 }')
>>> +minor=$(cat fwts.spec | grep -m 1 minor | awk -F " " ' { print $3 }')
>>> +subminor=$(cat fwts.spec | grep -m 1 subminor | awk -F " " ' { print $3 }')
>>> +tarversion="V$major.$minor.$subminor"
>>> +
>>> +cd $RPM/SOURCES && curl -O
>>> http://fwts.ubuntu.com/release/fwts-${tarversion}.tar.gz
>>> +
>>> +# copy the specfile over
>>> +cp fwts.spec $RPM/SPECS
>>
>> I ran this on Ubuntu, not on fedora, but it seems it changed directory where
>> fwts.spec is not present. As a result, this fails with "cp: cannot stat
>> 'fwts.spec': No such file or directory"
>>
>
> You're right. I had a rpm/SPECS/fwts.spec left over from previous testing and
> didn't catch this error.
>
> Alex, sorry if I've asked this before: what is the appropriate way to post a v2
> on fwts-devel? Can I just do a v2 of 2/2 or repost v2 of the entire patchset?
>
The answer doesn't matter :) -- I have to change both patches so I'm doing an
entire repost anyway.
P.
More information about the fwts-devel
mailing list