Hi, folks, Trying to build a package from a gzipped tarball of a python package. I'm trying to build it in /root/rpmbuild. Python has a way to build it, but it creates its own tree, with a clone of the rpmbuild tree under *that*. So, from the specfile, I'm trying to understand, after much googling, what I need to change the Source and BuildRoot to. My latest try for the latter is BuildRoot: %{_builddir}/BUILD/%{name}-%{version}-%{release} For Source0, I want to use the file in SOURCES. Anyone got a better example than what I've been googling? mark
On Wed, 26 Oct 2016 13:07:43 -0400 m.roth at 5-cent.us wrote:> I'm trying to build it in /root/rpmbuild.Don't do that. Install rpmdevtools so you build it under your home directory and avoid blowing up your system if there's an error. -- MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
On 26 Oct 2016 6:17 pm, "Frank Cox" <theatre at melvilletheatre.com> wrote:> > On Wed, 26 Oct 2016 13:07:43 -0400 > m.roth at 5-cent.us wrote: > > > I'm trying to build it in /root/rpmbuild. > > Don't do that. Install rpmdevtools so you build it under your homedirectory and avoid blowing up your system if there's an error.>First of all read up on how to properly build an RPM: https://www.hogarthuk.com/?q=node/11 Since this is python look up the Fedora python guidelines and follow those. Here's the spec for a recent python library I packaged: https://pkgs.fedoraproject.org/cgit/rpms/python-ntlm3.git/tree/python-ntlm3.spec If you don't need python3 you can strip that stuff out ... The Fedora python guidelines have a decent spec template you can crib, keep in mind the el6 caveats if you need to build for that with regards to macro definitions
On 10/26/2016 10:07 AM, m.roth at 5-cent.us wrote:> Trying to build a package from a gzipped tarball of a python package. > I'm trying to build it in /root/rpmbuild.To echo Frank's advice: don't do that. Build rpms as a non-root user. Consider using "mock", especially if you intend to distribute your packages.> Python has a way to build it, > but it creates its own tree, with a clone of the rpmbuild tree under > *that*.It sounds like you're using "setup.py bdist_rpm". When you do that, python's setuptools will create a temporary rpm build environment in ./build/. You should also get the src.rpm in ./dist/ If you want to build the package in your own rpmroot, just take the src.rpm from ./dist/ and rebuild it.