diff options
-rwxr-xr-x | .gitignore | 2 | ||||
-rwxr-xr-x | buildinstaller.sh | 21 | ||||
-rw-r--r-- | ext/installfiles/linux/DEBIAN/conffiles | 0 | ||||
-rw-r--r-- | ext/installfiles/linux/DEBIAN/control.in | 11 | ||||
-rw-r--r-- | make-linux.mk | 2 |
5 files changed, 35 insertions, 1 deletions
@@ -27,6 +27,8 @@ *.obj *.tlog *.pid +/*.deb +/*.rpm /build-* /ZeroTierOneInstaller-* .qmake.stash diff --git a/buildinstaller.sh b/buildinstaller.sh index 681e0db5..69ff0310 100755 --- a/buildinstaller.sh +++ b/buildinstaller.sh @@ -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 diff --git a/ext/installfiles/linux/DEBIAN/conffiles b/ext/installfiles/linux/DEBIAN/conffiles new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/ext/installfiles/linux/DEBIAN/conffiles diff --git a/ext/installfiles/linux/DEBIAN/control.in b/ext/installfiles/linux/DEBIAN/control.in new file mode 100644 index 00000000..c2927120 --- /dev/null +++ b/ext/installfiles/linux/DEBIAN/control.in @@ -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. diff --git a/make-linux.mk b/make-linux.mk index 60b0b9c3..2033e35c 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -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 |