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

Last change on this file since 342 was 322, checked in by g7moreau, 6 years ago
  • Add refreshments config for the web page
  • Property svn:executable set to *
File size: 3.1 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 Name and Version
14PKG_NAME=nagios3-velvice
15CODE_VERSION=$(grep 'version->declare' velvice.cgi | cut -f 2 -d "'") #'
16PKG_VERSION=1
17
18# Create future tree
19mkdir -p ${tmp_folder}/etc/nagios3/stylesheets
20mkdir -p ${tmp_folder}/usr/lib/cgi-bin/nagios3
21mkdir -p ${tmp_folder}/usr/share/doc/nagios3-velvice
22mkdir -p ${tmp_folder}/usr/share/man/man1
23cp LICENSE.txt          ${tmp_folder}/usr/share/doc/nagios3-velvice/
24cp velvice.html         ${tmp_folder}/usr/share/doc/nagios3-velvice/
25cp velvice.sample.yml   ${tmp_folder}/usr/share/doc/nagios3-velvice/
26cp velvice.1.gz         ${tmp_folder}/usr/share/man/man1/
27cp velvice.cgi          ${tmp_folder}/usr/lib/cgi-bin/nagios3/
28cp velvice.sample.yml   ${tmp_folder}/etc/nagios3/
29cp velvice.css          ${tmp_folder}/etc/nagios3/stylesheets/
30chmod ugo+rx         ${tmp_folder}/usr/lib/cgi-bin/nagios3/velvice.cgi
31chmod -R a+rX,go-w   ${tmp_folder}/usr
32chmod -R a+rX,go-w   ${tmp_folder}/etc
33
34# Data archive
35rm -f ${tmp_folder}/data.tar.gz
36(cd ${tmp_folder}; tar --owner root --group root -czf data.tar.gz ./usr ./etc)
37
38# Control file
39cat <<END > ${tmp_folder}/control
40Package: ${PKG_NAME}
41Version: ${CODE_VERSION}-${PKG_VERSION}
42Section: utils
43Tag: implemented-in::perl, interface::commandline, role::program
44Priority: optional
45Depends: perl, perl-base, perl-modules, libnagios-object-perl, libhtml-parser-perl, liburi-encode-perl, libcolor-calc-perl, libyaml-syck-perl, libdatetime-event-recurrence-perl, libdatetime-set-perl
46Suggests: libyaml-shell-perl | yamllint, nagios3, nagios3-cgi
47Architecture: all
48Installed-Size: $(du -ks ${tmp_folder}|cut -f 1)
49Maintainer: Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
50Description: Nagios Velvice Alert Panel (CGI)
51 Nagios VELVICE is an acronym for "Nagios leVEL serVICE status".
52Homepage: http://servforge.legi.grenoble-inp.fr/projects/soft-trokata/wiki/SoftWare/NagiosVelvice
53END
54
55# Control archive
56rm -f ${tmp_folder}/control.tar.gz
57(cd ${tmp_folder}; tar --owner root --group root -czf control.tar.gz control)
58
59# Format deb package
60echo 2.0 > ${tmp_folder}/debian-binary
61
62# Create package (control before data)
63ar -r ${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb ${tmp_folder}/debian-binary ${tmp_folder}/control.tar.gz ${tmp_folder}/data.tar.gz
64     
65# Clean
66rm -rf ${tmp_folder}
67
68# Prepare reprepro upload
69echo "# Prepare reprepro upload"
70echo "( cd /srv/www/debian/ ; reprepro includedeb wheezy   ~/wheezy/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
71echo "( cd /srv/www/debian/ ; reprepro includedeb jessie   ~/jessie/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
72echo "( cd /srv/www/debian/ ; reprepro includedeb stretch ~/stretch/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
73echo "( cd /srv/www/debian/ ; reprepro dumpreferences ) | grep -i nagios3-velvice"
Note: See TracBrowser for help on using the repository browser.