Patchwork [22,of,22] dockerrpm: create a yum/dnf repo from the generated rpms

login
register
mail settings
Submitter Mads Kiilerich
Date May 20, 2014, 2:10 a.m.
Message ID <4919af5f5b258123aea4.1400551817@mk-desktop>
Download mbox | patch
Permalink /patch/4843/
State Superseded
Commit 49ea498237698550417c83f53e046913c0f8d99f
Headers show

Comments

Mads Kiilerich - May 20, 2014, 2:10 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1400551681 -7200
#      Tue May 20 04:08:01 2014 +0200
# Node ID 4919af5f5b258123aea41eb8b3b8b778cfffc176
# Parent  b0dbf94de851df6a080df4110aab749dc862c530
dockerrpm: create a yum/dnf repo from the generated rpms
Olle Lundberg - May 20, 2014, 5:05 p.m.
On Tue, May 20, 2014 at 4:10 AM, Mads Kiilerich <mads@kiilerich.com> wrote:

> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1400551681 -7200
> #      Tue May 20 04:08:01 2014 +0200
> # Node ID 4919af5f5b258123aea41eb8b3b8b778cfffc176
> # Parent  b0dbf94de851df6a080df4110aab749dc862c530
> dockerrpm: create a yum/dnf repo from the generated rpms
>
> diff --git a/contrib/docker/centos5 b/contrib/docker/centos5
> --- a/contrib/docker/centos5
> +++ b/contrib/docker/centos5
> @@ -5,3 +5,5 @@ RUN yum install -y gcc make rpm-build ge
>  RUN yum install -y python-devel python-docutils
>  # For building own Python
>  RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel
> bzip2-devel
> +# For creating repo meta data
> +RUN yum install -y createrepo
> diff --git a/contrib/docker/centos6 b/contrib/docker/centos6
> --- a/contrib/docker/centos6
> +++ b/contrib/docker/centos6
> @@ -5,3 +5,5 @@ RUN yum install -y gcc make rpm-build ge
>  RUN yum install -y python-devel python-docutils
>  # For building own Python
>  RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel
> bzip2-devel
> +# For creating repo meta data
> +RUN yum install -y createrepo
> diff --git a/contrib/docker/fedora20 b/contrib/docker/fedora20
> --- a/contrib/docker/fedora20
> +++ b/contrib/docker/fedora20
> @@ -5,3 +5,5 @@ RUN yum install -y gcc make rpm-build ge
>  RUN yum install -y python-devel python-docutils
>  # For building own Python
>  RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel
> bzip2-devel
> +# For creating repo meta data
> +RUN yum install -y createrepo
> diff --git a/contrib/dockerrpm b/contrib/dockerrpm
> --- a/contrib/dockerrpm
> +++ b/contrib/dockerrpm
> @@ -41,3 +41,20 @@ contrib/buildrpm --rpmbuilddir $RPMBUILD
>  DSHARED=/mnt/shared
>  $DOCKER run -u $DBUILDUSER --rm -v $RPMBUILD:$DSHARED $CONTAINER \
>      rpmbuild --define "_topdir $DSHARED" -ba
> $DSHARED/SPECS/mercurial.spec --clean
> +
> +$DOCKER run -u $DBUILDUSER --rm -v $RPMBUILD:$DSHARED $CONTAINER \
> +    createrepo $DSHARED
> +
> +cat << EOF > $RPMBUILD/mercurial.repo
> +# Place this file in /etc/yum.repos.d/mercurial.repo
> +[mercurial]
> +name=Mercurial packages for $NAME
> +# baseurl=file://$RPMBUILD/
> +baseurl=http://hg.example.com/build/$NAME/
> +skip_if_unavailable=True
> +gpgcheck=0
> +enabled=1
> +EOF
> +
> +echo
> +echo "Build complete - results can be found in $RPMBUILD"
>

Most of this series looks good from a packaging perspective. I would
however prefer if we used the --with/--without flags talked about earlier.

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/contrib/docker/centos5 b/contrib/docker/centos5
--- a/contrib/docker/centos5
+++ b/contrib/docker/centos5
@@ -5,3 +5,5 @@  RUN yum install -y gcc make rpm-build ge
 RUN yum install -y python-devel python-docutils
 # For building own Python
 RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel bzip2-devel
+# For creating repo meta data
+RUN yum install -y createrepo
diff --git a/contrib/docker/centos6 b/contrib/docker/centos6
--- a/contrib/docker/centos6
+++ b/contrib/docker/centos6
@@ -5,3 +5,5 @@  RUN yum install -y gcc make rpm-build ge
 RUN yum install -y python-devel python-docutils
 # For building own Python
 RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel bzip2-devel
+# For creating repo meta data
+RUN yum install -y createrepo
diff --git a/contrib/docker/fedora20 b/contrib/docker/fedora20
--- a/contrib/docker/fedora20
+++ b/contrib/docker/fedora20
@@ -5,3 +5,5 @@  RUN yum install -y gcc make rpm-build ge
 RUN yum install -y python-devel python-docutils
 # For building own Python
 RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel bzip2-devel
+# For creating repo meta data
+RUN yum install -y createrepo
diff --git a/contrib/dockerrpm b/contrib/dockerrpm
--- a/contrib/dockerrpm
+++ b/contrib/dockerrpm
@@ -41,3 +41,20 @@  contrib/buildrpm --rpmbuilddir $RPMBUILD
 DSHARED=/mnt/shared
 $DOCKER run -u $DBUILDUSER --rm -v $RPMBUILD:$DSHARED $CONTAINER \
     rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean
+
+$DOCKER run -u $DBUILDUSER --rm -v $RPMBUILD:$DSHARED $CONTAINER \
+    createrepo $DSHARED
+
+cat << EOF > $RPMBUILD/mercurial.repo
+# Place this file in /etc/yum.repos.d/mercurial.repo
+[mercurial]
+name=Mercurial packages for $NAME
+# baseurl=file://$RPMBUILD/
+baseurl=http://hg.example.com/build/$NAME/
+skip_if_unavailable=True
+gpgcheck=0
+enabled=1
+EOF
+
+echo
+echo "Build complete - results can be found in $RPMBUILD"