Skip to content

Instantly share code, notes, and snippets.

@avsm
Forked from jonludlam/gist:07fbb321e00a47180e98
Last active August 29, 2015 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avsm/09fd0f3944fecd8a8ee3 to your computer and use it in GitHub Desktop.
Save avsm/09fd0f3944fecd8a8ee3 to your computer and use it in GitHub Desktop.

Building RPMs using OpenSUSE's Open Build Service in n easy steps

  • Get yourself an account on OBS, and create your home project
  • Get the CLI and build tool
$ apt-add-repository "deb http://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_14.04/ /"                                             
$ curl http://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_14.04/Release.key | sudo apt-key add -                                   
$ apt-get update
$ apt-get install -y osc build                                                                                                                    
  • Make a local workspace
$ mkdir obs-workspace; cd obs-workspace                                                                                                           
$ osc checkout home:<username> # then type in username and password                                                                               
  • Set up your project to build for your targets - in this case, CentOS 6:
$ osc meta prj -e home:<username>                                                                               

and add the following XML stanza:

<project>
...                                                                                                                                          
  <repository name="CentOS_6">                                                                                                                      
    <path project="CentOS:CentOS-6" repository="standard"/>                                                                                         
    <arch>x86_64</arch>                                                                                                                             
  </repository>
...
</project>                                                                                                                                     
  • Create yourself a new package:
$ osc meta pkg -e home:<username> <new package name> # edit title and description
$ osc up # fetch a local copy of the new package
$ cd home:<username>/<new package name>                                                                                                           
  • Add your files - spec files and sources
  • Build locally:
$ osc build CentOS_6 x86_64 <your specfile>                                                                                                       
  • when it builds, fire it back up to OBS:
$ osc add <your project files>
$ osc commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment