part1 for Debian

This commit is contained in:
Jan-Piet Mens 2015-09-15 12:20:49 +02:00
parent 7a2bff9c51
commit 17d81c871c
2 changed files with 58 additions and 0 deletions

29
etc/debian/fpm-make.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
set -e
tempdir=$(mktemp -d /tmp/ot-XXX)
make install DESTDIR=$tempdir
name="ot-recorder"
version=$(awk '{print $NF;}' version.h | sed -e 's/"//g' )
arch=x86_64
debfile="/tmp/${name}_${version}_${arch}.deb"
rm -f "${debfile}"
fpm -s dir \
-t deb \
-n ${name} \
-v ${version} \
--vendor "OwnTracks.org" \
-a all \
--maintainer 'jpmens@gmail.com' \
-C $tempdir \
-p ${debfile} \
-d "libmosquitto1" \
-d "libcurl3" \
--post-install etc/debian/postinst \
usr var

29
etc/debian/postinst Normal file
View File

@ -0,0 +1,29 @@
#!/bin/sh
#
set -e
case "$1" in
configure)
getent group owntracks > /dev/null || /usr/sbin/groupadd -r owntracks
chgrp owntracks /var/spool/owntracks/recorder/store
chgrp owntracks /var/spool/owntracks/recorder/store/ghash
chgrp owntracks /usr/local/bin/ocat /usr/local/sbin/ot-recorder
chmod 3755 /usr/local/bin/ocat /usr/local/sbin/ot-recorder
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0