source: trunk/project-meta/make-package-debian @ 253

Last change on this file since 253 was 253, checked in by g7moreau, 6 years ago
  • update make package script
  • Property svn:executable set to *
File size: 3.0 KB
Line 
1#!/bin/bash
2#
3# 2018/04/29 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/project-meta-XXXXXX)
11[ -n "${tmp_folder}" -a -d "${tmp_folder}" ] || exit 1
12
13# Set Name and Version
14PKG_NAME=project-meta
15CODE_VERSION=$(grep 'version->declare' project-meta | cut -f 2 -d "'") #'
16PKG_VERSION=2
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/project-meta/license.d
22mkdir -p ${tmp_folder}/usr/share/project-meta/template.d
23mkdir -p ${tmp_folder}/etc/bash_completion.d
24cp project-meta                  ${tmp_folder}/usr/bin/
25cp project-meta.1.gz             ${tmp_folder}/usr/share/man/man1/
26cp LICENSE.txt                   ${tmp_folder}/usr/share/project-meta/
27cp PROJECT-META.sample.yml       ${tmp_folder}/usr/share/project-meta/
28cp license.d/*.txt               ${tmp_folder}/usr/share/project-meta/license.d/
29cp template.d/*.tt               ${tmp_folder}/usr/share/project-meta/template.d/
30cp project-meta.bash_completion  ${tmp_folder}/etc/bash_completion.d/
31chmod -R a+rx        ${tmp_folder}/usr/bin/project-meta
32chmod -R a+rX,go-w   ${tmp_folder}/usr
33chmod -R a+rX,go-w   ${tmp_folder}/etc
34
35# Data archive
36rm -f ${tmp_folder}/data.tar.gz
37(cd ${tmp_folder}; tar --owner root --group root -czf data.tar.gz ./usr ./etc)
38
39# Control file
40cat <<END > ${tmp_folder}/control
41Package: ${PKG_NAME}
42Version: ${CODE_VERSION}-${PKG_VERSION}
43Section: utils
44Tag: implemented-in::perl, interface::commandline, role::program,
45 works-with-format::zip, works-with::archive, works-with::file
46Priority: optional
47Depends: perl, libyaml-syck-perl, libtemplate-perl, libarchive-zip-perl, coreutils, findutils
48Suggests: libyaml-shell-perl | yamllint
49Architecture: amd64
50Installed-Size: $(du -ks ${tmp_folder}|cut -f 1)
51Maintainer: Gabriel Moreau <Gabriel.Moreau@univ-grenoble-alpes.fr>
52Description: Project-Meta - opendata project metafile manager
53 Project-Meta is a small tool to maintain a set of open data files.
54 In order to help you in this task, project-meta command has a set of action
55 to generated and maintain many files in your dataset.
56Homepage: http://servforge.legi.grenoble-inp.fr/projects/soft-trokata/wiki/SoftWare/ProjectMeta
57END
58
59# Control archive
60rm -f ${tmp_folder}/control.tar.gz
61(cd ${tmp_folder}; tar --owner root --group root -czf control.tar.gz control)
62
63# Format deb package
64echo 2.0 > ${tmp_folder}/debian-binary
65
66# Create package (control before data)
67ar -r ${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_amd64.deb ${tmp_folder}/debian-binary ${tmp_folder}/control.tar.gz ${tmp_folder}/data.tar.gz
68     
69# Clean
70rm -rf ${tmp_folder}
71
72# Prepare reprepro upload
73echo "# Prepare reprepro upload"
74echo "( cd /srv/www/debian/ ; reprepro includedeb jessie ~/jessie/${PKG_NAME}_${CODE_VERSION}-${PKG_VERSION}_amd64.deb )"
75echo "( cd /srv/www/debian/ ; reprepro dumpreferences ) | grep -i project-meta"
Note: See TracBrowser for help on using the repository browser.