-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
73 lines (66 loc) · 2.37 KB
/
Dockerfile
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
67
68
69
70
71
72
73
FROM amazonlinux:2.0.20181114
ARG version
ARG target_version
ENV ostree_version 2018.9
RUN yum update -y
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN curl -LO http://mirror.centos.org/centos/7/os/x86_64/Packages/glib2-2.56.1-2.el7.x86_64.rpm
RUN curl -LO http://mirror.centos.org/centos/7/os/x86_64/Packages/glib2-devel-2.56.1-2.el7.x86_64.rpm
RUN yum install -y glib2-2.56.1-2.el7.x86_64.rpm glib2-devel-2.56.1-2.el7.x86_64.rpm
RUN yum install -y \
autoconf \
automake \
bison \
e2fsprogs-devel \
fuse-devel \
gettext-devel \
git \
gobject-introspection-devel \
gpgme-devel \
gtk-doc \
json-glib-devel \
libappstream-glib-devel \
libarchive-devel \
libcap-devel \
libseccomp-devel \
libsoup-devel \
libtool \
libXau-devel \
libxml2-devel \
make \
pkgconfig \
polkit-devel \
rpm-build \
which \
xz-devel \
zlib-devel
RUN mkdir /app
WORKDIR /app
RUN git clone https://github.com/ostreedev/ostree.git
RUN git clone https://github.com/flatpak/flatpak.git
WORKDIR /app/ostree
RUN git checkout -b build v$ostree_version
RUN git submodule update --init --recursive
RUN env NOCONFIGURE=1 ./autogen.sh
RUN ./configure --prefix=/opt/albuild-flatpak/$version/ostree --enable-man=no
RUN make
RUN make install
ENV PKG_CONFIG_PATH=/opt/albuild-flatpak/$version/ostree/lib/pkgconfig:/usr/share/pkgconfig:/usr/lib64/pkgconfig
WORKDIR /app/flatpak
RUN git checkout -b build $target_version
RUN git submodule update --init --recursive
RUN env NOCONFIGURE=1 ./autogen.sh
RUN ./configure --prefix=/usr --sysconfdir=/etc --enable-static
RUN make
RUN make DESTDIR=/dest install
RUN mkdir -p /root/rpmbuild/{SOURCES,SPECS}
WORKDIR /root/rpmbuild
ADD rpm.spec SPECS
RUN sed -i "s,{{VERSION}},$version," SPECS/rpm.spec >/dev/null
RUN sed -i "s,{{SOURCE0}},https://github.com/flatpak/flatpak/tree/$target_version," SPECS/rpm.spec >/dev/null
RUN sed -i "s,{{SOURCE1}},https://github.com/ostreedev/ostree/tree/v$ostree_version," SPECS/rpm.spec >/dev/null
RUN find /opt/albuild-flatpak/$version -type f >> SPECS/rpm.spec
RUN find /opt/albuild-flatpak/$version -type l >> SPECS/rpm.spec
RUN find /dest -type f | sed 's,^/dest,,' | sed 's,^\(/usr/share/man/man[15]/.\+\.[15]\)$,\1.gz,' >> SPECS/rpm.spec
RUN find /dest -type l | sed 's,^/dest,,' | sed 's,^\(/usr/share/man/man[15]/.\+\.[15]\)$,\1.gz,' >> SPECS/rpm.spec
RUN rpmbuild -bb SPECS/rpm.spec