2013-11-24 03:42:50 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-10-20 02:09:22 +02:00
|
|
|
# IMPORTANT
|
2017-09-14 13:33:27 +02:00
|
|
|
# Protect against misspelling a var and rm -rf /
|
2013-11-24 03:42:50 +01:00
|
|
|
set -u
|
|
|
|
set -e
|
|
|
|
|
|
|
|
SRC=/tmp/etherpad-deb-src
|
|
|
|
DIST=/tmp/etherpad-deb-dist
|
|
|
|
SYSROOT=${SRC}/sysroot
|
|
|
|
DEBIAN=${SRC}/DEBIAN
|
|
|
|
|
|
|
|
rm -rf ${DIST}
|
|
|
|
mkdir -p ${DIST}/
|
|
|
|
|
|
|
|
rm -rf ${SRC}
|
2013-11-24 13:41:12 +01:00
|
|
|
rsync -a bin/deb-src/ ${SRC}/
|
2013-11-24 03:42:50 +01:00
|
|
|
mkdir -p ${SYSROOT}/opt/
|
|
|
|
|
2013-11-24 13:41:12 +01:00
|
|
|
rsync --exclude '.git' -a . ${SYSROOT}/opt/etherpad/ --delete
|
2013-11-24 14:13:29 +01:00
|
|
|
mkdir -p ${SYSROOT}/usr/share/doc
|
2013-11-24 14:08:26 +01:00
|
|
|
cp README.md ${SYSROOT}/usr/share/doc/etherpad
|
2013-11-24 03:42:50 +01:00
|
|
|
find ${SRC}/ -type d -exec chmod 0755 {} \;
|
|
|
|
find ${SRC}/ -type f -exec chmod go-w {} \;
|
|
|
|
chown -R root:root ${SRC}/
|
|
|
|
|
|
|
|
let SIZE=`du -s ${SYSROOT} | sed s'/\s\+.*//'`+8
|
|
|
|
pushd ${SYSROOT}/
|
|
|
|
tar czf ${DIST}/data.tar.gz [a-z]*
|
|
|
|
popd
|
|
|
|
sed s"/SIZE/${SIZE}/" -i ${DEBIAN}/control
|
|
|
|
pushd ${DEBIAN}
|
|
|
|
tar czf ${DIST}/control.tar.gz *
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd ${DIST}/
|
|
|
|
echo 2.0 > ./debian-binary
|
|
|
|
|
|
|
|
find ${DIST}/ -type d -exec chmod 0755 {} \;
|
|
|
|
find ${DIST}/ -type f -exec chmod go-w {} \;
|
|
|
|
chown -R root:root ${DIST}/
|
|
|
|
ar r ${DIST}/etherpad-1.deb debian-binary control.tar.gz data.tar.gz
|
|
|
|
popd
|
|
|
|
rsync -a ${DIST}/etherpad-1.deb ./
|