1
1
mirror of https://github.com/goreleaser/nfpm synced 2025-04-30 14:18:01 +02:00

fix: Define sourcedir and rpmfilename macros for rpmbuild

Our build system has a complex rmpbuld environment set up where
macros don't match with the defaults that nfpm exepcts. This
change will enforce those defaults which makes nfpm less
dependant on the build environment.
This commit is contained in:
Adrian Wennberg 2019-06-28 14:51:45 +01:00
parent 75cf0f6b4e
commit 8095c4092b

@ -66,6 +66,8 @@ func (*RPM) Package(info nfpm.Info, w io.Writer) error {
"--verbose",
"--define", fmt.Sprintf("_topdir %s", temps.Root),
"--define", fmt.Sprintf("_tmppath %s/tmp", temps.Root),
"--define", fmt.Sprintf("_rpmfilename %s", filepath.Join(info.Arch, filepath.Base(temps.RPM))),
"--define", fmt.Sprintf("_sourcedir %s", filepath.Dir(temps.Source)),
"--target", fmt.Sprintf("%s-unknown-%s", info.Arch, info.Platform),
"-ba",
"SPECS/" + info.Name + ".spec",