Are there any RPM wizards out there that know how to specify a different architecture for a subpackage in a spec file? I have a package that has a binary component and a non-binary component that I would like split into 2 packages one, the binary which is architecture dependant and the other 'noarch'. I haven't found a spec file that does this yet :-( Ross S. W. Walker Information Systems Manager Medallion Financial, Corp. 437 Madison Avenue 38th Floor New York, NY 10022 Tel: (212) 328-2165 Fax: (212) 328-2125 WWW: http://www.medallion.com <http://www.medallion.com/> ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20071206/369255c8/attachment-0003.html>
On Dec 6, 2007 1:36 PM, Ross S. W. Walker <rwalker at medallion.com> wrote:> > > Are there any RPM wizards out there that know how to specify a > different architecture for a subpackage in a spec file? > > I have a package that has a binary component and a non-binary > component that I would like split into 2 packages one, the > binary which is architecture dependant and the other 'noarch'. > > I haven't found a spec file that does this yet :-( >I remember that this was either impossible or really hard to do long ago. If my memory serves me right.. it was just easier to break them out into 2 different source rpms than trying to get RPM to do it. -- Stephen J Smoogen. -- CSIRT/Linux System Administrator How far that little candle throws his beams! So shines a good deed in a naughty world. = Shakespeare. "The Merchant of Venice"
Ross S. W. Walker
2007-Dec-06 22:05 UTC
[CentOS] RPM Spec and subpackage architecture [SOLVED]
Ross S. W. Walker wrote:> > Are there any RPM wizards out there that know how to specify a > different architecture for a subpackage in a spec file? > > I have a package that has a binary component and a non-binary > component that I would like split into 2 packages one, the > binary which is architecture dependant and the other 'noarch'. > > I haven't found a spec file that does this yet :-(Ok, well it isn't pretty, but it's the only way to do it, I am posting a general RPM specfile template that outlines it. Once you have the spec file created you can do an: # rpmbuild --target=$(uname -i),noarch <specfile> And it should build the binary and noarch. Here's the template: ## ## Global Package Definitions ## ## Package Options ## Package Definitions ## Platform Definitions ## ## Main Package ## ## Information Summary: <Package Summary> Name: <Package Name, Subpackage Prefix> Version: <Common Version> Release: <Common Release> License: <Common License> Group: <Package Group> URL: <Common Project URL> Packager: <Common Packager> ## Sources ## Patches ## Build Definitions BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} ## Build Requirements BuildRequires: ## Install Requirements Requires: %{name}-subname = %{version}-%{release} ## Description %description <Package Description> ## ## Subpackage ## %ifarch noarch %package subname ## Information Summary: <Subpackage Summary> ## Build Requirements BuildRequires: ## Install Provides Provides: %{name}-subname ## Description %description subname <Subpackage Description> %endif ## ## Package Creation ## ## Preparation %prep <Common Prep Work> ## Build %build %ifnarch noarch <Architecture Build> %endif ## Installation %install %{__rm} -rf %{buildroot} %ifnarch noarch <Architecture Install> %else <No Architecture Install> %endif ## Cleaning %clean %{__rm} -rf %{buildroot} ## Post-Install Script (Package) %ifnarch noarch %post <Architecture Post Install Script> %endif ## Pre-Uninstall Script (Package) %ifnarch noarch %preun <Architecture Pre Uninstall Script> %endif ## Post-Uninstall Script (Package) %ifnarch noarch %postun <Architecture Post Uninstall Script> %endif ## Post-Install Script (Subpackage) %ifarch noarch %post subname <No Architecture Post Install Script> %endif ## Pre-Uninstall Script (Subpackage) %ifarch noarch %preun subname <No Architecture Pre Uninstall Script> %endif ## Post-Uninstall Script (Subpackage) %ifnarch noarch %postun subname <No Architecture Post Uninstall Script> %endif ## File Catalog (Package) %ifnarch noarch %files <Architecture File Catalog> %endif ## File Catalog (Subpackage) %ifarch noarch %files subname <No Architecture File Catalog> %endif ## Change Log %changelog Hope this helps somebody. -Ross ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.