# Contributor: Ɓukasz Jendrysik # Contributor: William Pitcock # Contributor: Jakub Jirutka # Maintainer: Natanael Copa setvar pkgname = 'lxc' setvar pkgver = '2.1.0' setvar _pkgver = ${pkgver/_rc/.rc} setvar pkgrel = '0' setvar pkgdesc = ""Userspace interface for the Linux kernel containment features"" setvar url = ""https://linuxcontainers.org/lxc/"" setvar arch = ""all"" setvar license = ""GPL"" setvar depends = ""gzip"" setvar depends_dev = ""libcap-dev"" setvar makedepends = ""$depends_dev lvm2 util-linux automake autoconf libtool lua5.2-dev linux-headers bash tar docbook2x libseccomp-dev python3-dev dnsmasq"" setvar options = ""suid"" setvar subpackages = ""$pkgname-dev $pkgname-doc $pkgname-lvm::noarch lua5.2-lxc:_lua52 $pkgname-download:_download:noarch $pkgname-templates::noarch $pkgname-libs py3-$pkgname:_py3 $pkgname-bridge"" setvar source = ""https://github.com/lxc/lxc/archive/lxc-$_pkgver.tar.gz version.patch lxc.initd lxc.conf download-template-tmpfs.patch "" setvar builddir = ""$srcdir/lxc-lxc-$_pkgver"" setvar _tmpldir = ""usr/share/lxc/templates"" proc prepare { default_prepare ./autogen.sh } proc build { cd $builddir' LUA_VERSION=5.2' \ ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --disable-apparmor \ --enable-lua \ --enable-python \ --with-lua-pc=lua5.2 \ --with-distro=alpine \ --disable-werror make VERSION=$pkgver } proc check { cd $builddir make check } proc package { cd $builddir make DESTDIR="$pkgdir" install install -Dm755 "$srcdir"/lxc.initd "$pkgdir"/etc/init.d/lxc install -d "$pkgdir"/var/lib/lxc # XXX: workaround for https://github.com/lxc/lxc/issues/1095. install -Dm644 "$srcdir"/lxc.conf "$pkgdir"/etc/lxc/lxc.conf # Remove useless config for SysVinit. rm -r "$pkgdir"/etc/default } proc lvm { setvar pkgdesc = ""LVM support for LXC"" setvar depends = ""lvm2 util-linux lxc"" mkdir $subpkgdir } proc _lua52 { setvar pkgdesc = ""Lua 5.2 module for LXC"" local dir; for dir in lib share { mkdir -p "$subpkgdir"/usr/$dir mv "$pkgdir"/usr/$dir/lua "$subpkgdir"/usr/$dir/ } } proc _py3 { setvar pkgdesc = ""Python3 module for LXC"" setvar depends = ""python3"" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/python3.* "$subpkgdir"/usr/lib } proc _download { setvar pkgdesc = ""LXC container image downloader template"" setvar depends = ""$pkgname gnupg tar xz wget"" mkdir -p "$subpkgdir"/$_tmpldir mv "$pkgdir"/$_tmpldir/lxc-download "$subpkgdir"/$_tmpldir/ } proc templates { setvar pkgdesc = ""Templates for LXC (except alpine and download)"" setvar depends = ""bash tar"" mkdir -p "$subpkgdir"/$_tmpldir mv "$pkgdir"/$_tmpldir/* "$subpkgdir"/$_tmpldir/ # Keep alpine template in the base package (doesn't need bash or GNU tar). mv "$subpkgdir"/$_tmpldir/lxc-alpine "$pkgdir"/$_tmpldir/ } proc dev { default_dev # fix abuild smartness mv "$subpkgdir"/usr/bin/lxc-config "$pkgdir"/usr/bin/ } proc bridge { setvar depends = ""dnsmasq"" setvar pkgdesc = ""Bridge interface for LXC with dhcp"" mkdir -p "$subpkgdir"/etc/conf.d \ "$subpkgdir"/etc/init.d \ "$subpkgdir"/etc/lxc ln -s dnsmasq "$subpkgdir"/etc/init.d/dnsmasq.lxcbr0 cat >>"$subpkgdir"/etc/conf.d/dnsmasq.lxcbr0 <<< """ BRIDGE_ADDR="10.0.3.1" BRIDGE_NETMASK="255.255.255.0" BRIDGE_NETWORK="10.0.3.0/24" BRIDGE_DHCP_RANGE="10.0.3.2,10.0.3.254" BRIDGE_DHCP_MAX="253" BRIDGE_MAC="00:16:3e:00:00:00" DNSMASQ_CONFFILE="/etc/lxc/dnsmasq.conf" """ cat >>"$subpkgdir"/etc/lxc/dnsmasq.conf <<< """ #dhcp-host=somehost,10.0.3.3 #dhcp-host=otherhost,10.0.3.4 """ cat >>"$subpkgdir"/etc/conf.d/lxc <<< """ rc_need="dnsmasq.lxcbr0" """ } setvar sha512sums = ""91309bb0e3db894f3bb29805d90f4617521e8dc980229d4626dfb73ce34c57803a3d04bb8a06c99c350cc69bef966f410acb5ffa14a361d7f6969f96c07214ba lxc-2.1.0.tar.gz e2ffcbf55447291a8434a4f37255c3a6a119bc4116c75d205006aa2b070bf6be28535cf6107bead14bbf64bf9fa415346ab544bd1c15e1add7d1c6380e6b2def version.patch 1037e0b773553aa04b619cec7cfc8fa504af830e58c8211eda367da7e36aeb88f45fca1f955a08fc4fa3f9da660017d5fe7145a326a2064cf15e24d1772d9e27 lxc.initd 5b83b0323e58bf00bd1e124c265729499cee97559b6fe18482962e3bed50d121b4c7a09f25cbce7b1e18d4234627bc4b4581ba2060e33cd022f105b4429cef01 lxc.conf 02fd192d137cbb5b6db6959275387d05653f41dad5a5e46ae9b53cacead8cef937733927284658d3f0b910de81f9364c7f0248db990efd88806cf3029264c214 download-template-tmpfs.patch""