Basic Debian package support in buildinstaller.sh

This commit is contained in:
Adam Ierymenko 2014-12-03 21:40:33 +00:00
parent 149dbff3ea
commit 4bf2fa3edb
5 changed files with 35 additions and 1 deletions

2
.gitignore vendored
View File

@ -27,6 +27,8 @@
*.obj
*.tlog
*.pid
/*.deb
/*.rpm
/build-*
/ZeroTierOneInstaller-*
.qmake.stash

View File

@ -31,12 +31,15 @@ case "$system" in
# Canonicalize $machine for some architectures... we use x86
# and x64 for Intel stuff. ARM and others should be fine if
# we ever ship officially for those.
debian_arch=$machine
case "$machine" in
i386|i486|i586|i686)
machine="x86"
debian_arch="i386"
;;
x86_64|amd64|x64)
machine="x64"
debian_arch="amd64"
;;
esac
@ -61,6 +64,22 @@ case "$system" in
rm -f build-installer-tmp.tar.gz
ls -l $targ
if [ -f /usr/bin/dpkg-deb -a "$UID" -eq 0 ]; then
echo
echo Found dpkg-deb and you are root, trying to build Debian package.
rm -rf build-installer-deb
debbase="build-installer-deb/zerotier-one_${vmajor}.${vminor}.${revision}_$debian_arch"
debfolder="${debbase}/DEBIAN"
mkdir -p $debfolder
cat 'ext/installfiles/linux/DEBIAN/control.in' | sed "s/__VERSION__/${vmajor}.${vminor}.${revision}/" >$debfolder/control
cp -f 'ext/installfiles/linux/DEBIAN/conffiles' "${debfolder}/conffiles"
mkdir -p "${debbase}/var/lib/zerotier-one"
cp -f $targ "${debbase}/var/lib/zerotier-one"
dpkg-deb --build $debbase
mv -f build-installer-deb/*.deb .
rm -rf build-installer-deb
fi
;;
Darwin)
@ -96,4 +115,6 @@ case "$system" in
esac
rm -rf build-installer
exit 0

View File

View File

@ -0,0 +1,11 @@
Package: zerotier-one
Architecture: any
Maintainer: ZeroTier Networks
Depends: curl
Priority: optional
Version: __VERSION__
Homepage: https://github.com/zerotier/ZeroTierOne
Description: ZeroTier One network virtualization service
ZeroTier One is a fast, secure, and easy to use peer to peer network
virtualization engine. Visit https://www.zerotier.com/ for more
information.

View File

@ -82,7 +82,7 @@ installer: one FORCE
./buildinstaller.sh
clean:
rm -rf $(OBJS) $(TESTNET_OBJS) node/*.o osnet/*.o control/*.o testnet/*.o *.o zerotier-* build-* ZeroTierOneInstaller-*
rm -rf $(OBJS) $(TESTNET_OBJS) node/*.o osnet/*.o control/*.o testnet/*.o *.o zerotier-* build-* ZeroTierOneInstaller-* *.deb *.rpm
debug: FORCE
make -j 4 ZT_DEBUG=1