modified script for debian package
authorgandalf <gandalf@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 10 Jan 2008 01:38:06 +0000 (01:38 +0000)
committergandalf <gandalf@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 10 Jan 2008 01:38:06 +0000 (01:38 +0000)
git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@52 251d49ef-1d17-4917-a970-b30cf55b089b

12 files changed:
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/postinst [new file with mode: 0644]
debian/postrm [new file with mode: 0644]
debian/preinst [new file with mode: 0644]
debian/prometheus.control [new file with mode: 0644]
debian/prometheus.patch [new file with mode: 0644]
debian/rules [new file with mode: 0755]
prometheus-debian.old [new file with mode: 0755]
prometheus.debian

diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..9381195
--- /dev/null
@@ -0,0 +1,12 @@
+prometheus (0.7.7-2) stable; urgency=low
+
+  * Otestovani instalace a oprava chyb - prvni bastl ;-)
+
+ -- gandalf <gandalf@arachne.cz>  Thu,  10 Jan 2008 02:18:33 +0100
+
+prometheus (0.7.7-1) stable; urgency=low
+
+  * First debian package
+
+ -- gandalf <gandalf@arachne.cz>  Sat,  5 Jan 2008 15:45:42 +0100
+
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..887b6ca
--- /dev/null
@@ -0,0 +1,32 @@
+This package was debianized by gandalf <gandalf@arachne.cz> on
+Sat,  5 Jan 2008 15:45:42 +0100.
+
+It was downloaded from https://dev.arachne.cz/svn/prometheus/downloads
+
+Copyright:   GNU+ Copyright(G)2007, Michael Polak (xChaos)
+Credits: CZFree.Net, Netdave, aquarius
+          ...and Martin Devera (.cz) for his HTB qdisc (of course)
+          ...and Jakub Walczak (.pl) for providing feedback and patches
+          ...and Ing. Jiri Engelthaler (.cz) for bugfixes and Asus WL500 port
+          ...and Dial Telecom (slightly expensive ISP) for chance to test it
+
+
+License:
+
+   This package is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This package is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this package; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..f7ac787
--- /dev/null
@@ -0,0 +1,8 @@
+usr/sbin
+usr/share/man/man1
+usr/share/man/man5
+etc/default
+etc/init.d
+etc/cron.d
+etc/prometheus
+usr/share/doc/prometheus
diff --git a/debian/postinst b/debian/postinst
new file mode 100644 (file)
index 0000000..126ed07
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+# postinst script for prometheus
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+
+    /etc/prometheus/check-kernel-qos   
+
+    if [ -x "/etc/init.d/prometheus" ]; then
+       update-rc.d prometheus defaults 40 >/dev/null
+       /etc/init.d/prometheus restart
+    fi
+
+    ;;
+    
+    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
+
+
diff --git a/debian/postrm b/debian/postrm
new file mode 100644 (file)
index 0000000..0ac0e5e
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+# postrm script for prometheus
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge|remove|abort-install|disappear)
+    if [ -x "/etc/init.d/prometheus" ];then
+       /etc/init.d/prometheus stop
+       update-rc.d -f prometheus remove >/dev/null
+    fi
+    ;;
+    
+    upgrade|failed-upgrade|abort-upgrade)
+    ;;
+
+    *)
+        echo "postrm 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
+
+
diff --git a/debian/preinst b/debian/preinst
new file mode 100644 (file)
index 0000000..8cfb98a
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+# preinst script for prometheus
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <new-preinst> `install'
+#        * <new-preinst> `install' <old-version>
+#        * <new-preinst> `upgrade' <old-version>
+#        * <old-preinst> `abort-upgrade' <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    upgrade)
+    if [ -x "/etc/init.d/prometheus" ]; then
+       /etc/init.d/prometheus stop
+    fi
+    ;;
+    
+    install)
+    ;;
+
+    abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst 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
+
+
diff --git a/debian/prometheus.control b/debian/prometheus.control
new file mode 100644 (file)
index 0000000..8dfce36
--- /dev/null
@@ -0,0 +1,14 @@
+Source: __PACKAGE__
+Section: utils
+Priority: standard
+Maintainer: __MAINTAINER__
+Build-Depends: debhelper (>= 5)
+Standards-Version: __VERSION__
+Version: __VERSION__
+
+Package: __PACKAGE__
+Architecture: __ARCHITECTURE__
+Depends: iptables, iproute
+Recommends: iptables, iproute
+Description: Prometheus QoS (traffic shaper replacement for ISPs)
+
diff --git a/debian/prometheus.patch b/debian/prometheus.patch
new file mode 100644 (file)
index 0000000..2adf521
--- /dev/null
@@ -0,0 +1,24 @@
+--- prometheus.c       2008-01-09 12:38:16.000000000 +0100
++++ prometheus.c.deb   2008-01-09 15:51:48.098924554 +0100
+@@ -60,9 +60,9 @@
+ char *config="/etc/prometheus/prometheus.conf";   /* main configuration file */\r
+ char *hosts="/etc/prometheus/hosts";              /* line bandwidth definition file */\r
+ char *tc="/sbin/tc";                   /* requires tc with HTB support */\r
+-char *iptables="/usr/sbin/iptables";       /* requires iptables utility */\r
+-char *iptablessave="/usr/sbin/iptables-save"; /* new */\r
+-char *iptablesrestore="/usr/sbin/iptables-restore";  /* new */\r
++char *iptables="/sbin/iptables";       /* requires iptables utility */\r
++char *iptablessave="/sbin/iptables-save"; /* new */\r
++char *iptablesrestore="/sbin/iptables-restore";  /* new */\r
+ char *iptablesfile="/var/spool/prometheus.iptables";  /* new; file for iptables-restore*/\r
+ char *iptablespreamble="*mangle\n:PREROUTING ACCEPT [0:0]\n:POSTROUTING ACCEPT [0:0]\n:INPUT ACCEPT [0:0]\n:OUTPUT ACCEPT [0:0]\n:FORWARD ACCEPT [0:0]";\r
+ FILE *iptables_file=NULL;\r
+@@ -72,7 +72,7 @@
+ char *credit="/var/run/prometheus.credit";  /* credit log file */\r
+ int enable_credit=1;                   /* enable credit file */\r
+ int use_credit=0;                      /* use credit file (if enabled)*/\r
+-char *log_dir="/var/www/html/logs/";   /* log directory pathname */\r
++char *log_dir="/var/www/logs/";   /* log directory pathname */\r
+ char *log_url="logs/";                 /* log directory URL prefix */\r
+ char *title="Hall of Fame - Greatest Suckers"; /* hall of fame title */\r
+ int hall_of_fame=1;                          /* enable hall of fame */\r
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..7b5d313
--- /dev/null
@@ -0,0 +1,87 @@
+#!/usr/bin/make -f
+
+CC = gcc
+CFLAGS = -Wall -g
+
+bindir = /usr/sbin
+mandir = /usr/share/man
+sysconfdir = /etc
+destdir = $(CURDIR)/debian/prometheus
+docdir = /usr/share/doc
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+
+build: build-stamp
+
+build-stamp:
+       dh_testdir
+       $(CC) -o $(CURDIR)/prometheus $(CURDIR)/prometheus.c
+#      $(CC) -o $(CURDIR)/prometheus-monthly-stats $(CURDIR)/optional-tools/monthly-stats.c
+
+       touch $@
+
+clean: clean-dir
+
+clean-dir: 
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp
+       make clean      
+       dh_clean 
+       
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+       install -m 755 -o root -g root $(CURDIR)/prometheus $(destdir)$(bindir)
+#      install -m 755 -o root -g root $(CURDIR)prometheus-monthly-stats $(destdir)$(bindir)
+       install -m 644 -o root -g root $(CURDIR)/prometheus.1 $(destdir)$(mandir)/man1
+       install -m 644 -o root -g root $(CURDIR)/prometheus.conf.5 $(destdir)$(mandir)/man5
+       install -m 755 -o root -g root $(CURDIR)/conf/prometheus.init $(destdir)$(sysconfdir)/init.d/prometheus
+       install -m 644 -o root -g root $(CURDIR)/conf/prometheus.default $(destdir)$(sysconfdir)/default/prometheus
+       install -m 755 -o root -g root $(CURDIR)/conf/prometheus.cron $(destdir)$(sysconfdir)/cron.d/prometheus
+       install -m 600 -o root -g root $(CURDIR)/conf/prometheus.hosts $(destdir)$(sysconfdir)/prometheus/hosts
+       install -m 600 -o root -g root $(CURDIR)/conf/prometheus.conf $(destdir)$(sysconfdir)/prometheus/prometheus.conf
+       install -m 700 -o root -g root $(CURDIR)/check-kernel-qos $(destdir)$(sysconfdir)/prometheus
+       install -m 644 -o root -g root $(CURDIR)/README $(destdir)$(docdir)/prometheus
+       install -m 644 -o root -g root $(CURDIR)/CHANGELOG $(destdir)$(docdir)/prometheus
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs CHANGELOG
+#      dh_installdocs
+#      dh_installexamples
+#      dh_install
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+#      dh_installman
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+#      dh_perl
+#      dh_makeshlibs
+       dh_installdeb
+#      dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-arch
+.PHONY: build clean binary-arch binary install
diff --git a/prometheus-debian.old b/prometheus-debian.old
new file mode 100755 (executable)
index 0000000..99cd5ef
--- /dev/null
@@ -0,0 +1,94 @@
+#!/bin/bash
+
+MAINTAINER='Michael Polak <x@n.cz>'
+DEB_PCK_NAME=prometheus
+ARCHITECTURE=i386
+DEBIAN_BASE=$DEB_PCK_NAME.tmp
+
+# Adresare
+rm -r $DEBIAN_BASE 2>/dev/null
+mkdir -p $DEBIAN_BASE
+mkdir -p $DEBIAN_BASE/usr
+mkdir -p $DEBIAN_BASE/usr/sbin
+mkdir -p $DEBIAN_BASE/usr/share
+mkdir -p $DEBIAN_BASE/usr/share/man
+mkdir -p $DEBIAN_BASE/usr/share/man/man1
+mkdir -p $DEBIAN_BASE/usr/share/man/man5
+
+mkdir -p $DEBIAN_BASE/DEBIAN
+chmod 0755 $DEBIAN_BASE/DEBIAN
+
+if ! [ -x prometheus ]; then
+       make main
+fi
+
+# Copy
+cp prometheus          $DEBIAN_BASE/usr/sbin
+cp prometheus.1                $DEBIAN_BASE/usr/share/man/man1
+cp prometheus.conf.5   $DEBIAN_BASE/usr/share/man/man5
+cp -R etc              $DEBIAN_BASE/etc
+
+# .svn cleanup
+rm -rf $DEBIAN_BASE/etc/.svn
+rm -rf $DEBIAN_BASE/etc/*/.svn
+
+# Chmod a+x scripts
+chmod 755 $DEBIAN_BASE/etc/cron.d/prometheus
+chmod 755 $DEBIAN_BASE/etc/init.d/prometheus
+
+# Strip debug info from binary
+strip $DEBIAN_BASE/usr/sbin/prometheus
+
+# Zmeni uzivatele a skupinu
+chown -R root:root $DEBIAN_BASE
+
+# MD5 start
+find  $DEBIAN_BASE -type f -exec md5sum {} \; >> $DEBIAN_BASE/DEBIAN/_md5sum
+# odstraneni $DEBIAN_BASE z adresare
+sed -r "s:$DEBIAN_BASE::g" $DEBIAN_BASE/DEBIAN/_md5sum > $DEBIAN_BASE/DEBIAN/md5sum;
+rm $DEBIAN_BASE/DEBIAN/_md5sum
+# MD5 - end
+
+# Control file
+cp -R $DEB_PCK_NAME.control   $DEBIAN_BASE/DEBIAN/control
+if [ -f  $DEB_PCK_NAME'.postinst' ]; then
+       cp -R $DEB_PCK_NAME.postinst  $DEBIAN_BASE/DEBIAN/postinst
+fi
+if [ -f  $DEB_PCK_NAME'.preinst' ]; then
+       cp -R $DEB_PCK_NAME.preinst   $DEBIAN_BASE/DEBIAN/preinst
+fi
+if [ -f  $DEB_PCK_NAME'.conffiles' ]; then
+       cp -R $DEB_PCK_NAME.conffiles $DEBIAN_BASE/DEBIAN/conffiles
+fi
+if [ -f  $DEB_PCK_NAME'.prerm' ]; then
+       cp -R $DEB_PCK_NAME.prerm     $DEBIAN_BASE/DEBIAN/prerm
+fi
+if [ -f  $DEB_PCK_NAME'.postrm' ]; then
+       cp -R $DEB_PCK_NAME.postrm    $DEBIAN_BASE/DEBIAN/postrm
+fi
+
+# Cleanup
+for f in `find $DEBIAN_BASE/etc -path ".svn*"`
+do
+    rm -R $f 2>/dev/null
+done;
+
+# Momentalne se nepouziva
+#SIZEDU=`du -sk "$DEBIAN_BASE" | awk '{ print $1}'`
+#SIZEDIR=`find "$DEBIAN_BASE" -type d | wc | awk '{print $1}'`
+#SIZE=$[ $SIZEDU - $SIZEDIR ]
+
+# Verze
+VERSION=`grep "const char \*version" prometheus.c|cut -f 2 -d \"`
+
+# Control file
+sed     -e "s/__VERSION__/$VERSION/" \
+       -e "s/__PACKAGE__/$DEB_PCK_NAME/" \
+       -e "s/__MAINTAINER__/$MAINTAINER/" \
+       -e "s/__ARCHITECTURE__/$ARCHITECTURE/" \
+       $DEB_PCK_NAME.control > $DEBIAN_BASE/DEBIAN/control
+
+# Vytvori a prejmenuje balicek
+dpkg --build $DEBIAN_BASE
+dpkg-name -o $DEBIAN_BASE.deb
+rm -rf $DEBIAN_BASE
index 99cd5ef2dde1c1b5e4cf0977ee5c9d42cbfbb5d0..1f5308bdcdc11ae0efade74af25b33cef972a5a1 100755 (executable)
@@ -1,94 +1,17 @@
 #!/bin/bash
 
-MAINTAINER='Michael Polak <x@n.cz>'
-DEB_PCK_NAME=prometheus
-ARCHITECTURE=i386
-DEBIAN_BASE=$DEB_PCK_NAME.tmp
+arch=`dpkg-architecture -qDEB_HOST_ARCH`
+version=`grep VERSION Makefile | gawk -F= '{ print $2 }'`
+package=`grep PACKAGE Makefile | gawk -F= '{ print $2 }'`
+maintainer='gandalf <gandalf@arachne.cz>'
 
-# Adresare
-rm -r $DEBIAN_BASE 2>/dev/null
-mkdir -p $DEBIAN_BASE
-mkdir -p $DEBIAN_BASE/usr
-mkdir -p $DEBIAN_BASE/usr/sbin
-mkdir -p $DEBIAN_BASE/usr/share
-mkdir -p $DEBIAN_BASE/usr/share/man
-mkdir -p $DEBIAN_BASE/usr/share/man/man1
-mkdir -p $DEBIAN_BASE/usr/share/man/man5
+patch -Nl <debian/prometheus.patch
 
-mkdir -p $DEBIAN_BASE/DEBIAN
-chmod 0755 $DEBIAN_BASE/DEBIAN
+sed     -e "s/__ARCHITECTURE__/$arch/" \
+        -e "s/__VERSION__/$version/" \
+        -e "s/__PACKAGE__/$package/" \
+        -e "s/__MAINTAINER__/$maintainer/" \
+        debian/prometheus.control > debian/control
 
-if ! [ -x prometheus ]; then
-       make main
-fi
-
-# Copy
-cp prometheus          $DEBIAN_BASE/usr/sbin
-cp prometheus.1                $DEBIAN_BASE/usr/share/man/man1
-cp prometheus.conf.5   $DEBIAN_BASE/usr/share/man/man5
-cp -R etc              $DEBIAN_BASE/etc
-
-# .svn cleanup
-rm -rf $DEBIAN_BASE/etc/.svn
-rm -rf $DEBIAN_BASE/etc/*/.svn
-
-# Chmod a+x scripts
-chmod 755 $DEBIAN_BASE/etc/cron.d/prometheus
-chmod 755 $DEBIAN_BASE/etc/init.d/prometheus
-
-# Strip debug info from binary
-strip $DEBIAN_BASE/usr/sbin/prometheus
-
-# Zmeni uzivatele a skupinu
-chown -R root:root $DEBIAN_BASE
-
-# MD5 start
-find  $DEBIAN_BASE -type f -exec md5sum {} \; >> $DEBIAN_BASE/DEBIAN/_md5sum
-# odstraneni $DEBIAN_BASE z adresare
-sed -r "s:$DEBIAN_BASE::g" $DEBIAN_BASE/DEBIAN/_md5sum > $DEBIAN_BASE/DEBIAN/md5sum;
-rm $DEBIAN_BASE/DEBIAN/_md5sum
-# MD5 - end
-
-# Control file
-cp -R $DEB_PCK_NAME.control   $DEBIAN_BASE/DEBIAN/control
-if [ -f  $DEB_PCK_NAME'.postinst' ]; then
-       cp -R $DEB_PCK_NAME.postinst  $DEBIAN_BASE/DEBIAN/postinst
-fi
-if [ -f  $DEB_PCK_NAME'.preinst' ]; then
-       cp -R $DEB_PCK_NAME.preinst   $DEBIAN_BASE/DEBIAN/preinst
-fi
-if [ -f  $DEB_PCK_NAME'.conffiles' ]; then
-       cp -R $DEB_PCK_NAME.conffiles $DEBIAN_BASE/DEBIAN/conffiles
-fi
-if [ -f  $DEB_PCK_NAME'.prerm' ]; then
-       cp -R $DEB_PCK_NAME.prerm     $DEBIAN_BASE/DEBIAN/prerm
-fi
-if [ -f  $DEB_PCK_NAME'.postrm' ]; then
-       cp -R $DEB_PCK_NAME.postrm    $DEBIAN_BASE/DEBIAN/postrm
-fi
-
-# Cleanup
-for f in `find $DEBIAN_BASE/etc -path ".svn*"`
-do
-    rm -R $f 2>/dev/null
-done;
-
-# Momentalne se nepouziva
-#SIZEDU=`du -sk "$DEBIAN_BASE" | awk '{ print $1}'`
-#SIZEDIR=`find "$DEBIAN_BASE" -type d | wc | awk '{print $1}'`
-#SIZE=$[ $SIZEDU - $SIZEDIR ]
-
-# Verze
-VERSION=`grep "const char \*version" prometheus.c|cut -f 2 -d \"`
-
-# Control file
-sed     -e "s/__VERSION__/$VERSION/" \
-       -e "s/__PACKAGE__/$DEB_PCK_NAME/" \
-       -e "s/__MAINTAINER__/$MAINTAINER/" \
-       -e "s/__ARCHITECTURE__/$ARCHITECTURE/" \
-       $DEB_PCK_NAME.control > $DEBIAN_BASE/DEBIAN/control
-
-# Vytvori a prejmenuje balicek
-dpkg --build $DEBIAN_BASE
-dpkg-name -o $DEBIAN_BASE.deb
-rm -rf $DEBIAN_BASE
+dpkg-buildpackage
+                               
This page took 0.353929 seconds and 4 git commands to generate.