-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmake_debsrcpkg
executable file
·66 lines (53 loc) · 1.37 KB
/
make_debsrcpkg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Usage: $0 pkg_name version"
exit
fi
# package name must be of lower case (a-z), digits (0-9) and (+-.)
NAME=$1
TARGET_VERNO=$2
TARGET=${PWD}
SRCTARGET=${NAME}-${TARGET_VERNO}
PKGDIR=${TARGET}/debpackage
SRCPKGDIR=${PKGDIR}/${SRCTARGET}
# cleanup old stuff
rm -rf ${PKGDIR}
mkdir ${PKGDIR}
# export source into package
mkdir -p ${SRCPKGDIR}
# this captures any local changes, which allows building a package without
# pushing something upstream which may not actually work
if [ -x /usr/bin/git ]; then
/usr/bin/git archive --format=tar HEAD | tar -xf - -C ${SRCPKGDIR}
fi
#
# create the Debian Source Package
#
mkdir -p ${SRCPKGDIR}/debian/
cat >> ${SRCPKGDIR}/debian/control << EOFDEB
Standards-Version: 3.8.1
Source: libecbufr
Section: libs
Priority: optional
Maintainer: Tom Kralidis <[email protected]>
Homepage: https://github.com/ECCC-MSC/libecbufr
Vcs-Git: https://github.com/ECCC-MSC/libecbufr.git
Package: libecbufr
Architecture: any
Provides: libecbufr
Conflicts: libecbufr
Replaces: libecbufr
Suggests: libcgi-formbuilder-perl
Description: Environment Canada BUFR Library
Homepage: https://github.com/ECCC-MSC/libecbufr
EOFDEB
cd ${PKGDIR}
dpkg-source -b ${SRCTARGET}
if [ $? -eq 0 ]; then
rm -rf ${SRCPKGDIR}
echo "Created Debian Source package in ${PKGDIR}"
exit 0
fi
echo "Debian source package creation failed!"
exit 1