FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Packaging

 
 
LinkBack Thread Tools
 
Old 02-10-2010, 09:07 PM
Scott Frankel
 
Default remove source files

Hi all,

What's the best way to remove source files during a package build?
I'm quite new to rpm packaging.

I'm using a simple spec file to package a python-based application for
distribution. When passed to rpmbuild, it creates an rpm with both
source (.py) and bytecode compiled (.pyc) files. I'd like to remove
the source files from the rpm.

Thanks in advance!
Scott







--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 02-10-2010, 09:24 PM
Ville Skyttä
 
Default remove source files

On Thursday 11 February 2010, Scott Frankel wrote:

> I'm using a simple spec file to package a python-based application for
> distribution. When passed to rpmbuild, it creates an rpm with both
> source (.py) and bytecode compiled (.pyc) files. I'd like to remove
> the source files from the rpm.

Try this in %files:
%exclude /path/to/stuff/*.py

Note that if you're talking about a package intended for inclusion in Fedora,
I suppose the reviewer of your package would ask you to include the *.py in
the package (although I can't find inclusion of *.py explicitly mentioned in
the cached copy of the Fedora Python guidelines I can access right now - maybe
it should be added?).

Also, *.pyo in addition to *.pyc should be included in your package. See
http://fedoraproject.org/wiki/Packaging/Python (when it's back up).
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 02-10-2010, 09:26 PM
Garrett Holmstrom
 
Default remove source files

On Wed, Feb 10, 2010 at 4:07 PM, Scott Frankel <frankel@circlesfx.com> wrote:
> I'm using a simple spec file to package a python-based application for
> distribution. *When passed to rpmbuild, it creates an rpm with both
> source (.py) and bytecode compiled (.pyc) files. *I'd like to remove
> the source files from the rpm.

The simple answer is to leave them, especially since the packaging
guidelines require them anyway.

http://74.125.95.132/search?q=cache:Q5SlQokp60QJ:fedoraproject.org/wiki/Packaging/Python
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 02-10-2010, 09:59 PM
Ville Skyttä
 
Default remove source files

On Thursday 11 February 2010, Garrett Holmstrom wrote:
> On Wed, Feb 10, 2010 at 4:07 PM, Scott Frankel <frankel@circlesfx.com>
wrote:
> > I'm using a simple spec file to package a python-based application for
> > distribution. When passed to rpmbuild, it creates an rpm with both
> > source (.py) and bytecode compiled (.pyc) files. I'd like to remove
> > the source files from the rpm.
>
> The simple answer is to leave them, especially since the packaging
> guidelines require them anyway.

I don't think they actually explicitly do.
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 02-10-2010, 10:01 PM
Jesse Keating
 
Default remove source files

On Thu, 2010-02-11 at 00:59 +0200, Ville Skyttä wrote:
> On Thursday 11 February 2010, Garrett Holmstrom wrote:
> > On Wed, Feb 10, 2010 at 4:07 PM, Scott Frankel <frankel@circlesfx.com>
> wrote:
> > > I'm using a simple spec file to package a python-based application for
> > > distribution. When passed to rpmbuild, it creates an rpm with both
> > > source (.py) and bytecode compiled (.pyc) files. I'd like to remove
> > > the source files from the rpm.
> >
> > The simple answer is to leave them, especially since the packaging
> > guidelines require them anyway.
>
> I don't think they actually explicitly do.

They probably don't, but it's super bad form to not include them.

--
Jesse Keating
Fedora -- Freedom² is a feature!
identi.ca: http://identi.ca/jkeating
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 02-10-2010, 10:52 PM
Jonathan Underwood
 
Default remove source files

2010/2/10 Jesse Keating <jkeating@redhat.com>:
> They probably don't, but it's super bad form to not include them.

I've actually wondered for a while why we include the .py files in the
main package and not in a foo-py subpackage.
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 02-10-2010, 11:14 PM
Toshio Kuratomi
 
Default remove source files

On Wed, Feb 10, 2010 at 11:52:35PM +0000, Jonathan Underwood wrote:
> 2010/2/10 Jesse Keating <jkeating@redhat.com>:
> > They probably don't, but it's super bad form to not include them.
>
> I've actually wondered for a while why we include the .py files in the
> main package and not in a foo-py subpackage.

Among other things, tracebacks wouldn't work correctly without them.

And yes, the Guidelines aren't explicit about needing to include them...
it's been standard practice since forever. If people feel a need to make it
explicit write a draft.

-Toshio
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 02-10-2010, 11:35 PM
Tom Lane
 
Default remove source files

Ville =?iso-8859-1?q?Skytt=E4?= <ville.skytta@iki.fi> writes:
> On Thursday 11 February 2010, Scott Frankel wrote:
>> I'm using a simple spec file to package a python-based application for
>> distribution. When passed to rpmbuild, it creates an rpm with both
>> source (.py) and bytecode compiled (.pyc) files. I'd like to remove
>> the source files from the rpm.

> Try this in %files:
> %exclude /path/to/stuff/*.py

Even easier: after running "make install" in the specfile script, just
"rm" the files you don't want from the install tree.

As noted, this particular case doesn't seem to be a good idea, but when
you do want to exclude files it's certainly easy enough.

regards, tom lane
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 02-10-2010, 11:57 PM
Scott Frankel
 
Default remove source files

Thanks for the tips and suggestions for best practices!
Scott




On Feb 10, 2010, at 4:35 PM, Tom Lane wrote:

> Ville =?iso-8859-1?q?Skytt=E4?= <ville.skytta@iki.fi> writes:
>> On Thursday 11 February 2010, Scott Frankel wrote:
>>> I'm using a simple spec file to package a python-based application
>>> for
>>> distribution. When passed to rpmbuild, it creates an rpm with both
>>> source (.py) and bytecode compiled (.pyc) files. I'd like to remove
>>> the source files from the rpm.
>
>> Try this in %files:
>> %exclude /path/to/stuff/*.py
>
> Even easier: after running "make install" in the specfile script, just
> "rm" the files you don't want from the install tree.
>
> As noted, this particular case doesn't seem to be a good idea, but
> when
> you do want to exclude files it's certainly easy enough.
>
> regards, tom lane
> --
> packaging mailing list
> packaging@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging
>










--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 02-11-2010, 06:01 AM
Ville Skyttä
 
Default remove source files

On Thursday 11 February 2010, Tom Lane wrote:
> Ville =?iso-8859-1?q?Skytt=E4?= <ville.skytta@iki.fi> writes:
> > On Thursday 11 February 2010, Scott Frankel wrote:
> >> I'm using a simple spec file to package a python-based application for
> >> distribution. When passed to rpmbuild, it creates an rpm with both
> >> source (.py) and bytecode compiled (.pyc) files. I'd like to remove
> >> the source files from the rpm.
> >
> > Try this in %files:
> > %exclude /path/to/stuff/*.py
>
> Even easier: after running "make install" in the specfile script, just
> "rm" the files you don't want from the install tree.

In the case of Python packages, that will break automatic byte-compilation of
missing *.pyc and *.pyo.
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 

Thread Tools




All times are GMT. The time now is 08:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org