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
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).
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
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
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.
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/Pack...
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.
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.
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.
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
On Thursday 11 February 2010, Toshio Kuratomi wrote:
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.
Here goes, insert after "Byte compiled files":
Source files ------------
Source files (*.py) must be included in the same packages as the byte-compiled versions of them.
On Thu, Feb 11, 2010 at 09:07:58AM +0200, Ville Skyttä wrote:
On Thursday 11 February 2010, Toshio Kuratomi wrote:
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.
Here goes, insert after "Byte compiled files":
Source files
Source files (*.py) must be included in the same packages as the byte-compiled versions of them.
https://fedoraproject.org/wiki/No_py_removal%28draft%29
Feel free to modify it, I was aiming at pulling several elements on the page that seemed to belong together into one section rather than changing the meaning of anything you wrote.
-Toshio
Hi all,
Please excuse the naive question:
Is the upshot of this conversation that RPMs should not be used to deliver closed-source applications written in Python?
Thanks Scott
On Feb 15, 2010, at 1:07 PM, Toshio Kuratomi wrote:
On Thu, Feb 11, 2010 at 09:07:58AM +0200, Ville Skyttä wrote:
On Thursday 11 February 2010, Toshio Kuratomi wrote:
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.
Here goes, insert after "Byte compiled files":
Source files
Source files (*.py) must be included in the same packages as the byte-compiled versions of them.
https://fedoraproject.org/wiki/No_py_removal%28draft%29
Feel free to modify it, I was aiming at pulling several elements on the page that seemed to belong together into one section rather than changing the meaning of anything you wrote.
-Toshio
packaging mailing list packaging@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/packaging
On Mon, Feb 15, 2010 at 3:50 PM, Scott Frankel frankel@circlesfx.com wrote:
Is the upshot of this conversation that RPMs should not be used to deliver closed-source applications written in Python?
Certainly not as part of Fedora. You're free to do whatever you like with RPMs you ship yourself.
Thanks for the clarification
On Feb 15, 2010, at 2:01 PM, Garrett Holmstrom wrote:
On Mon, Feb 15, 2010 at 3:50 PM, Scott Frankel frankel@circlesfx.com wrote:
Is the upshot of this conversation that RPMs should not be used to deliver closed-source applications written in Python?
Certainly not as part of Fedora. You're free to do whatever you like with RPMs you ship yourself. -- packaging mailing list packaging@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/packaging
On Mon, Feb 15, 2010 at 04:01:25PM -0600, Garrett Holmstrom wrote:
On Mon, Feb 15, 2010 at 3:50 PM, Scott Frankel frankel@circlesfx.com wrote:
Is the upshot of this conversation that RPMs should not be used to deliver closed-source applications written in Python?
Certainly not as part of Fedora. You're free to do whatever you like with RPMs you ship yourself.
+1
The Fedora Packaging Guidelines contain some portions that are general packaging best practices and also some things that are specific to delivering an open source Linux Distribution. We haven't made any attempt to separate these two requirements since the Guidelines are mostly written for us and possibly to share with other Linux Distributions.
If you're shipping proprietary applications using RPMs, you can certainly look at the Fedora Guidelines for examples of things that Linux admins in general and Fedora admins in particular are looking for (compliance with the FHS, no bundling of libraries, etc) but you can decide that you need or want to ignore a particular Guideline because your requirements are different. It's good to know both why you want to disregard the Guideline, though, and why system admins want it to be followed so that you can justify your decision to your customers :-)
-Toshio
On Feb 15, 2010, at 2:28 PM, Toshio Kuratomi wrote:
On Mon, Feb 15, 2010 at 04:01:25PM -0600, Garrett Holmstrom wrote:
On Mon, Feb 15, 2010 at 3:50 PM, Scott Frankel frankel@circlesfx.com wrote:
Is the upshot of this conversation that RPMs should not be used to deliver closed-source applications written in Python?
Certainly not as part of Fedora. You're free to do whatever you like with RPMs you ship yourself.
+1
The Fedora Packaging Guidelines contain some portions that are general packaging best practices and also some things that are specific to delivering an open source Linux Distribution. We haven't made any attempt to separate these two requirements since the Guidelines are mostly written for us and possibly to share with other Linux Distributions.
If you're shipping proprietary applications using RPMs, you can certainly look at the Fedora Guidelines for examples of things that Linux admins in general and Fedora admins in particular are looking for (compliance with the FHS, no bundling of libraries, etc) but you can decide that you need or want to ignore a particular Guideline because your requirements are different. It's good to know both why you want to disregard the Guideline, though, and why system admins want it to be followed so that you can justify your decision to your customers :-)
Absolutely. I may be new to building RPMs, but I'm no stranger to bending guidelines ;)
Thanks again!
-Toshio
packaging mailing list packaging@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/packaging
packaging@lists.fedoraproject.org