4 2

[alpine-aports] [PATCH] testing/createrepo_c: new aport

Paul Morgan
Details
Message ID
<20170820211152.GA20563@gmail.com>
Sender timestamp
1503263514
DKIM signature
missing
Download raw message
Patch: +140 -0
This is a C implementation of createrepo and
is smaller and faster than (the python-based) createrepo.

The base package provides utilities to manipulate yum repositories:

- createrepo_c
- mergerepo_c
- modifyrepo_c
- sqliterepo_c

Subpackages provide additional features.
---
 testing/createrepo_c/10-libdir.patch |   8 +++
 testing/createrepo_c/20-pydoc.patch  |   5 ++
 testing/createrepo_c/APKBUILD        | 127 +++++++++++++++++++++++++++++++++++
 3 files changed, 140 insertions(+)
 create mode 100644 testing/createrepo_c/10-libdir.patch
 create mode 100644 testing/createrepo_c/20-pydoc.patch
 create mode 100644 testing/createrepo_c/APKBUILD

diff --git a/testing/createrepo_c/10-libdir.patch b/testing/createrepo_c/10-libdir.patch
new file mode 100644
index 0000000000..82848b4030
--- /dev/null
+++ b/testing/createrepo_c/10-libdir.patch
@@ -0,0 +1,8 @@
+--- ./src/CMakeLists.txt.orig
+@@ -110,4 +110 @@
+-IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+-    SET (LIB_SUFFIX "64")
+-ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+-SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
diff --git a/testing/createrepo_c/20-pydoc.patch b/testing/createrepo_c/20-pydoc.patch
new file mode 100644
index 0000000000..4b01b9bfed
--- /dev/null
+++ b/testing/createrepo_c/20-pydoc.patch
@@ -0,0 +1,5 @@
+--- ./doc/python/CMakeLists.txt.orig
+@@ -2 +2 @@
+-    PYTHONPATH=${CMAKE_BINARY_DIR}/src/python sphinx-build -E -b html
++    PYTHONPATH=${CMAKE_BINARY_DIR}/src/python sphinx-build-2 -E -b html
diff --git a/testing/createrepo_c/APKBUILD b/testing/createrepo_c/APKBUILD
new file mode 100644
index 0000000000..35453a3524
--- /dev/null
+++ b/testing/createrepo_c/APKBUILD
@@ -0,0 +1,127 @@
+# Contributor:
+# Maintainer: Paul Morgan <jumanjiman@gmail.com>
+pkgname=createrepo_c
+
+# This is not ideal, but it allows to create package with recent commits.
+# git_describe="0.10.0-48-g0cac54d"
+treeish="0cac54d09b5a2140b625cabad95dc48898e25cdd"
+upstream_tag=0.10.0
+commits_since=48
+
+pkgver=${upstream_tag}.${commits_since}
+pkgrel=0
+pkgdesc="C implementation of createrepo"
+url="https://github.com/rpm-software-management/createrepo_c/"
+arch="all"
+license="GPL2"
+makedepends="
+	alpine-sdk
+	bash-completion
+	bzip2-dev
+	cmake
+	curl-dev
+	doxygen
+	expat-dev
+	file-dev
+	glib-dev
+	libressl-dev
+	libxml2-dev
+	musl-dev
+	py2-sphinx
+	python2-dev
+	rpm-dev
+	scanelf
+	sqlite-dev
+	xz-dev
+	zlib-dev
+	"
+checkdepends="
+	${makedepends}
+	check
+	check-dev
+	py-nose
+	xz
+	"
+install=""
+subpackages="
+	${pkgname}-bash-completion:bashcomp:noarch
+	${pkgname}-dev
+	${pkgname}-dev-doc:devdoc:noarch
+	${pkgname}-doc
+	${pkgname}-libs
+	py2-${pkgname}:py2
+	"
+source="
+	${pkgname}-${treeish}.tar.gz::https://github.com/rpm-software-management/createrepo_c/archive/${treeish}.tar.gz
+	10-libdir.patch
+	20-pydoc.patch
+	"
+builddir="${srcdir}/${pkgname}-${treeish}/"
+
+build() {
+	mkdir "${builddir}"/build
+	cd "${builddir}"/build
+
+	# Pass cmake variables so
+	# end user does not need to set LD_LIBRARY_PATH.
+	# https://cmake.org/Wiki/CMake_RPATH_handling#Always_full_RPATH
+	cmake .. \
+		-DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX=/usr \
+		-DCMAKE_INSTALL_LIBDIR=lib \
+		-DCMAKE_SKIP_BUILD_RPATH=false \
+		-DCMAKE_BUILD_WITH_INSTALL_RPATH=false \
+		-DCMAKE_INSTALL_RPATH=/usr/lib \
+		-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=true \
+		-DPYTHON_DESIRED=2 \
+		|| return 1
+
+	# Build binaries plus user docs.
+	make || return 1
+
+	# Build dev docs.
+	make doc || return 1
+}
+
+check() {
+	cd "${builddir}"/build
+	make tests || return 1
+	tests/run_gtester.sh || return 1
+}
+
+package() {
+	cd "${builddir}"/build
+	make install/strip DESTDIR=${pkgdir} || return 1
+}
+
+py2() {
+	pkgdesc="Python2 bindings for createrepo_c"
+	depends="python2 ${pkgname}-libs"
+
+	# This is architecture-specific and provides a *.so file.
+	mkdir -p "${subpkgdir}"/usr/lib
+	mv "${pkgdir}"/usr/lib/python* "${subpkgdir}"/usr/lib/
+}
+
+bashcomp() {
+	depends=""
+	pkgdesc="Bash completions for ${pkgname}"
+	install_if="${pkgname}=${pkgver}-r${pkgrel} bash-completion"
+
+	mkdir -p "${subpkgdir}"/usr/share/
+	mv "${pkgdir}"/usr/share/bash-completion "${subpkgdir}"/usr/share/
+}
+
+devdoc() {
+	pkgdesc="Developer documentation for ${pkgname}"
+
+	mkdir -p "${subpkgdir}"/usr/share/doc/${pkgname}/c/
+	cp -r "${builddir}"/build/doc/html/* "${subpkgdir}"/usr/share/doc/${pkgname}/c/
+
+	mkdir -p "${subpkgdir}"/usr/share/doc/${pkgname}/python/
+	cp -r "${builddir}"/build/doc/python/html/* "${subpkgdir}"/usr/share/doc/${pkgname}/python/
+}
+
+sha512sums="e1e76d4a7c27af812d2ccf48512491377baeaa2506617ef6a6070dd04327a48b7f16e07bf8e84f8793db3fb5c8d0b79cd88cee4f013f86be2244a5750ccf08c0  createrepo_c-0cac54d09b5a2140b625cabad95dc48898e25cdd.tar.gz
+df861d341d2acf5aba85d2bf0b959a7b22a29315efb0efeeada3871d7f1c4be035d27ff2408f55f3df24e6e11a8e5d7c4c88fd0ce25e4377b5452e861b40e188  10-libdir.patch
+0abf001852efe1437f6a6fcf02143d5462f3c32bf7359f3ca2642a140e5ae708299c5513ae2bbcef12eb10f93fa89e153638e3c3227b9097f44bc16d43a26d21  20-pydoc.patch"
-- 
2.13.2



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Paul Morgan
Details
Message ID
<20170820233333.GB23286@gmail.com>
In-Reply-To
<20170820221638.o5yexog4gaclifv4@francium> (view parent)
Sender timestamp
1503272014
DKIM signature
missing
Download raw message
On Mon, Aug 21, 2017 at 12:16:38AM +0200, Sören Tempel wrote:
> Hey,
> 
> First of all: Thanks for your patch. I added some feedback below:
> 
> On 20.08.17, Paul Morgan wrote:
> > +# This is not ideal, but it allows to create package with recent commits.
> > +# git_describe="0.10.0-48-g0cac54d"
> > +treeish="0cac54d09b5a2140b625cabad95dc48898e25cdd"
> > +upstream_tag=0.10.0
> > +commits_since=48
> 
> Is there any reason why you use the tarball created for the commit
> instead of using the tarball created for the git-tag? Normally, we
> prefer the latter.

The 0.10.0 tag was released nearly two years ago.
There've been 48 commits since then.

Some of these commits are important, so the idea is to
use this ugly kludge until upstream tags a new release.


> For this release the tarball is located at: https://github.com/rpm-software-management/createrepo_c/archive/0.10.0.tar.gz
> 
> > +pkgver=${upstream_tag}.${commits_since}
> 
> I would suggest setting the $pkgver to '0.10.0'.

Are you amenable to the existing 0.10.0.48 version
for the reason offered above?


> > +makedepends="
> > +	alpine-sdk
> > +	bash-completion
> > +	bzip2-dev
> > +	cmake
> > +	curl-dev
> > +	doxygen
> > +	expat-dev
> > +	file-dev
> > +	glib-dev
> > +	libressl-dev
> > +	libxml2-dev
> > +	musl-dev
> > +	py2-sphinx
> > +	python2-dev
> > +	rpm-dev
> > +	scanelf
> > +	sqlite-dev
> > +	xz-dev
> > +	zlib-dev
> > +	"
> 
> The alpine-sdk and musl-dev dependency are always pulled in by default,
> they don't need to be added to $makedepends explicitly.

GTK. I'll rework the patch without those.


> Besides, we usually group multiple dependencies in one line, at least as
> long as that line doesn't exceed 80 characters.

Ah, I do that to avoid future diff churn.


> > +subpackages="
> > +	${pkgname}-dev-doc:devdoc:noarch
> 
> We don't offer doc subpackages for subpackages. A package should only
> have a single doc subpackage.

Ack. I'll remove the dev docs.


> > +	# https://cmake.org/Wiki/CMake_RPATH_handling#Always_full_RPATH
> > +	cmake .. \
> > +		-DCMAKE_BUILD_TYPE=Release \
> > +		-DCMAKE_INSTALL_PREFIX=/usr \
> > +		-DCMAKE_INSTALL_LIBDIR=lib \
> > +		-DCMAKE_SKIP_BUILD_RPATH=false \
> > +		-DCMAKE_BUILD_WITH_INSTALL_RPATH=false \
> > +		-DCMAKE_INSTALL_RPATH=/usr/lib \
> > +		-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=true \
> > +		-DPYTHON_DESIRED=2 \
> > +		|| return 1
> > +
> > +	# Build binaries plus user docs.
> > +	make || return 1
> > +
> > +	# Build dev docs.
> > +	make doc || return 1
> 
> Explicit `|| return 1` statements are no longer needed since abuild runs
> with `set -e` nowadays.

GTK. I'll remove those too.

Cheers,
-paul


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Sören Tempel
Details
Message ID
<20170820221638.o5yexog4gaclifv4@francium>
In-Reply-To
<20170820211152.GA20563@gmail.com> (view parent)
Sender timestamp
1503267398
DKIM signature
missing
Download raw message
Hey,

First of all: Thanks for your patch. I added some feedback below:

On 20.08.17, Paul Morgan wrote:
> +# This is not ideal, but it allows to create package with recent commits.
> +# git_describe="0.10.0-48-g0cac54d"
> +treeish="0cac54d09b5a2140b625cabad95dc48898e25cdd"
> +upstream_tag=0.10.0
> +commits_since=48

Is there any reason why you use the tarball created for the commit
instead of using the tarball created for the git-tag? Normally, we
prefer the latter.

For this release the tarball is located at: https://github.com/rpm-software-management/createrepo_c/archive/0.10.0.tar.gz

> +pkgver=${upstream_tag}.${commits_since}

I would suggest setting the $pkgver to '0.10.0'.

> +makedepends="
> +	alpine-sdk
> +	bash-completion
> +	bzip2-dev
> +	cmake
> +	curl-dev
> +	doxygen
> +	expat-dev
> +	file-dev
> +	glib-dev
> +	libressl-dev
> +	libxml2-dev
> +	musl-dev
> +	py2-sphinx
> +	python2-dev
> +	rpm-dev
> +	scanelf
> +	sqlite-dev
> +	xz-dev
> +	zlib-dev
> +	"

The alpine-sdk and musl-dev dependency are always pulled in by default,
they don't need to be added to $makedepends explicitly.

Besides, we usually group multiple dependencies in one line, at least as
long as that line doesn't exceed 80 characters.

> +subpackages="
> +	${pkgname}-dev-doc:devdoc:noarch

We don't offer doc subpackages for subpackages. A package should only
have a single doc subpackage.

> +	# https://cmake.org/Wiki/CMake_RPATH_handling#Always_full_RPATH
> +	cmake .. \
> +		-DCMAKE_BUILD_TYPE=Release \
> +		-DCMAKE_INSTALL_PREFIX=/usr \
> +		-DCMAKE_INSTALL_LIBDIR=lib \
> +		-DCMAKE_SKIP_BUILD_RPATH=false \
> +		-DCMAKE_BUILD_WITH_INSTALL_RPATH=false \
> +		-DCMAKE_INSTALL_RPATH=/usr/lib \
> +		-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=true \
> +		-DPYTHON_DESIRED=2 \
> +		|| return 1
> +
> +	# Build binaries plus user docs.
> +	make || return 1
> +
> +	# Build dev docs.
> +	make doc || return 1

Explicit `|| return 1` statements are no longer needed since abuild runs
with `set -e` nowadays.

Cheers,
Sören


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Paul Morgan
Details
Message ID
<CANoR=qaR41OPG0HQ7PmrSg2dBUgC106p8LVd0_xcHQJ4DRaJtA@mail.gmail.com>
In-Reply-To
<20170822211313.dlmhfygrny4hpulw@francium> (view parent)
Sender timestamp
1503438825
DKIM signature
missing
Download raw message
ok, then i'll rework the patch with the other changes you suggested.

tyvm

-paul

On Tue, Aug 22, 2017 at 5:13 PM, Sören Tempel <soeren@soeren-tempel.net>
wrote:

> On 20.08.17, Paul Morgan wrote:
> > > For this release the tarball is located at: https://github.com/rpm-
> software-management/createrepo_c/archive/0.10.0.tar.gz
> > >
> > > > +pkgver=${upstream_tag}.${commits_since}
> > >
> > > I would suggest setting the $pkgver to '0.10.0'.
> >
> > Are you amenable to the existing 0.10.0.48 version
> > for the reason offered above?
>
> I would of cause prefer it if upstream simply made a new release but I
> guess your pkgver is okay in that case.
>
> Greetings,
> Sören
>



-- 
Paul Morgan
Sören Tempel
Details
Message ID
<20170822211313.dlmhfygrny4hpulw@francium>
In-Reply-To
<20170820233333.GB23286@gmail.com> (view parent)
Sender timestamp
1503436393
DKIM signature
missing
Download raw message
On 20.08.17, Paul Morgan wrote:
> > For this release the tarball is located at: https://github.com/rpm-software-management/createrepo_c/archive/0.10.0.tar.gz
> > 
> > > +pkgver=${upstream_tag}.${commits_since}
> > 
> > I would suggest setting the $pkgver to '0.10.0'.
> 
> Are you amenable to the existing 0.10.0.48 version
> for the reason offered above?

I would of cause prefer it if upstream simply made a new release but I
guess your pkgver is okay in that case.

Greetings,
Sören


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---