source: trunk/nagios-velvice/make-package-debian @ 244

Last change on this file since 244 was 244, checked in by g7moreau, 6 years ago
  • Add version and debug pkg script
  • Property svn:executable set to *
File size: 2.6 KB
Line 
1#!/bin/bash
2#
3# 2018/06/23 Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
4
5trap '[ -n "${tmp_folder}" -a -d "${tmp_folder}" ] && rm -rf "${tmp_folder}"' QUIT
6
7export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
8export LANG=C
9
10tmp_folder=$(mktemp --directory /tmp/nagios3-velvice-XXXXXX)
11[ -n "${tmp_folder}" -a -d "${tmp_folder}" ] || exit 1
12
13# Set Version
14VELVICE_VERSION=$(grep 'version->declare' velvice.cgi | cut -f 2 -d "'") #'
15LOCAL_VERSION=1
16
17# Create future tree
18mkdir -p ${tmp_folder}/etc/nagios3
19mkdir -p ${tmp_folder}/usr/lib/cgi-bin/nagios3
20mkdir -p ${tmp_folder}/usr/share/doc/nagios3-velvice
21mkdir -p ${tmp_folder}/usr/share/man/man1
22cp LICENSE.txt          ${tmp_folder}/usr/share/doc/nagios3-velvice/
23cp velvice.1.gz         ${tmp_folder}/usr/share/man/man1/
24cp velvice.cgi          ${tmp_folder}/usr/lib/cgi-bin/nagios3/
25cp velvice.sample.yml   ${tmp_folder}/etc/nagios3/
26
27# Data archive
28rm -f ${tmp_folder}/data.tar.gz
29(cd ${tmp_folder}; tar czf data.tar.gz ./usr ./etc)
30
31# Control file
32cat <<END > ${tmp_folder}/control
33Package: nagios3-velvice
34Version: ${VELVICE_VERSION}-${LOCAL_VERSION}
35Section: utils
36Tag: implemented-in::perl, interface::commandline, role::program
37Priority: optional
38Depends: perl, perl-base, libnagios-object-perl libhtml-parser-perl perl-modules liburi-encode-perl libcolor-calc-perl libyaml-syck-perl libhash-merge-perl
39Suggests: libyaml-shell-perl | yamllint, nagios3, nagios3-cgi
40Architecture: all
41Installed-Size: $(du -ks ${tmp_folder}|cut -f 1)
42Maintainer: Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
43Description: Nagios Velvice Alert Panel (CGI)
44 Nagios VELVICE is an acronym for "Nagios leVEL serVICE status".
45Homepage: http://servforge.legi.grenoble-inp.fr/projects/soft-trokata/wiki/SoftWare/NagiosVelvice
46END
47
48# Control archive
49rm -f ${tmp_folder}/control.tar.gz
50(cd ${tmp_folder}; tar czf control.tar.gz control)
51
52# Format deb package
53echo 2.0 > ${tmp_folder}/debian-binary
54
55# Create package (control before data)
56ar -r nagios3-velvice_${VELVICE_VERSION}-${LOCAL_VERSION}_all.deb ${tmp_folder}/debian-binary ${tmp_folder}/control.tar.gz ${tmp_folder}/data.tar.gz
57     
58# Clean
59rm -rf ${tmp_folder}
60
61# Prepare reprepro upload
62echo "# Prepare reprepro upload"
63echo "( cd /srv/www/debian/ ; reprepro includedeb wheezy   ~/wheezy/nagios3-velvice_${VELVICE_VERSION}-${LOCAL_VERSION}_all.deb )"
64echo "( cd /srv/www/debian/ ; reprepro includedeb jessie   ~/jessie/nagios3-velvice_${VELVICE_VERSION}-${LOCAL_VERSION}_all.deb )"
65echo "( cd /srv/www/debian/ ; reprepro includedeb stretch ~/stretch/nagios3-velvice_${VELVICE_VERSION}-${LOCAL_VERSION}_all.deb )"
66echo "( cd /srv/www/debian/ ; reprepro dumpreferences ) | grep -i nagios3-velvice"
Note: See TracBrowser for help on using the repository browser.