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

Last change on this file since 226 was 226, checked in by g7moreau, 6 years ago
  • Update package build script
  • Property svn:executable set to *
File size: 2.6 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=1
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
28# Data archive
29rm -f ${tmp_folder}/data.tar.gz
30(cd ${tmp_folder}; tar czf data.tar.gz ./usr ./etc)
31
32# Control file
33cat <<END > ${tmp_folder}/control
34Package: ddt
35Version: ${DDT_VERSION}-${LOCAL_VERSION}
36Section: utils
37Tag: implemented-in::perl, interface::commandline, role::program
38Priority: optional
39Depends: perl, perl-base, perl-modules, libyaml-syck-perl, libnet-netmask-perl, libreadonly-perl, libfile-touch-perl
40Suggests: libyaml-shell-perl | yamllint, perl-doc
41Architecture: all
42Installed-Size: $(du -ks ${tmp_folder}|cut -f 1)
43Maintainer: Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
44Description: ddt - management of computer names and IP addresses
45 ddt (dhcp-dns-tools) is a small tool to maintain a set of computers/IP.
46 In order to help you in this task, ddt command has a set of action
47 to generated DHCP and DNS configuration files.
48Homepage: http://servforge.legi.grenoble-inp.fr/projects/soft-trokata/wiki/SoftWare/DDT
49END
50
51# Control archive
52rm -f ${tmp_folder}/control.tar.gz
53(cd ${tmp_folder}; tar czf control.tar.gz control)
54
55# Format deb package
56echo 2.0 > ${tmp_folder}/debian-binary
57
58# Create package (control before data)
59ar -r ddt_${DDT_VERSION}-${LOCAL_VERSION}_all.deb ${tmp_folder}/debian-binary ${tmp_folder}/control.tar.gz ${tmp_folder}/data.tar.gz
60     
61# Clean
62rm -rf ${tmp_folder}
63
64# Prepare reprepro upload
65echo "# Prepare reprepro upload"
66echo "( cd /srv/www/debian/ ; reprepro includedeb wheezy   ~/wheezy/ddt_${DDT_VERSION}-${LOCAL_VERSION}_all.deb )"
67echo "( cd /srv/www/debian/ ; reprepro includedeb jessie   ~/jessie/ddt_${DDT_VERSION}-${LOCAL_VERSION}_all.deb )"
68echo "( cd /srv/www/debian/ ; reprepro includedeb stretch ~/stretch/ddt_${DDT_VERSION}-${LOCAL_VERSION}_all.deb )"
69echo "( cd /srv/www/debian/ ; reprepro dumpreferences ) | grep -i ddt"
Note: See TracBrowser for help on using the repository browser.