[CentOS] An rpmbuild spec question

Thu Dec 28 16:17:20 UTC 2017
m.roth at 5-cent.us <m.roth at 5-cent.us>

Jonathan Billings wrote:
> On Wed, Dec 27, 2017 at 06:09:21PM -0500, m.roth at 5-cent.us wrote:
>> Sure. I think I'm closer, but I'm also at the point where I'm just
>> trying things. My current issue, that I keep falling back to, is the
>> install *INSISTS* that it has to add a - after version.
>>
>> %prep
>>
>> %install
>> mkdir $RPM_BUILD_DIR/opt/smipmicfg-%{version}
>>  install -m 744 -d %{buildroot}/%{name}-%{version}
>>
>> %clean
>> rm -rf %{buildroot}
>>
>> %files
>> %{buildroot}/%{name}
>>
>> All I want to build is a package to create /opt/smipmicfg-1.20.0, and
>> copy
>> files into it.
>>
>> What I see from the rpmbuild is
>> + cd /usr//local//src//rpmbuild/BUILD
>> + '['
>> /usr/local/src/rpmbuild/BUILDROOT/smipmicfg-1.27.0-.el7.centos.x86_64
>> '!='
>> / ']'
>> And you see that "-" after the name/version
>
> You're missing a lot of package metadata in your spec file.
>
> I suggest starting over, install rpmdevtools, use:
>
> rpmdev-newspec -t minimal smipmicfg
>
> It will create a file smipmicfg.spec, and it will be fully populated
> with a mimimal spec file.  You can probably just remove the %build
> section entirely, and just use the %install section to extract the
> contents of the tarball (or just create the dir and copy %{SOURCE0} to
> %buildroot/opt/smipmicfg-1.20.0 if it's just one file and not a
> tarball).  It sounds like most of the problems you're having is that
> you've got a fragment of a SPEC file and not the whole thing.

The "most of a specfile" is something I copied and hacked. Thanks, I'd
seen and installed rpmdevtools, but your comments help. Much appreciated.
<snip>
And I'm about to take off for a long weekend, so I'll be back at this next
week.

Happy New Year to all, and may the new one be better than the old (PLEASE!).

       mark