mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-27 08:22:31 +00:00
Preinst and postinst Debian scripts.
This commit is contained in:
parent
4bf2fa3edb
commit
059aaae7a9
@ -67,15 +67,33 @@ case "$system" in
|
|||||||
if [ -f /usr/bin/dpkg-deb -a "$UID" -eq 0 ]; then
|
if [ -f /usr/bin/dpkg-deb -a "$UID" -eq 0 ]; then
|
||||||
echo
|
echo
|
||||||
echo Found dpkg-deb and you are root, trying to build Debian package.
|
echo Found dpkg-deb and you are root, trying to build Debian package.
|
||||||
|
|
||||||
rm -rf build-installer-deb
|
rm -rf build-installer-deb
|
||||||
|
|
||||||
debbase="build-installer-deb/zerotier-one_${vmajor}.${vminor}.${revision}_$debian_arch"
|
debbase="build-installer-deb/zerotier-one_${vmajor}.${vminor}.${revision}_$debian_arch"
|
||||||
debfolder="${debbase}/DEBIAN"
|
debfolder="${debbase}/DEBIAN"
|
||||||
mkdir -p $debfolder
|
mkdir -p $debfolder
|
||||||
cat 'ext/installfiles/linux/DEBIAN/control.in' | sed "s/__VERSION__/${vmajor}.${vminor}.${revision}/" >$debfolder/control
|
|
||||||
|
cat 'ext/installfiles/linux/DEBIAN/control.in' | sed "s/__VERSION__/${vmajor}.${vminor}.${revision}/" | sed "s/__ARCH__/${debian_arch}/" >$debfolder/control
|
||||||
|
cat $debfolder/control
|
||||||
cp -f 'ext/installfiles/linux/DEBIAN/conffiles' "${debfolder}/conffiles"
|
cp -f 'ext/installfiles/linux/DEBIAN/conffiles' "${debfolder}/conffiles"
|
||||||
mkdir -p "${debbase}/var/lib/zerotier-one"
|
|
||||||
cp -f $targ "${debbase}/var/lib/zerotier-one"
|
mkdir -p "${debbase}/var/lib/zerotier-one/updates.d"
|
||||||
|
cp -f $targ "${debbase}/var/lib/zerotier-one/updates.d"
|
||||||
|
|
||||||
|
rm -f "${debfolder}/postinst" "${debfolder}/prerm"
|
||||||
|
|
||||||
|
echo '#!/bin/bash' >${debfolder}/postinst
|
||||||
|
echo "/var/lib/zerotier-one/updates.d/${targ}" >>${debfolder}/postinst
|
||||||
|
echo "/bin/rm -f /var/lib/zerotier-one/updates.d/*" >>${debfolder}/postinst
|
||||||
|
chmod a+x ${debfolder}/postinst
|
||||||
|
|
||||||
|
echo '#!/bin/bash' >${debfolder}/prerm
|
||||||
|
echo "/var/lib/zerotier-one/uninstall.sh" >>${debfolder}/prerm
|
||||||
|
chmod a+x ${debfolder}/prerm
|
||||||
|
|
||||||
dpkg-deb --build $debbase
|
dpkg-deb --build $debbase
|
||||||
|
|
||||||
mv -f build-installer-deb/*.deb .
|
mv -f build-installer-deb/*.deb .
|
||||||
rm -rf build-installer-deb
|
rm -rf build-installer-deb
|
||||||
fi
|
fi
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Package: zerotier-one
|
Package: zerotier-one
|
||||||
Architecture: any
|
Architecture: __ARCH__
|
||||||
Maintainer: ZeroTier Networks
|
Maintainer: ZeroTier Networks
|
||||||
Depends: curl
|
Depends: curl
|
||||||
Priority: optional
|
Priority: optional
|
||||||
|
Loading…
Reference in New Issue
Block a user