summaryrefslogtreecommitdiff
path: root/dockerbuild
blob: 235cd74318c43db8277415c4fa6e852a25d18002 (plain)
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
#!/bin/sh -e

if [ "x$1" != "x" ];
then
    source=$1
fi

DEB_HOST_ARCH=`dpkg-architecture -qDEB_HOST_ARCH`

if [ "x$arch" = "x"];
then
    arch=$DEB_HOST_ARCH
fi

echo "arch: $arch"
echo "source: $source"

sudo rm -f *.changes
sudo rm -f /etc/apt/sources.list.d/local.list

rm -rf repo && mkdir repo/

(
cd repo
dget --insecure -d -u $source
dpkg-scansources . /dev/null > Sources.gz
echo "deb-src file:$(pwd) /" > local.list
sudo cp local.list /etc/apt/sources.list.d/
)
localdsc=`echo $source|sed -e "s,.*/,$(pwd)/repo/,"`

if grep ubuntu.com /etc/apt/sources.list; then
    if ! grep universe /etc/apt/sources.list; then
        echo "added universe to sources.list"
        sudo sed -i -e 's,main,main universe,' /etc/apt/sources.list
    fi
fi

sudo apt-get update

if [ -z $arch ]; then
    arch=$DEB_HOST_ARCH
fi

if [ $DEB_HOST_ARCH = $arch ]; then
    ./ubuntu-packaging-tools/docker-nativebuild $localdsc $arch
else
    ./ubuntu-packaging-tools/docker-crossbuild $localdsc $arch
fi

change=`echo *changes`
if [ ! -r $change ]
then
    echo "no changes file"
    exit 1
fi

cat > post_build_ppa_parameters << EOF
pkg_job_name=${JOB_NAME}
key_id=B86C70FE
pkg_changes=${change}
host_ppa=linaro-overlay
EOF

ls -la .