Add archbuild helper script to create and build in chroots
This will create chroots on demand if needed.
This commit is contained in:
parent
ae5083fc11
commit
9b001033ae
17
Makefile
17
Makefile
|
@ -1,4 +1,4 @@
|
|||
V=0.9.7
|
||||
V=0.9.8
|
||||
|
||||
all:
|
||||
|
||||
|
@ -22,7 +22,14 @@ install:
|
|||
install -d -m 755 $(DESTDIR)/usr/sbin
|
||||
install -m 755 mkarchroot $(DESTDIR)/usr/sbin
|
||||
install -m 755 makechrootpkg $(DESTDIR)/usr/sbin
|
||||
#Additional packaging helper scripts
|
||||
install -m 755 archbuild $(DESTDIR)/usr/bin
|
||||
ln -sf archbuild $(DESTDIR)/usr/bin/extra-i686-build
|
||||
ln -sf archbuild $(DESTDIR)/usr/bin/extra-x86_64-build
|
||||
ln -sf archbuild $(DESTDIR)/usr/bin/testing-i686-build
|
||||
ln -sf archbuild $(DESTDIR)/usr/bin/testing-x86_64-build
|
||||
ln -sf archbuild $(DESTDIR)/usr/bin/staging-i686-build
|
||||
ln -sf archbuild $(DESTDIR)/usr/bin/staging-x86_64-build
|
||||
# Additional packaging helper scripts
|
||||
install -m 755 lddd $(DESTDIR)/usr/bin
|
||||
install -m 755 finddeps $(DESTDIR)/usr/bin
|
||||
install -m 755 rebuildpkgs $(DESTDIR)/usr/bin
|
||||
|
@ -46,6 +53,12 @@ uninstall:
|
|||
rm $(DESTDIR)/usr/bin/community-testingpkg
|
||||
rm $(DESTDIR)/usr/sbin/mkarchroot
|
||||
rm $(DESTDIR)/usr/sbin/makechrootpkg
|
||||
rm $(DESTDIR)/usr/bin/extra-i686-build
|
||||
rm $(DESTDIR)/usr/bin/extra-x86_64-build
|
||||
rm $(DESTDIR)/usr/bin/testing-i686-build
|
||||
rm $(DESTDIR)/usr/bin/testing-x86_64-build
|
||||
rm $(DESTDIR)/usr/bin/staging-i686-build
|
||||
rm $(DESTDIR)/usr/bin/staging-x86_64-build
|
||||
rm $(DESTDIR)/usr/bin/lddd
|
||||
rm $(DESTDIR)/usr/bin/finddeps
|
||||
rm $(DESTDIR)/usr/bin/archco
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
|
||||
cmd="$(basename "${0%-build}")"
|
||||
repo=${cmd%-*}
|
||||
arch=${cmd#*-}
|
||||
chroots='/var/tmp/archbuild'
|
||||
clean_first=false
|
||||
|
||||
usage() {
|
||||
echo "usage $(basename "$0")"
|
||||
echo ' -c Recreate the chroot before building'
|
||||
echo ' -r <dir> Create chroots in this directory'
|
||||
exit 1
|
||||
}
|
||||
|
||||
while getopts 'cr:' arg; do
|
||||
case "${arg}" in
|
||||
c) clean_first=true ;;
|
||||
r) chroots="$OPTARG" ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$(uname -m)" == 'i686' -a "${arch}" != 'i686' ]; then
|
||||
echo 'You can only build i686 packages on this system'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ${clean_first} || [ ! -d "${chroots}/${repo}-${arch}" ]; then
|
||||
echo "Creating chroot for [${repo}] (${arch})..."
|
||||
sudo rm -rf ${chroots}/${repo}-${arch}
|
||||
sudo mkdir -p ${chroots}/${repo}-${arch}
|
||||
setarch ${arch} sudo mkarchroot \
|
||||
-C /usr/share/devtools/pacman-${repo}.conf \
|
||||
-M /usr/share/devtools/makepkg-${arch}.conf \
|
||||
${chroots}/${repo}-${arch}/root \
|
||||
base base-devel sudo
|
||||
fi
|
||||
|
||||
echo "Building in chroot for [${repo}] (${arch})..."
|
||||
setarch ${arch} sudo makechrootpkg -c -u -r ${chroots}/${repo}-${arch}
|
Loading…
Reference in New Issue