Re: spec file

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

 





On Sun, Jan 15, 2017 at 12:22 AM Michael Schwendt <mschwendt@xxxxxxxxx> wrote:
On Sat, 14 Jan 2017 16:57:42 +0000, arnaud gaboury wrote:

> %prep
> %autosetup -n platform-master
>
> # many golang binaries are "vendoring" (bundling) sources, so remove them.
> Those dependencies need to be packaged independently.
> cd %{_builddir}

Don't get accustomed to that. Don't cd into %_builddir directly.

Run "rpm -E %_builddir" to see which directory that macro expands to.
There are corner-cases when you need to use the %_builddir macro.
In most cases, you don't need to use it at all.

The %setup and %autosetup macros define the top-level build directory
below %_builddir, and at the start of every spec file section (e.g. %build,
%install, %check, even %files), that build directory is entered automatically.
It may also be cleaned up automatically depending on your rpmbuild option
and the default %clean section.

Create all your other working directories below $(pwd), not anywhere
above %_builddir. You can access relative paths from current
directory, which is much more convenient.

In your case, because of using %autosetup -n platform-master, the
root directory is

  %{_builddir}/platform-master

and if you read rpmbuild output, you should see that the directory is
entered automatically for every spec file section. If you've used %autosetup
correctly, you should find the extracted source code below that directory,
too. If you need another top-level directory, you can use option -c to
create it.

The way you jump to absolute paths and even create links that lead back to
some absolute %_builddir path makes the spec file look like a mess.

Thank you so much for all these good practices. These kinds of hints are very hard to find in fact. It is easy to quickly mess everything when it comes to using macros.
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
[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