On Sun, Jan 15, 2017 at 12:22 AM Michael Schwendt <mschwe...@gmail.com>
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.
>

OK, so I don't use %{_builddir} in my macro. So, what should I use?
Let's atke the first few lines:

 # cd %{_builddir}  <-- As suggested, I don't need to cd.
mkdir -p src/github.com/mattermost
cd src/github.com/mattermost
ln -s %{_builddir}/platform-master platform

Here is the rpmbuild output for these lines:
-------------------------
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd platform-master
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ cd /home/makerpm/rpmbuild
+ mkdir -p src/github.com/mattermost
+ cd src/github.com/mattermost
+ ln -s /home/makerpm/rpmbuild/platform-master platform
----------------------------------------------------------
May you give me the correct syntax you would use for these lines?

>
> 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.
> _______________________________________________
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
>
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org

Reply via email to