Skip to content

Instantly share code, notes, and snippets.

@nanomad
Created October 16, 2014 07:46
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 nanomad/c013f6603984e5372eb3 to your computer and use it in GitHub Desktop.
Save nanomad/c013f6603984e5372eb3 to your computer and use it in GitHub Desktop.
How to build openjdk ArchLinux packages on OBS

How to build openjdk ArchLinux packages on OBS

Set-up a projectHow to build openjdk ArchLinux packages on OBS

Set-up a project

  • Create an account on https://build.opensuse.org/

  • Create a new project (defaults to home:user) with relevant title and description

  • Go to the project page -> Advanced -> Meta and add a repository section for Arch:Extra

<repository name="Arch_Extra">
    <path project="Arch:Extra" repository="standard"/>
    <arch>i586</arch>
    <arch>x86_64</arch>
</repository>
  • Save it

  • Edit the project page -> Advanced -> Project Config section and add the following:

Prefer: ca-certificates-utils ca-certificates
Preinstall: autoconf automake bash binutils bison bzip2 coreutils cryptsetup device-mapper dhcpcd diffutils e2fsprogs fakeroot file filesystem findutils flex gawk gettext glibc grep groff gzip inetutils iproute2 iputils jfsutils less licenses linux logrotate lvm2 m4 make man-db man-pages mdadm nano netctl pacman patch pciutils pcmciautils perl pkg-config procps-ng psmisc reiserfsprogs s-nail sed shadow sudo sysfsutils systemd-sysvcompat tar texinfo usbutils util-linux vi which xfsprogs

N.B. Everything following Preinstall: should go on one line (it's basiscally the content of the base and base-devel meta-packages

  • Save it

Upload the PKGBUILDS

The following steps are for your local machine

  • install the aur/osc package (it's a command-line client of the build system, it makes it easier to manage files and packages)

  • shell> osc clone home:$user - o home_user Since pacman does not like : in the folder names

  • shell> cd home_user

###For Java7

  • shell> wget "https://aur.archlinux.org/packages/ja/java7-openjdk/java7-openjdk.tar.gz"
  • shell> tar xvf java7-openjdk.tar.gz
  • shell> rm java7-openjdk.tar.gz
  • shell> cd java7-openjdk
  • shell> makepkg --verifysource This will donwload and check package source files. It is needed since OBS machines do not have network access
  • shell> rm -r src The src folder is not needed, makepkg will create it for us
  • shell> cd ..
  • shell> osc add java7-openjdk
  • shell> osc commit

For Java8

Follow the above steps using the java8-openjdk sources from AUR as well as the ccache sources from ABS (community is not provided in the OBS environment)

You can follow packages build progess on your project home page (java takes around 1h to build)

Configure the repository

While still in the home_user folder, you can retrieve the key used by OBS to sign the packages (you can even modify it, there are explanations on the OBS wiki on how to do so)

  • shell> osc signkey > $HOME/osc_home_$user.key
  • shell> sudo pacman-key --add $HOME/osc_home_$user.key
  • shell> sudo pacman-key --lsign-key $KEY_ID

Finally, just add the repo to your pacman.conf

[home_$user_Arch_Extra]
Server = http://download.opensuse.org/repositories/home:/$user/Arch_Extra/$arch

  • Create an account on https://build.opensuse.org/

  • Create a new project (defaults to home:user) with relevant title and description

  • Go to the project page -> Advanced -> Meta and add a repository section for Arch:Extra

<repository name="Arch_Extra">
    <path project="Arch:Extra" repository="standard"/>
    <arch>i586</arch>
    <arch>x86_64</arch>
</repository>
  • Save it

  • Edit the project page -> Advanced -> Project Config section and add the following:

Prefer: ca-certificates-utils ca-certificates
Preinstall: autoconf automake bash binutils bison bzip2 coreutils cryptsetup device-mapper dhcpcd diffutils e2fsprogs fakeroot file filesystem findutils flex gawk gettext glibc grep groff gzip inetutils iproute2 iputils jfsutils less licenses linux logrotate lvm2 m4 make man-db man-pages mdadm nano netctl pacman patch pciutils pcmciautils perl pkg-config procps-ng psmisc reiserfsprogs s-nail sed shadow sudo sysfsutils systemd-sysvcompat tar texinfo usbutils util-linux vi which xfsprogs

N.B. Everything following Preinstall: should go on one line (it's basiscally the content of the base and base-devel meta-packages

  • Save it

Upload the PKGBUILDS

The following steps are for your local machine

  • install the aur/osc package (it's a command-line client of the build system, it makes it easier to manage files and packages)

  • shell> osc clone home:$user - o home_user Since pacman does not like : in the folder names

  • shell> cd home_user

###For Java7

  • shell> wget "https://aur.archlinux.org/packages/ja/java7-openjdk/java7-openjdk.tar.gz"
  • shell> tar xvf java7-openjdk.tar.gz
  • shell> rm java7-openjdk.tar.gz
  • shell> cd java7-openjdk
  • shell> makepkg --verifysource This will donwload and check package source files. It is needed since OBS machines do not have network access
  • shell> rm -r src The src folder is not needed, makepkg will create it for us
  • shell> cd ..
  • shell> osc add java7-openjdk
  • shell> osc commit

For Java8

Follow the above steps using the java8-openjdk sources from AUR as well as the ccache sources from ABS (community is not provided in the OBS environment)

You can follow packages build progess on your project home page (java takes around 1h to build)

Configure the repository

While still in the home_user folder, you can retrieve the key used by OBS to sign the packages (you can even modify it, there are explanations on the OBS wiki on how to do so)

  • shell> osc signkey > $HOME/osc_home_$user.key
  • shell> sudo pacman-key --add $HOME/osc_home_$user.key
  • shell> sudo pacman-key --lsign-key $KEY_ID

Finally, just add the repo to your pacman.conf

[home_$user_Arch_Extra]
Server = http://download.opensuse.org/repositories/home:/$user/Arch_Extra/$arch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment