RPM Spec file that demonstrates the modularity of Smart

Bug #329684 reported by Rehan Khan
2
Affects Status Importance Assigned to Milestone
Smart Package Manager
Fix Released
Undecided
Unassigned

Bug Description

I have been hacking on Axel's Fedora 10 RPM spec file to see if the install could be modularised. Oddly, this came about due to one of the dialogs becoming too big to fit on the screen of a virtual machine install of fedora (I think it was the channel add dialog). I wanted to reduce the number of unnecessary options so I could get to the 'ok' button :)

It has the added benefit of making smart self documenting from the perspective of looking at the list of rpm's and of making the initial user experience much simpler (=less/more sensible choice). It is easy to see which files are part of the core and which files add functionality for particular package management systems. Additionally it allows the packager to only install the backends/channels/plugins/utils required for that distro while still allowing the user to install the rest of smart as they wish, generally a BAD-BAD-IDEA(tm) but still possible.

afb noted that the spec file produces too many sub-packages so the packager could compress this down by either removing or merging the channels/plugins with the ancilliary backend (for that distro). This would probably work for deb/slack but for rpm this would include red-carpet and up2date which are little used afaiks. However the choice is available.

Adding channels/plugins is easier/cleaner as one just has to add a %package section and a related %files section for the new files.

Revision history for this message
Rehan Khan (rasker) wrote :
Revision history for this message
Rehan Khan (rasker) wrote :
Revision history for this message
Rehan Khan (rasker) wrote :

Presently the spec file produces the following RPM's (note the total disk space used is still ~1Mb.)

smart-1.1-58.0.1.fc10.src.rpm

smart-1.1-58.0.1.fc10.i386.rpm

smart-backend-RPM-1.1-58.0.1.fc10.i386.rpm
smart-backend-DEB-1.1-58.0.1.fc10.i386.rpm
smart-backend-Slack-1.1-58.0.1.fc10.i386.rpm

smart-channel-APT_DEB-1.1-58.0.1.fc10.i386.rpm
smart-channel-APT_RPM-1.1-58.0.1.fc10.i386.rpm
smart-channel-DEB_DIR-1.1-58.0.1.fc10.i386.rpm
smart-channel-DEB_SYS-1.1-58.0.1.fc10.i386.rpm
smart-channel-Red_Carpet-1.1-58.0.1.fc10.i386.rpm
smart-channel-RPM_DIR-1.1-58.0.1.fc10.i386.rpm
smart-channel-RPM_HDL-1.1-58.0.1.fc10.i386.rpm
smart-channel-RPM_MD-1.1-58.0.1.fc10.i386.rpm
smart-channel-RPM-SYS-1.1-58.0.1.fc10.i386.rpm
smart-channel-Slack_Site-1.1-58.0.1.fc10.i386.rpm
smart-channel-Slack_SYS-1.1-58.0.1.fc10.i386.rpm
smart-channel-URPMI-1.1-58.0.1.fc10.i386.rpm
smart-channel-Yast2-1.1-58.0.1.fc10.i386.rpm
smart-channel-mirrors-1.1-58.0.1.fc10.i386.rpm
smart-channel-up2date_mirrors-1.1-58.0.1.fc10.i386.rpm

smart-plugin-channelsync-1.1-58.0.1.fc10.i386.rpm
smart-plugin-aptchannelsync-1.1-58.0.1.fc10.i386.rpm
smart-plugin-debdir-1.1-58.0.1.fc10.i386.rpm
smart-plugin-rpmdir-1.1-58.0.1.fc10.i386.rpm
smart-plugin-detectsys-1.1-58.0.1.fc10.i386.rpm

smart-interface-console-1.1-58.0.1.fc10.i386.rpm
smart-interface-GTK-1.1-58.0.1.fc10.i386.rpm

smart-update-1.1-58.0.1.fc10.i386.rpm
smart-ksmarttray-1.1-58.0.1.fc10.i386.rpm

Revision history for this message
Rehan Khan (rasker) wrote :

The file smart.spec separates all the components into separate packages. By compacting the %files sections and removing corresponding %package sections the spec file can be easily tailored for a particular distribution. The attachment smart_alt2.spec provides an example that tailors the install further for Fedora. As Fedora doesn't use yast2, urpmi, Red Carpet channels or up2date mirrors these have been left as additional channel types (they can even be further compacted into a smart-channel-RPM_other package easily reducing the rpm count even more).

The point is that the spec file is easily customisable and once customised doesn't change unless backends/channels/plugins are added to the tarball. The packager has the ability to control the default install to only what is needed by that distro while allowing the user to install other bits as they wish.

This spec file produces the following rpm's;

smart-1.1-58.0.1.fc10.src.rpm

smart-1.1-58.0.1.fc10.i386.rpm
smart-backend-RPM-1.1-58.0.1.fc10.i386.rpm
smart-backend-DEB-1.1-58.0.1.fc10.i386.rpm
smart-backend-Slack-1.1-58.0.1.fc10.i386.rpm
smart-channel-Red_Carpet-1.1-58.0.1.fc10.i386.rpm
smart-channel-URPMI-1.1-58.0.1.fc10.i386.rpm
smart-channel-Yast2-1.1-58.0.1.fc10.i386.rpm
smart-channel-up2date_mirrors-1.1-58.0.1.fc10.i386.rpm
smart-interface-GTK-1.1-58.0.1.fc10.i386.rpm
smart-update-1.1-58.0.1.fc10.i386.rpm
smart-ksmarttray-1.1-58.0.1.fc10.i386.rpm

Revision history for this message
Anders F Björklund (afb) wrote :

Sounds like a config option to filter the displayed channel types might be more useful ?

Anyway, added the "scrolling of too large channel type radio button table" as #329969

Revision history for this message
Anders F Björklund (afb) wrote :

This patch adds a "display-channels" option, which takes a list of channel types to display.

Changed in smart:
status: New → Fix Committed
Changed in smart:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.