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