mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-15 04:24:28 +01:00
Added a shell script to make a .deb package
This commit is contained in:
parent
e2507f86d5
commit
8ec6daf02a
41
packaging/make_deb
Executable file
41
packaging/make_deb
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script puts together a .deb package suitable for installing on an Ubuntu
|
||||
# system
|
||||
|
||||
B="/tmp/sshuttle/build"
|
||||
|
||||
if [ ! -x /usr/bin/dpkg ]; then
|
||||
echo 'Unable to build: dpkg not found on system'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the new directory structure
|
||||
mkdir -p ${B}/etc/sshuttle/pre-start.d
|
||||
mkdir -p ${B}/etc/sshuttle/post-stop.d
|
||||
mkdir -p ${B}/usr/share/sshuttle
|
||||
mkdir -p ${B}/usr/bin
|
||||
mkdir -p ${B}/etc/init
|
||||
mkdir -p ${B}/DEBIAN
|
||||
|
||||
# Copy over all of the files
|
||||
cp -r ../src/* ${B}/usr/share/sshuttle
|
||||
cp ../src/sshuttle ${B}/usr/bin
|
||||
cp -r sshuttle.conf ${B}/etc/init
|
||||
cp prefixes.conf ${B}/etc/sshuttle
|
||||
cp tunnel.conf ${B}/etc/sshuttle
|
||||
|
||||
# Copy the control file over, as well
|
||||
cp control ${B}/DEBIAN
|
||||
|
||||
# Create the md5sum manifest
|
||||
if [ -x /usr/bin/md5sum ]; then
|
||||
cd ${B}
|
||||
find . -type f | egrep -v DEBIAN | sed -re 's/^..//' | xargs md5sum > ${B}/DEBIAN/md5sums
|
||||
cd ${OLDPWD}
|
||||
fi
|
||||
|
||||
# Build the debian package
|
||||
VERSION=$(egrep -e '^Version' control | sed -re 's/^[^:]*: //')
|
||||
dpkg --build ${B} ./sshuttle-${VERSION}.deb
|
||||
rm -rf ${B}
|
Loading…
Reference in New Issue
Block a user