11 May, 2013

Building for your version of openSUSE in 5 simple steps!

Today I bumped into a blog about dfc, a more fancy version of the df command. There were instructions on installation for Arch and an older Ubuntu version - a link to software.opensuse.org/package/dfc wasn't there but easily found.

There were packages, thanks to the awesome Open Build Service packagers. Unfortunately, it wasn't build for 12.3 yet. Now what? Luckily, this is what OBS makes easier than pie, let me show you how you can build this package for YOUR openSUSE version without ANY technical knowledge!



Step one, you click on the repository name, "home:tcpip4000". You now go to the OBS page where Juan "tcpip4000" Danza builds dfc. In order to be able to make changes, we need to branch dfc into our own home (you need to log in on OBS first to do this).



Step two, you click on "Branch Package" and say OK to the question if you're sure about this. Now, you've got dfc in your own home and the Open Build Service will immediately begin building it. However, it still just builds for the operating systems tcpip4000 had defined - we have to add a new one!



Step three, click on "repositories" and change them. You'll see on that page you first have to go to the project that dfc is a part off, as you can only enable or disable building for a package, not the build targets themselves. Click on the branch ("home:jospoortvliet:branches:home:tcpip4000") and under "Repositories" there, you pick "Add repositories".





Step 4, you can pick what you want and hit the button on the bottom of the page to add them. By default, packages are build but not 'published' in a repository for easy download. You can change that by hovering over the "Publish Flag" section and enabling the publishing.



Step 5, go back to the dfc package which will be build by the Open Build Service and then published in the repository. You can use the little refresh button to check for the status - and once it is build successfully, click the download button and call it a success!





Now, enjoy your new package and have a lot of fun!

If you want dfc for openSUSE 12.3 and Factory, check here. Of course, not all packages will build successfully for a newer or older version of openSUSE: you might have to make changes to the spec file. That is where things get more complicated and you'll need the documentation on packaging and help on IRC. Also, if you're up for it, this can all be done even faster from the command prompt with a few simple commands. But that's a lesson for another day ;-)


To add one more DFC tip: if you edit the .bashrc file in your home folder, you can use this command by default. I have this in my bashrc:
alias df='df -h' # human-readable sizes
[ -f /usr/bin/dfc ] && alias df='dfc -T' # use dfc if there for prettier df info and show filesystems

This will ensure that if you have dfc installed, it uses it by default (the [ -f ] thing checks for that) and if you don't have it, df -h will show the output in human-friendly sizes :D

No comments:

Post a Comment

Say something smart and be polite please!