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

Last change on this file since 251 was 251, checked in by g7moreau, 6 years ago
  • Try to push better owner and right on package
  • Property svn:executable set to *
File size: 2.8 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=2
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/
26chmod ugo+rx         ${tmp_folder}/usr/lib/cgi-bin/nagios3/velvice.cgi
27chmod -R a+rX,go-w   ${tmp_folder}/usr
28chmod -R a+rX,go-w   ${tmp_folder}/etc
29
30# Data archive
31rm -f ${tmp_folder}/data.tar.gz
32(cd ${tmp_folder}; tar --owner root --group root czf data.tar.gz ./usr ./etc)
33
34# Control file
35cat <<END > ${tmp_folder}/control
36Package: nagios3-velvice
37Version: ${VELVICE_VERSION}-${LOCAL_VERSION}
38Section: utils
39Tag: implemented-in::perl, interface::commandline, role::program
40Priority: optional
41Depends: perl, perl-base, perl-modules, libnagios-object-perl, libhtml-parser-perl, liburi-encode-perl, libcolor-calc-perl, libyaml-syck-perl
42Suggests: libyaml-shell-perl | yamllint, nagios3, nagios3-cgi
43Architecture: all
44Installed-Size: $(du -ks ${tmp_folder}|cut -f 1)
45Maintainer: Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
46Description: Nagios Velvice Alert Panel (CGI)
47 Nagios VELVICE is an acronym for "Nagios leVEL serVICE status".
48Homepage: http://servforge.legi.grenoble-inp.fr/projects/soft-trokata/wiki/SoftWare/NagiosVelvice
49END
50
51# Control archive
52rm -f ${tmp_folder}/control.tar.gz
53(cd ${tmp_folder}; tar --owner root --group root czf control.tar.gz control)
54
55# Format deb package
56echo 2.0 > ${tmp_folder}/debian-binary
57
58# Create package (control before data)
59ar -r nagios3-velvice_${VELVICE_VERSION}-${LOCAL_VERSION}_all.deb ${tmp_folder}/debian-binary ${tmp_folder}/control.tar.gz ${tmp_folder}/data.tar.gz
60     
61# Clean
62rm -rf ${tmp_folder}
63
64# Prepare reprepro upload
65echo "# Prepare reprepro upload"
66echo "( cd /srv/www/debian/ ; reprepro includedeb wheezy   ~/wheezy/nagios3-velvice_${VELVICE_VERSION}-${LOCAL_VERSION}_all.deb )"
67echo "( cd /srv/www/debian/ ; reprepro includedeb jessie   ~/jessie/nagios3-velvice_${VELVICE_VERSION}-${LOCAL_VERSION}_all.deb )"
68echo "( cd /srv/www/debian/ ; reprepro includedeb stretch ~/stretch/nagios3-velvice_${VELVICE_VERSION}-${LOCAL_VERSION}_all.deb )"
69echo "( cd /srv/www/debian/ ; reprepro dumpreferences ) | grep -i nagios3-velvice"
Note: See TracBrowser for help on using the repository browser.