source: trunk/ddt/make-package-debian @ 230

Last change on this file since 230 was 230, checked in by g7moreau, 6 years ago
  • Multi line ins package desciption
  • Property svn:executable set to *
File size: 3.2 KB
Line 
1#!/bin/bash
2#
3# 2018/06/19 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/ddt-XXXXXX)
11[ -n "${tmp_folder}" -a -d "${tmp_folder}" ] || exit 1
12
13# Set Version
14DDT_VERSION=$(grep 'version->declare' ddt | cut -f 2 -d "'") #'
15LOCAL_VERSION=4
16
17# Create future tree
18mkdir -p ${tmp_folder}/usr/bin
19mkdir -p ${tmp_folder}/usr/share/man/man1
20mkdir -p ${tmp_folder}/usr/share/ddt
21mkdir -p ${tmp_folder}/etc/bash_completion.d
22cp ddt                  ${tmp_folder}/usr/bin/
23cp ddt.1.gz             ${tmp_folder}/usr/share/man/man1/
24cp LICENSE.txt          ${tmp_folder}/usr/share/ddt/
25cp config.sample.yml    ${tmp_folder}/usr/share/ddt/
26cp ddt.bash_completion  ${tmp_folder}/etc/bash_completion.d/
27(cd ${tmp_folder}/usr/bin;            ln -s ddt      dhcp-dns-tools)
28(cd ${tmp_folder}/usr/share/man/man1; ln -s ddt.1.gz dhcp-dns-tools.1.gz)
29
30# Data archive
31rm -f ${tmp_folder}/data.tar.gz
32(cd ${tmp_folder}; tar czf data.tar.gz ./usr ./etc)
33
34# Control file
35cat <<END > ${tmp_folder}/control
36Package: ddt
37Version: ${DDT_VERSION}-${LOCAL_VERSION}
38Section: utils
39Tag: implemented-in::perl, interface::commandline, role::program
40Priority: optional
41Depends: perl, perl-base, perl-modules, libyaml-syck-perl, libnet-netmask-perl, libreadonly-perl, libfile-touch-perl
42Suggests: libyaml-shell-perl | yamllint, perl-doc
43Architecture: all
44Installed-Size: $(du -ks ${tmp_folder}|cut -f 1)
45Maintainer: Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
46Description: dhcp-dns-tools management of computer names and IP addresses
47 DDT is an acronym for DHCP-DNS-Tools.
48 In practise, DDT is an IP Address Management (IPAM) service.
49 It has been used in the LEGI laboratory for over 10 years.
50 ddt (dhcp-dns-tools) is a small tool to maintain a set of computers/IP.
51 In order to help you in this task, ddt command has a set of action
52 to generated DHCP and DNS configuration files.
53 .
54 The tool is quite effective and tries to keep things simple
55 but easily configurable for your site like a swiss army knife.
56 Everything is saved in a YAML database
57and entries could be added, deleted, or modified by the command line.
58Homepage: http://servforge.legi.grenoble-inp.fr/projects/soft-trokata/wiki/SoftWare/DDT
59END
60
61# Control archive
62rm -f ${tmp_folder}/control.tar.gz
63(cd ${tmp_folder}; tar 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 ddt_${DDT_VERSION}-${LOCAL_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/ddt_${DDT_VERSION}-${LOCAL_VERSION}_all.deb )"
77echo "( cd /srv/www/debian/ ; reprepro includedeb jessie   ~/jessie/ddt_${DDT_VERSION}-${LOCAL_VERSION}_all.deb )"
78echo "( cd /srv/www/debian/ ; reprepro includedeb stretch ~/stretch/ddt_${DDT_VERSION}-${LOCAL_VERSION}_all.deb )"
79echo "( cd /srv/www/debian/ ; reprepro dumpreferences ) | grep -i ddt"
Note: See TracBrowser for help on using the repository browser.