source: trunk/tssh/make-package-debian

Last change on this file was 429, checked in by g7moreau, 5 years ago
  • Better doc, better tag and description package
  • Property svn:executable set to *
File size: 3.3 KB
Line 
1#!/bin/bash
2#
3# 2019/11/25 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/tssh-XXXXXX)
11[ -n "${tmp_folder}" -a -d "${tmp_folder}" ] || exit 1
12
13# Set Name and Version
14PKG_NAME=tssh
15CODE_VERSION=$(grep '^VERSION=' tssh | cut -f 2 -d "'") # '
16PKG_VERSION=1
17
18# Create future tree
19mkdir -p ${tmp_folder}/usr/bin
20mkdir -p ${tmp_folder}/usr/share/man/man1
21mkdir -p ${tmp_folder}/usr/share/tssh
22mkdir -p ${tmp_folder}/etc/bash_completion.d
23cp tssh                 ${tmp_folder}/usr/bin/
24cp tssh.1.gz            ${tmp_folder}/usr/share/man/man1/
25cp LICENSE.txt          ${tmp_folder}/usr/share/tssh/
26cp config.sample.sh     ${tmp_folder}/usr/share/tssh/
27cp tssh.bash_completion ${tmp_folder}/etc/bash_completion.d/
28chmod -R a+rx        ${tmp_folder}/usr/bin/tssh
29chmod -R a+rX,go-w   ${tmp_folder}/usr
30chmod -R a+rX,go-w   ${tmp_folder}/etc
31
32# Data archive
33rm -f ${tmp_folder}/data.tar.gz
34(cd ${tmp_folder}; tar --owner root --group root -czf data.tar.gz ./usr ./etc)
35
36# Control file
37cat <<END > ${tmp_folder}/control
38Package: ${PKG_NAME}
39Version: ${CODE_VERSION}-${PKG_VERSION}
40Section: admin
41Tag: admin::cluster, implemented-in::bash, interface::commandline, interface::text-mode, network::client, protocol::ssh, role::program, use::login
42Priority: optional
43Depends: tmux, openssh-client, ncurses-bin, findutils, grep, wamerican | wfrench
44Suggests: nmap, parallel
45Architecture: all
46Installed-Size: $(du -ks ${tmp_folder}|cut -f 1)
47Maintainer: Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
48Description: administer multiple ssh shells simultaneously with tmux
49 tssh is an acronym for tmux ssh.
50 In practise, tssh is an ncurve version of cluster-ssh.
51 It has been used in the LEGI laboratory for over 5 years.
52 tssh is a small tool to launch command over many computers.
53 It allows you to control multiple ssh sessions from a single input window.
54 You can also configure clusters of machines for easy invocation
55 and interact with individual terminal windows during a session.
56 .
57 The tool is quite effective and tries to keep things simple.
58Homepage: http://servforge.legi.grenoble-inp.fr/projects/soft-trokata/wiki/SoftWare/tssh
59END
60
61# Control archive
62rm -f ${tmp_folder}/control.tar.gz
63(cd ${tmp_folder}; tar --owner root --group root -czf control.tar.gz control)
64
65# Format deb package
66echo 2.0 > ${tmp_folder}/debian-binary
67
68# Create package (control before data)
69ar -r ${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb ${tmp_folder}/debian-binary ${tmp_folder}/control.tar.gz ${tmp_folder}/data.tar.gz
70     
71# Clean
72rm -rf ${tmp_folder}
73
74# Prepare reprepro upload
75echo "# Prepare reprepro upload"
76echo "( cd /srv/www/debian/ ; reprepro includedeb wheezy   ~/wheezy/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
77echo "( cd /srv/www/debian/ ; reprepro includedeb jessie   ~/jessie/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
78echo "( cd /srv/www/debian/ ; reprepro includedeb stretch ~/stretch/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
79echo "( cd /srv/www/debian/ ; reprepro includedeb buster   ~/buster/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
80echo "( cd /srv/www/debian/ ; reprepro dumpreferences ) | grep -i tssh"
Note: See TracBrowser for help on using the repository browser.