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

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