Hi,
based on the help Vagrant gave me, I tried to create a script to automatically build our packages (if need be) and put them into the repository.
What the script does is:
1. Read out GITs from a file (packages.txt, example included) 2. Clones the GIT if it doesn't exist 3. Updates the GIT if it already exists 4. Reads out the package name and builds the package if the GIT had been updated 5. Included the built package into the repository
Could you all have a quick look at the script and let me know if you find anything that could cause issues?
Thanks :)
Am 08.10.2014 um 04:55 schrieb Michael Mrozek EvilDragon@openpandora.org:
Hi,
based on the help Vagrant gave me, I tried to create a script to automatically build our packages (if need be) and put them into the repository.
What the script does is:
- Read out GITs from a file (packages.txt, example included)
- Clones the GIT if it doesn't exist
- Updates the GIT if it already exists
- Reads out the package name and builds the package if the GIT had
been updated 5. Included the built package into the repository
Could you all have a quick look at the script and let me know if you find anything that could cause issues?
One issue came to my mind: how do you specify which branch of a git you want to see? It is not always the „master“ branch.
Proposal:
while read url branch do [ ! "$branch“ ] && branch=„master" … done
Thanks :)
-- Mit freundlichen Grüßen,
Michael Mrozek
OpenPandora GmbH Geschäftsführer: Michael Mrozek
Schäffbräustr. 11 85049 Ingolstadt Deutschland Tel.: 0841 / 13 177 33 http://www.openpandora.de/ HRB 4879, Amtsgericht Ingolstadt
eMail: mrozek@openpandora.org <build.sh><packages.txt>_______________________________________________ Firmware mailing list Firmware@pyra-handheld.com http://pyra-handheld.com/cgi-bin/mailman/listinfo/firmware
On 2014-10-07, Michael Mrozek wrote:
based on the help Vagrant gave me, I tried to create a script to automatically build our packages (if need be) and put them into the repository.
What the script does is:
- Read out GITs from a file (packages.txt, example included)
- Clones the GIT if it doesn't exist
- Updates the GIT if it already exists
- Reads out the package name and builds the package if the GIT had
been updated 5. Included the built package into the repository
Could you all have a quick look at the script and let me know if you find anything that could cause issues?
Found a few minor issues:
* Handle other compression types (dpkg source v3) and diff.gz (dpkg source v1). Maybe this will never come up, but easy to fix. * Quoting variable in a comparison * The debuild step should be unnecessary- sbuild can take care of that too.
Also might want to consider running each build in it's own build directory as a subdir of "$builddir" with a timestamp/randomized name just in case it gets called multiple times... maybe that's overly cautious, but it's also fairly straightforward to implement.
--- pyra-build 2014-10-08 15:02:20.499636855 -0700 +++ pyra-build-package 2014-10-08 15:02:39.519363060 -0700 @@ -19,7 +19,8 @@ rm "$builddir/*.changes" rm "$builddir/*.dsc" rm "$builddir/*.deb" - rm "$builddir/*.tar.gz" + rm "$builddir/*.diff.gz" + rm "$builddir/*.tar.*" build=false
# Read the GIT URL @@ -48,22 +49,18 @@
# Build if Package is updated
- if [ $build == true ]; then + if [ "$build" == true ]; then
# Get package name package="$(head -1 "${builddir}/${gitdir}/debian/control" | awk '{print $NF}')"
- # Run debuild + # Build the source and binary packages! cd "$builddir/$gitdir" - debuild -us -uc -S - - # Build the package! - - cd "$builddir" sbuild -d jessie-pyra -c jessie-armhf --arch=armhf --arch-all --source
# Put it into the repository
+ cd "$builddir" name="$(ls *.changes)" reprepro -V -b "$repodir" include jessie-pyra $name
live well, vagrant
Am Wed, 08 Oct 2014 15:06:04 -0700 hat Vagrant Cascadian vagrant@debian.org geschrieben:
Hi,
thanks for your feedback :) I've added your patches to the script and also included Nikolaus suggestion to include the branch as well.
I've also pushed it onto the pyra-os git, so you can directly work on it as well :)
http://dev.pyra-handheld.com/index.php/p/pyraos-build/source/tree/master/
On 2014-10-07, Michael Mrozek wrote:
based on the help Vagrant gave me, I tried to create a script to automatically build our packages (if need be) and put them into the repository.
What the script does is:
- Read out GITs from a file (packages.txt, example included)
- Clones the GIT if it doesn't exist
- Updates the GIT if it already exists
- Reads out the package name and builds the package if the GIT had
been updated 5. Included the built package into the repository
Could you all have a quick look at the script and let me know if you find anything that could cause issues?
Found a few minor issues:
- Handle other compression types (dpkg source v3) and diff.gz (dpkg source v1). Maybe this will never come up, but easy to fix.
- Quoting variable in a comparison
- The debuild step should be unnecessary- sbuild can take care of that too.
Also might want to consider running each build in it's own build directory as a subdir of "$builddir" with a timestamp/randomized name just in case it gets called multiple times... maybe that's overly cautious, but it's also fairly straightforward to implement.
--- pyra-build 2014-10-08 15:02:20.499636855 -0700 +++ pyra-build-package 2014-10-08 15:02:39.519363060 -0700 @@ -19,7 +19,8 @@ rm "$builddir/*.changes" rm "$builddir/*.dsc" rm "$builddir/*.deb"
- rm "$builddir/*.tar.gz"
rm "$builddir/*.diff.gz"
rm "$builddir/*.tar.*" build=false
# Read the GIT URL
@@ -48,22 +49,18 @@
# Build if Package is updated
- if [ $build == true ]; then
if [ "$build" == true ]; then
# Get package name package="$(head -1 "${builddir}/${gitdir}/debian/control" | awk
'{print $NF}')"
- # Run debuild
- # Build the source and binary packages! cd "$builddir/$gitdir"
- debuild -us -uc -S
- # Build the package!
- cd "$builddir" sbuild -d jessie-pyra -c jessie-armhf --arch=armhf --arch-all
--source # Put it into the repository
- cd "$builddir" name="$(ls *.changes)" reprepro -V -b "$repodir" include jessie-pyra $name
live well, vagrant
Here's the method I've been using to build packages.
First some config files:
~/.pbuilderrc COMPONENTS="main contrib non-free" export LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}/usr/lib/libeatmydata/libeatmydata.so" export CCACHE_DIR="/var/cache/pbuilder/ccache" export PATH="/usr/lib/ccache:${PATH}" BINDMOUNTS="${CCACHE_DIR}" EXTRAPACKAGES="ccache eatmydata"
~/.gbp.conf [DEFAULT]
[buildpackage] export-dir = ~/export builder = ARCH=armhf DIST=testing git-pbuilder -I -i -j2
/etc/sudoers.d/50-pbuilder %sudo ALL=(ALL:ALL) NOPASSWD: /usr/bin/pbuilder %sudo ALL=(ALL:ALL) NOPASSWD: /usr/sbin/cowbuilder
And to install everything:
apt-get install eatmydata ccache git-buildpackage dh-autoreconf xserver-xorg-dev ARCH=armhf DIST=testing git-pbuilder create ARCH=armhf DIST=testing git-pbuilder login --save-after-update echo "deb http://packages.pyra-handheld.com/debian jessie-pyra main"
/etc/apt/sources.list.d/pyra.list
apt-get update apt-get install eatmydata ccache exit
chmod -R a+rwx /var/cache/pbuilder/ccache # compiling will probably fail the first time, since not all ccache dirs are created, so run it again to allow the ccache from pbuilder to access the cache. After that ccache behaves fine.
To compile packages from git:
gbp clone git://git.openpandora.org/xserver-xorg-video-fbturbo.git cd xserver-xorg-video-fbturbo git-buildpackage
And now all your stuff ends up in ~/export you can set up gbp.conf to run additional scripts to sign/upload the package, etc.
gbp clone/pull should be used instead of git clone/pull. This automatically checks out all the branches and tags gbp needs.
Before every run the chroot should be updated, which is done with ARCH=armhf DIST=testing git-pbuilder update
This only works on native arm hardware, however, once the chroot is created, you can do the qemu-static chroot trick and run it on non arm hardware as well.