source: trunk/tssh/make-package-debian @ 420

Last change on this file since 420 was 420, checked in by g7moreau, 5 years ago
  • Add everything to build a Debian package
  • Property svn:executable set to *
File size: 2.8 KB
RevLine 
[223]1#!/bin/bash
2#
[420]3# 2019/11/25 Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
[223]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
[420]10tmp_folder=$(mktemp --directory /tmp/tssh-XXXXXX)
[223]11[ -n "${tmp_folder}" -a -d "${tmp_folder}" ] || exit 1
12
[253]13# Set Name and Version
[420]14PKG_NAME=tssh
15CODE_VERSION=$(grep '^VERSION=' tssh | cut -f 2 -d "'") # '
[335]16PKG_VERSION=1
[223]17
18# Create future tree
19mkdir -p ${tmp_folder}/usr/bin
20mkdir -p ${tmp_folder}/usr/share/man/man1
[420]21mkdir -p ${tmp_folder}/usr/share/tssh
[223]22mkdir -p ${tmp_folder}/etc/bash_completion.d
[420]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
[253]29chmod -R a+rX,go-w   ${tmp_folder}/usr
30chmod -R a+rX,go-w   ${tmp_folder}/etc
[223]31
32# Data archive
33rm -f ${tmp_folder}/data.tar.gz
[253]34(cd ${tmp_folder}; tar --owner root --group root -czf data.tar.gz ./usr ./etc)
[223]35
36# Control file
37cat <<END > ${tmp_folder}/control
[253]38Package: ${PKG_NAME}
39Version: ${CODE_VERSION}-${PKG_VERSION}
[223]40Section: utils
[420]41Tag: implemented-in::bash, interface::commandline, role::program
[223]42Priority: optional
[420]43Depends: tmux, openssh-client, ncurses-bin, findutils, grep
44Suggests: nmap, parallel
[226]45Architecture: all
[223]46Installed-Size: $(du -ks ${tmp_folder}|cut -f 1)
47Maintainer: Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
[420]48Description: tmux cluster ssh
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 luanch command over many computers.
[230]53 .
[420]54 The tool is quite effective and tries to keep things simple.
55Homepage: http://servforge.legi.grenoble-inp.fr/projects/soft-trokata/wiki/SoftWare/tssh
[223]56END
57
58# Control archive
59rm -f ${tmp_folder}/control.tar.gz
[253]60(cd ${tmp_folder}; tar --owner root --group root -czf control.tar.gz control)
[223]61
62# Format deb package
63echo 2.0 > ${tmp_folder}/debian-binary
64
65# Create package (control before data)
[253]66ar -r ${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb ${tmp_folder}/debian-binary ${tmp_folder}/control.tar.gz ${tmp_folder}/data.tar.gz
[223]67     
68# Clean
69rm -rf ${tmp_folder}
70
71# Prepare reprepro upload
72echo "# Prepare reprepro upload"
[253]73echo "( cd /srv/www/debian/ ; reprepro includedeb wheezy   ~/wheezy/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
74echo "( cd /srv/www/debian/ ; reprepro includedeb jessie   ~/jessie/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
75echo "( cd /srv/www/debian/ ; reprepro includedeb stretch ~/stretch/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_all.deb )"
[420]76echo "( cd /srv/www/debian/ ; reprepro dumpreferences ) | grep -i tssh"
Note: See TracBrowser for help on using the repository browser.