Re: rpm spec file %define

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

 



On Sun, 10 Jan 2016 03:16:24 +0000, Joseph L. Casale wrote:

> I have a spec with two source files where I do not create the second, it's not mine:
> 
> Source0:        %{name}-%{version}.tar.gz
> Source1:        foo-bar.tar.xz
> 
> My prep sections looks like:
> 
> %setup -q
> %setup -q -T -D -a 1
> 
> The tar.xz for Source1 has an unversioned name however it unpacks to a
> versioned directory so I am trying to do something like:
> 
> %define foo-bar_dir %(ls -d %{_builddir}/%{name}-%{version}/foo-bar-*-baz |grep -o '[^/]*$')
> 
> so I can leverage %{foo-bar_dir} in the %files section.

That approach sounds too complicated. %setup is a macro in the %prep
section, where you can run more commands to _set up_ your builddir. The
most obvious choice IMO would be to _rename_ the versioned dir to something
unique. You could also avoid the second invocation of %setup and extract
Source1 yourself using "tar". The parameters of the second %setup call
don't define builddir anymore, but only extract into the builddir from
the first invocation.
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux