Added an apology in the comments.
[selector.git] / mkdeb.sh
1 #!/bin/bash
2
3 #
4 #  selector is a simple shell command for selection of strings with a
5 #  dynamic pattern-matching.
6 #
7 #  Copyright (c) 2009 Francois Fleuret
8 #  Written by Francois Fleuret <francois.fleuret@idiap.ch>
9 #
10 #  This file is part of selector.
11 #
12 #  selector is free software: you can redistribute it and/or modify
13 #  it under the terms of the GNU General Public License version 3 as
14 #  published by the Free Software Foundation.
15 #
16 #  selector is distributed in the hope that it will be useful, but
17 #  WITHOUT ANY WARRANTY; without even the implied warranty of
18 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 #  General Public License for more details.
20 #
21 #  You should have received a copy of the GNU General Public License
22 #  along with selector.  If not, see <http://www.gnu.org/licenses/>.
23 #
24
25 # This script creates the Debian package. The way it does it is
26 # probably not very conventional. I am open to suggestions.
27
28 VERSION=1.0
29
30 make -k
31
32 TMP=`mktemp -d /tmp/deb.XXXXXX`
33
34 for d in DEBIAN usr/bin usr/share/man/man1; do
35     mkdir -p ${TMP}/${d}
36 done
37
38 # LIBS=`ldd selector | grep "=> /" | awk '{print $3}'`
39 # DEPS=`for l in ${LIBS}; do dpkg -S $l; done | cut -f 1 -d: | sort | uniq`
40
41 cat > ${TMP}/DEBIAN/control <<EOF
42 Package: selector
43 Version: ${VERSION}
44 Maintainer: Francois Fleuret <francois@fleuret.org>
45 Architecture: i386
46 Depends: libncurses5, libstdc++6, libc6, libgcc1
47 Description: A command line for dynamic string-matching.
48  This is a command line for dynamic string selection. As you type a
49  list of strings separated by ';', the display is updated in real time
50  to show only the lines containing all the said strings. The main
51  usage of selector is as an efficient search in the shell command
52  history. With the correct option, it will inject the selected line
53  into the virtual tty input buffer, hence allowing the user to edit
54  the line and execute it as a standard command.
55 EOF
56
57 cp ./selector ${TMP}/usr/bin
58 cp ./selector.1 ${TMP}/usr/share/man/man1
59 gzip ${TMP}/usr/share/man/man1/selector.1
60
61 dpkg-deb --build ${TMP} /tmp/selector_${VERSION}_i386.deb
62
63 rm -rf ${TMP}