diff options
Diffstat (limited to 'deb.PKGBUILD')
-rw-r--r-- | deb.PKGBUILD | 85 |
1 files changed, 48 insertions, 37 deletions
diff --git a/deb.PKGBUILD b/deb.PKGBUILD index 61f848f97790..5f06162381d0 100644 --- a/deb.PKGBUILD +++ b/deb.PKGBUILD @@ -17,13 +17,13 @@ _pkgver='0.3.0' _tag_ver='v0.3.0' pkgver='autogenerated' #pkgver='autogenerated' -pkgrel=5 -#pkgrel=5 +pkgrel=6 +#pkgrel=6 _pkggopath="github.com/${_githuborg}/${_pkgname}" url="https://${_pkggopath}" license=() -makedepends=(dpkg git go skycoin-keyring glibc-2.27) -depends=(glibc-2.27) #need to compile against version <2.28-10 of libc6; error when runtime doesn't see at least the current version +makedepends=('dpkg' 'git' 'go' 'musl' 'kernel-headers-musl' 'skycoin-keyring') +depends=() _debdeps="reprepro" #_debdeps="" _scripts="skywire-deb-scripts" @@ -67,48 +67,52 @@ prepare() { } build() { - export GOPATH=${srcdir}/go - export GOBIN=${GOPATH}/bin.${_pkgarch} - export GOAPPS=${GOPATH}/apps.${_pkgarch} -#create read only cache binary + +export GOPATH=${srcdir}/go +export GOBIN=${GOPATH}/bin.${_pkgarch} +export GOAPPS=${GOPATH}/apps.${_pkgarch} +export CC=musl-gcc #export GOOS=linux -#export GOARCH=arm64 -#${_buildwith} -go build -o $GOBIN/ ${_scripts}/readonlycache.go +#export GOARCH=amd64 + +#create read only cache binary +go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOBIN/ ${_scripts}/readonlycache.go +#create the skywire binaries +cd ${srcdir}/go/src/${_pkggopath} _cmddir=${srcdir}/go/src/${_pkggopath}/cmd #using go build for determinism -msg2 'building skychat binary' +_msg2 'building skychat binary' cd ${_cmddir}/apps/skychat -go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOAPPS/ . -msg2 'building skysocks binary' +go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOAPPS/ . +_msg2 'building skysocks binary' cd ${_cmddir}/apps/skysocks -go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOAPPS/ . -msg2 'building skysocks-client binary' +go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOAPPS/ . +_msg2 'building skysocks-client binary' cd ${_cmddir}/apps/skysocks-client -go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOAPPS/ . -msg2 'building vpn-client binary' +go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOAPPS/ . +_msg2 'building vpn-client binary' cd ${_cmddir}/apps/vpn-client -go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOAPPS/ . -msg2 'building vpn-server binary' +go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOAPPS/ . +_msg2 'building vpn-server binary' cd ${_cmddir}/apps/vpn-server -go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOAPPS/ . -msg2 'building skywire-visor binary' +go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOAPPS/ . +_msg2 'building skywire-visor binary' cd ${_cmddir}/skywire-visor -go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ . -msg2 'building skywire-cli binary' +go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOBIN/ . +_msg2 'building skywire-cli binary' cd ${_cmddir}/skywire-cli -go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ . -msg2 'building setup-node binary' +go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOBIN/ . +_msg2 'building setup-node binary' cd ${_cmddir}/setup-node -go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ . -#msg2 'building hypervisor binary' #hypervisor has been combined with the visor +go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOBIN/ . +#_msg2 'building hypervisor binary' #hypervisor has been combined with the visor #cd ${_cmddir}/hypervisor #go build -trimpath -ldflags '-extldflags ${LDFLAGS}' -ldflags=-buildid= -o $GOBIN/ . #binary transparency cd $GOBIN -msg2 'binary sha256sums' +_msg2 'binary sha256sums' sha256sum $(ls) cd $GOAPPS sha256sum $(ls) @@ -136,7 +140,7 @@ echo "Description: package for the hypervisor key" >> ${srcdir}/${_pkgarch}.hype } package() { -msg2 'creating dirs' +_msg2 'creating dirs' #set up to create a .deb package _debpkgdir=${_pkgname}-${pkgver}-${pkgrel}-${_pkgarch} _pkgdir=${pkgdir}/${_debpkgdir} @@ -150,30 +154,30 @@ mkdir -p ${_pkgdir}/${_skydir}/dmsgpty mkdir -p ${_pkgdir}/${_skydir}/${_pkgname} mkdir -p ${_pkgdir}/${_skydir}/transport_logs -msg2 'installing binaries' +_msg2 'installing binaries' #loop to install the binaries _skywirebins=$( ls ${srcdir}/go/bin.${_pkgarch} ) for i in ${_skywirebins}; do - msg2 "$i" + _msg2 "$i" install -Dm755 ${srcdir}/go/bin.${_pkgarch}/${i} ${_pkgdir}/${_skydir}/bin/${i} ln -rTsf ${_pkgdir}/${_skydir}/bin/${i} ${_pkgdir}/usr/bin/${i} done #check -#msg2 'testing `skywire-cli visor gen-config --help`' +#_msg2 'testing `skywire-cli visor gen-config --help`' #${pkgdir}/opt/skywire/bin/skywire-cli visor gen-config --help -msg2 'installing apps' +_msg2 'installing apps' #loop to install the apps _skywireapps=$( ls ${srcdir}/go/apps.${_pkgarch} ) for i in ${_skywireapps}; do - msg2 "$i" + _msg2 "$i" install -Dm755 ${srcdir}/go/apps.${_pkgarch}/${i} ${_pkgdir}/${_skydir}/apps/${i} ln -rTsf ${_pkgdir}/${_skydir}/apps/${i} ${_pkgdir}/usr/bin/${i} done -msg2 'installing scripts and systemd services' +_msg2 'installing scripts and systemd services' #install the satellite package build script and elements for distributing the hypervisor key install -Dm755 ${srcdir}/${_scripts}/keypkg-gen.sh ${pkgdir}/usr/bin/keypkg-gen install -Dm755 ${srcdir}/${_pkgarch}.hypervisorkey.control ${pkgdir}/opt/${_pkgname}/hypervisorkey/DEBIAN/control @@ -209,7 +213,7 @@ install -Dm755 ${srcdir}/${_scripts}/keypkg-gen.sh ${_pkgdir}/usr/bin/keypkg-gen install -Dm755 ${srcdir}/${_pkgarch}.control ${_pkgdir}/DEBIAN/control install -Dm755 ${srcdir}/${_scripts}/postinst.sh ${_pkgdir}/DEBIAN/postinst -msg2 'creating the debian package' +_msg2 'creating the debian package' #create the debian package cd $pkgdir dpkg-deb --build ${_debpkgdir} @@ -217,3 +221,10 @@ mv *.deb ../../ #exit so the arch package doesn't get built exit } + + +_msg2() { + (( QUIET )) && return + local mesg=$1; shift + printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" +} |