source: trunk/make-package-debian

Last change on this file was 403, checked in by g7moreau, 5 years ago
  • Better description
  • Property svn:executable set to *
File size: 3.8 KB
Line 
1#!/bin/bash
2#
3# 2018/10/02 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/klask-XXXXXX)
11[ -n "${tmp_folder}" -a -d "${tmp_folder}" ] || exit 1
12
13# Set Name and Version
14PKG_NAME=klask
15CODE_VERSION=$(grep 'version->declare' klask | cut -f 2 -d "'") #'
16PKG_VERSION=1
17
18# Create future tree
19mkdir -p ${tmp_folder}/usr/bin
20mkdir -p ${tmp_folder}/usr/lib/klask
21mkdir -p ${tmp_folder}/usr/share/man/man1
22mkdir -p ${tmp_folder}/usr/share/klask
23mkdir -p ${tmp_folder}/etc/klask
24mkdir -p ${tmp_folder}/etc/bash_completion.d
25cp klask                   ${tmp_folder}/usr/bin/
26cp push-web                ${tmp_folder}/usr/lib/klask/
27cp klask-wrapper           ${tmp_folder}/usr/lib/klask/
28cp klask.1.gz              ${tmp_folder}/usr/share/man/man1/
29cp LICENSE.txt             ${tmp_folder}/usr/share/klask/
30cp sorttable-klask.js      ${tmp_folder}/usr/share/klask/
31cp style-klask.css         ${tmp_folder}/usr/share/klask/
32cp klask-sample.conf       ${tmp_folder}/etc/klask/
33cp push-web-sample.conf    ${tmp_folder}/etc/klask/
34cp klask.cron              ${tmp_folder}/etc/klask/
35cp klask.bash_completion   ${tmp_folder}/etc/bash_completion.d/
36chmod -R a+rx,go-w   ${tmp_folder}/usr/bin/klask
37chmod -R a+rx,go-w   ${tmp_folder}/usr/lib/klask/push-web
38chmod -R a+rx,go-w   ${tmp_folder}/usr/lib/klask/klask-wrapper
39chmod -R a+rX,go-w   ${tmp_folder}/usr
40chmod -R a+rX,go-w   ${tmp_folder}/etc
41
42# Data archive
43rm -f ${tmp_folder}/data.tar.gz
44(cd ${tmp_folder}; tar --owner root --group root -czf data.tar.gz ./usr ./etc)
45
46# Control file
47cat <<END > ${tmp_folder}/control
48Package: ${PKG_NAME}
49Version: ${CODE_VERSION}-${PKG_VERSION}
50Section: utils
51Tag: implemented-in::perl, interface::commandline, role::program
52Priority: optional
53Depends: perl, perl-base, perl-modules, libnet-cidr-lite-perl, libnet-netmask-perl, libnet-snmp-perl, libnetaddr-ip-perl, libyaml-perl, libcrypt-des-perl, libcrypt-hcesha-perl, libdigest-hmac-perl, libtext-table-perl, snmp, arping, net-tools, fping, bind9-host, arpwatch
54Suggests: libyaml-shell-perl | yamllint, perl-doc
55Architecture: all
56Installed-Size: $(du -ks ${tmp_folder}|cut -f 1)
57Maintainer: Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
58Description: Klask maps your local network - Switches and Computers
59 Klask means search in Breton and that's exactly what we wanted.
60 Klask is a tool whose two main functions are:
61 * Find the connections between switches and draw a map of the
62   active hardware on the local network;
63 * Make an accurate inventory of the port and switch to which
64   the local network machines are connected.
65 Klask is a small tool, in the spirit of UNIX tools, to worry about
66 connections on the local network.
67Homepage: http://servforge.legi.grenoble-inp.fr/projects/klask
68END
69
70# Control archive
71rm -f ${tmp_folder}/control.tar.gz
72(cd ${tmp_folder}; tar --owner root --group root -czf control.tar.gz control)
73
74# Format deb package
75echo 2.0 > ${tmp_folder}/debian-binary
76
77# Create package (control before data)
78ar -r ${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb ${tmp_folder}/debian-binary ${tmp_folder}/control.tar.gz ${tmp_folder}/data.tar.gz
79     
80# Clean
81rm -rf ${tmp_folder}
82
83# Prepare reprepro upload
84echo "# Prepare reprepro upload"
85echo "( cd /srv/www/debian/ ; reprepro includedeb wheezy   ~/wheezy/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
86echo "( cd /srv/www/debian/ ; reprepro includedeb jessie   ~/jessie/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
87echo "( cd /srv/www/debian/ ; reprepro includedeb stretch ~/stretch/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
88echo "( cd /srv/www/debian/ ; reprepro dumpreferences ) | grep -i klask"
Note: See TracBrowser for help on using the repository browser.