reorganisation of sample configuration files
[svn/Prometheus-QoS/.git] / prometheus.debian
CommitLineData
ab783510 1#!/bin/bash
2
3MAINTAINER='Michael Polak <x@n.cz>'
4DEB_PCK_NAME=prometheus
bd11df9e 5ARCHITECTURE=i386
ab783510 6DEBIAN_BASE=$DEB_PCK_NAME.tmp
7
8# Adresare
9rm -r $DEBIAN_BASE 2>/dev/null
10mkdir -p $DEBIAN_BASE
11mkdir -p $DEBIAN_BASE/usr
12mkdir -p $DEBIAN_BASE/usr/sbin
13mkdir -p $DEBIAN_BASE/usr/share
14mkdir -p $DEBIAN_BASE/usr/share/man
15mkdir -p $DEBIAN_BASE/usr/share/man/man1
16mkdir -p $DEBIAN_BASE/usr/share/man/man5
ab783510 17
18mkdir -p $DEBIAN_BASE/DEBIAN
19chmod 0755 $DEBIAN_BASE/DEBIAN
20
21if ! [ -x prometheus ]; then
22 make main
23fi
24
e1614f4e 25# Copy
ab783510 26cp prometheus $DEBIAN_BASE/usr/sbin
27cp prometheus.1 $DEBIAN_BASE/usr/share/man/man1
28cp prometheus.conf.5 $DEBIAN_BASE/usr/share/man/man5
e1614f4e 29cp -R etc $DEBIAN_BASE/etc
30
31# .svn cleanup
32rm -rf $DEBIAN_BASE/etc/.svn
33rm -rf $DEBIAN_BASE/etc/*/.svn
34
35# Chmod a+x scripts
36chmod 755 $DEBIAN_BASE/etc/cron.d/prometheus
37chmod 755 $DEBIAN_BASE/etc/init.d/prometheus
ab783510 38
39# Strip debug info from binary
40strip $DEBIAN_BASE/usr/sbin/prometheus
41
42# Zmeni uzivatele a skupinu
43chown -R root:root $DEBIAN_BASE
44
45# MD5 start
46find $DEBIAN_BASE -type f -exec md5sum {} \; >> $DEBIAN_BASE/DEBIAN/_md5sum
47# odstraneni $DEBIAN_BASE z adresare
48sed -r "s:$DEBIAN_BASE::g" $DEBIAN_BASE/DEBIAN/_md5sum > $DEBIAN_BASE/DEBIAN/md5sum;
49rm $DEBIAN_BASE/DEBIAN/_md5sum
50# MD5 - end
51
52# Control file
53cp -R $DEB_PCK_NAME.control $DEBIAN_BASE/DEBIAN/control
54if [ -f $DEB_PCK_NAME'.postinst' ]; then
55 cp -R $DEB_PCK_NAME.postinst $DEBIAN_BASE/DEBIAN/postinst
56fi
57if [ -f $DEB_PCK_NAME'.preinst' ]; then
58 cp -R $DEB_PCK_NAME.preinst $DEBIAN_BASE/DEBIAN/preinst
59fi
60if [ -f $DEB_PCK_NAME'.conffiles' ]; then
61 cp -R $DEB_PCK_NAME.conffiles $DEBIAN_BASE/DEBIAN/conffiles
62fi
63if [ -f $DEB_PCK_NAME'.prerm' ]; then
64 cp -R $DEB_PCK_NAME.prerm $DEBIAN_BASE/DEBIAN/prerm
65fi
66if [ -f $DEB_PCK_NAME'.postrm' ]; then
67 cp -R $DEB_PCK_NAME.postrm $DEBIAN_BASE/DEBIAN/postrm
68fi
69
e1614f4e 70# Cleanup
71for f in `find $DEBIAN_BASE/etc -path ".svn*"`
72do
73 rm -R $f 2>/dev/null
74done;
ab783510 75
76# Momentalne se nepouziva
77#SIZEDU=`du -sk "$DEBIAN_BASE" | awk '{ print $1}'`
78#SIZEDIR=`find "$DEBIAN_BASE" -type d | wc | awk '{print $1}'`
79#SIZE=$[ $SIZEDU - $SIZEDIR ]
80
81# Verze
82VERSION=`grep "const char \*version" prometheus.c|cut -f 2 -d \"`
83
84# Control file
85sed -e "s/__VERSION__/$VERSION/" \
86 -e "s/__PACKAGE__/$DEB_PCK_NAME/" \
87 -e "s/__MAINTAINER__/$MAINTAINER/" \
bd11df9e 88 -e "s/__ARCHITECTURE__/$ARCHITECTURE/" \
ab783510 89 $DEB_PCK_NAME.control > $DEBIAN_BASE/DEBIAN/control
90
91# Vytvori a prejmenuje balicek
92dpkg --build $DEBIAN_BASE
93dpkg-name -o $DEBIAN_BASE.deb
94rm -rf $DEBIAN_BASE
This page took 0.154627 seconds and 4 git commands to generate.