I have made the following spec: #------------------------------- %global goipath github.com/OpenPrinting/goipp %global golicenses LICENSE %global godocs README.md index.md Summary: IPP core protocol in pure Go (RFC 8010) Name: golang-github-openprinting-goipp Group: Development/Other License: BSD Version: 1.0.0 Release: 1 Url: https://github.com/OpenPrinting/goipp Source0: https://github.com/OpenPrinting/goipp/archive/refs/tags/v%{version}.tar.gz?/goipp-%{version}.tar.gz BuildRequires: go-srpm-macros %gometa %description Package goipp implements the IPP core protocol in pure Go (RFC 8010). %gopkg %gopkgfiles %prep %goprep %install %gopkginstall %check %gocheck #---------------------------------- I build it using go-rpm-macros 3.0.15 and get an error: Could not open %files file /tmp/abf/rpmbuild/BUILD/goipp-1.0.0/tmp/abf/rpmbuild/BUILD/goipp-1.0.0/golang-github-openprinting-goipp-devel.file-list: no such file or directory This files does exist but %_builddir is duplicated in the path to it. No I put %gopkgfiles into the end of the spec above instead of its current place. And this error goes away! I can't understand why this happens...
Your specfile is in the wrong order. `%gopkgfiles` should be at the end of the specfile, as it relies on values that are defined in `%gopkginstall`. You should use go2rpm[2] or consult the examples in the Golang Packaging Guidelines[1] to generate a properly formatted specfile. Besides the misplaced `%gopkgfiles`, there are a couple other problems with your specfile. [1]: https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/ [2]: https://pagure.io/GoSIG/go2rpm Thanks, Maxwell