[arch-commits] Commit in ceph/trunk (01-ceph-detec-init.patch PKGBUILD PKGBUILD.v11)

Sébastien Luttringer seblu at archlinux.org
Sun Mar 26 18:42:55 UTC 2017


    Date: Sunday, March 26, 2017 @ 18:42:54
  Author: seblu
Revision: 291673

upgpkg: ceph 10.2.5-1

Added:
  ceph/trunk/01-ceph-detec-init.patch
  ceph/trunk/PKGBUILD.v11
Modified:
  ceph/trunk/PKGBUILD

--------------------------+
 01-ceph-detec-init.patch |   69 ++++++++++++++++++++++++++++++++
 PKGBUILD                 |   95 +++++++++++++++++++++++----------------------
 PKGBUILD.v11             |   92 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 211 insertions(+), 45 deletions(-)

Added: 01-ceph-detec-init.patch
===================================================================
--- 01-ceph-detec-init.patch	                        (rev 0)
+++ 01-ceph-detec-init.patch	2017-03-26 18:42:54 UTC (rev 291673)
@@ -0,0 +1,69 @@
+commit c19cb3cd2756ba830edd92158a2913beaa6e24aa
+Author: Sébastien Luttringer <seblu at seblu.net>
+Date:   Sun Mar 26 16:35:13 2017 +0200
+
+    Arch support
+
+diff --git a/src/ceph-detect-init/ceph_detect_init/__init__.py b/src/ceph-detect-init/ceph_detect_init/__init__.py
+index a2bcc7cf27..ca2f2d7975 100644
+--- a/src/ceph-detect-init/ceph_detect_init/__init__.py
++++ b/src/ceph-detect-init/ceph_detect_init/__init__.py
+@@ -13,6 +13,7 @@
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU Library Public License for more details.
+ #
++from ceph_detect_init import arch
+ from ceph_detect_init import centos
+ from ceph_detect_init import debian
+ from ceph_detect_init import exc
+@@ -21,6 +22,7 @@ from ceph_detect_init import rhel
+ from ceph_detect_init import suse
+ import logging
+ import platform
++import os
+ 
+ 
+ def get(use_rhceph=False):
+@@ -49,6 +51,7 @@ def _get_distro(distro, use_rhceph=False):
+ 
+     distro = _normalized_distro_name(distro)
+     distributions = {
++        'arch': arch,
+         'debian': debian,
+         'ubuntu': debian,
+         'linuxmint': debian,
+@@ -75,6 +78,8 @@ def _normalized_distro_name(distro):
+         return 'suse'
+     elif distro.startswith('centos'):
+         return 'centos'
++    elif distro.startswith('arch'):
++        return 'arch'
+     return distro
+ 
+ 
+@@ -103,6 +108,8 @@ def platform_information():
+             else:
+                 codename = major
+ 
++    elif os.path.exists("/etc/arch-release"):
++        return ("arch", None, "arch")
+     return (
+         str(distro).rstrip(),
+         str(release).rstrip(),
+diff --git a/src/ceph-detect-init/ceph_detect_init/arch/__init__.py b/src/ceph-detect-init/ceph_detect_init/arch/__init__.py
+new file mode 100644
+index 0000000000..425ce50bb2
+--- /dev/null
++++ b/src/ceph-detect-init/ceph_detect_init/arch/__init__.py
+@@ -0,0 +1,11 @@
++distro = None
++release = None
++codename = None
++
++
++def choose_init():
++    """Select a init system
++
++    Returns the name of a init system (upstart, sysvinit ...).
++    """
++    return 'systemd'

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-03-26 18:38:09 UTC (rev 291672)
+++ PKGBUILD	2017-03-26 18:42:54 UTC (rev 291673)
@@ -2,23 +2,24 @@
 # Maintainer: Sébastien "Seblu" Luttringer <seblu at archlinux.org>
 
 pkgname=ceph
-pkgver=11.2.0
+pkgver=10.2.5
 pkgrel=1
 pkgdesc='Distributed, fault-tolerant storage platform delivering object, block, and file system'
 arch=('x86_64' 'i686')
 url='https://ceph.com/'
 license=('GPL')
-makedepends=('boost' 'systemd' 'xfsprogs' 'python2-setuptools' 'python2-sphinx'
-             'python2-virtualenv' 'cython2' 'cmake' 'yasm')
+makedepends=('boost' 'systemd' 'xfsprogs' 'python2-sphinx' 'cython2' 'sed')
 depends=('boost-libs' 'curl' 'expat' 'fcgi' 'fuse2' 'gcc-libs' 'glibc'
   'gperftools' 'keyutils' 'leveldb' 'libaio' 'libatomic_ops' 'libedit'
-  'libsystemd' 'libutil-linux' 'ncurses' 'nss' 'python2' 'snappy')
-optdepends=('xfsprogs: support xfs backend')
-options=('!emptydirs')
-source=("https://download.ceph.com/tarballs/ceph-$pkgver.tar.gz"
-        'ceph.sysusers')
-md5sums=('1e394a69820d71e5df19abe38ef647a6'
-         'b3e24e3aa005a657ab475f84bfe3291a')
+  'libsystemd' 'libutil-linux' 'ncurses' 'nss' 'python2' 'snappy'
+  'python2-setuptools' 'xfsprogs')
+options=('emptydirs')
+source=("https://ceph.com/download/$pkgname-$pkgver.tar.gz"
+        'ceph.sysusers'
+        '01-ceph-detec-init.patch')
+md5sums=('772bf99f4360774f5948191a7b012c88'
+         'b3e24e3aa005a657ab475f84bfe3291a'
+         'da25c78ae413dc134cc99fe9818f6ff1')
 
 prepare() {
   cd $pkgname-$pkgver
@@ -35,55 +36,59 @@
 
 build() {
   cd $pkgname-$pkgver
-  [[ -d build ]] || mkdir build
-  cd build
-  # list of options defaults: grep ^option CMakeLists.txt
-  cmake \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DCMAKE_INSTALL_SYSCONFDIR=/etc \
-    -DCMAKE_INSTALL_SBINDIR=/usr/bin \
-    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
-    -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib \
-    -DSPHINX_BUILD=/usr/bin/sphinx-build2 \
-    -DWITH_SYSTEM_BOOST=ON \
-    -DWITH_SYSTEMD=ON \
-    -DWITH_EMBEDDED=OFF \
-    -DWITH_OPENLDAP=OFF \
-    -DWITH_LTTNG=OFF \
-    -DHAVE_BABELTRACE=OFF \
-    -DWITH_TESTS=OFF \
-    ..
+  # fix xfs.h failure in configure on i686
+  [[ $CARCH == i686 ]] && export CXXFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
+  # don't use autotools for ceph-disk, ceph-detect and tests
+  sed -ri 's,include (ceph-disk|ceph-detect-init|test)/Makefile.am,,' src/Makefile.am
+  # regen configure
+  ./autogen.sh
+  # fix python-config binary name
+  sed -i 's,python-config,python2-config,g' configure
+  ./configure \
+    --prefix=/usr \
+    --sbindir=/usr/bin \
+    --libexecdir=/usr/lib \
+    --sysconfdir=/etc \
+    --localstatedir=/var \
+    --with-man-pages \
+    --without-radosgw \
+    --without-openldap \
+    PYTHON=/usr/bin/python2 \
+    CYTHON_CHECK=yes \
+    PYTHON_CONFIG_CHECK=yes \
+    SPHINX_BUILD=sphinx-build2
   make
 }
 
 package() {
-  cd $pkgname-$pkgver/build
+  cd $pkgname-$pkgver
 
+  # main install
   make DESTDIR="$pkgdir" install
 
-  cd "$pkgdir"
+  # ceph-disk
+  pushd src/ceph-disk
+  python2 setup.py install --root "$pkgdir" --prefix=/usr
+  popd
 
-  # install tmpfiles.d
-  install -Dm644 "$srcdir"/$pkgname-$pkgver/systemd/ceph.tmpfiles.d \
-    usr/lib/tmpfiles.d/$pkgname.conf
-  install -Dm644 "$srcdir"/ceph.sysusers \
-    usr/lib/sysusers.d/$pkgname.conf
+  # ceph-detect-init
+  pushd src/ceph-detect-init
+  python2 setup.py install --root "$pkgdir" --prefix=/usr
+  popd
 
-  # fix sbin path
-  msg2 'Fix sbin paths'
-  mv -v usr/sbin/* usr/bin
+  # systemd stuff
+  install -Dm644 systemd/ceph.tmpfiles.d "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
+  install -Dm644 "$srcdir"/ceph.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
 
   # fix bash completions path
   msg2 'Fix bash completion path'
-  install -d -m 755 usr/share/bash-completion
-  mv -v etc/bash_completion.d usr/share/bash-completion/completions
+  install -d -m 755 "$pkgdir"/usr/share/bash-completion
+  mv "$pkgdir"/{etc/bash_completion.d,usr/share/bash-completion/completions}
 
-  # remove debian init
-  rm -v etc/init.d/ceph
-
-  # fix python2 shebang, did not do it in prepare() because cmake remplace some
+  # fix python2 shebang, did not do it in prepare() anymore because it
+  # confuse automake
   msg2 'Fix python2 shebang'
-  find usr/bin -type f -executable -exec \
+  find "$pkgdir" -type f -executable -exec \
     sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \;
 }
 

Added: PKGBUILD.v11
===================================================================
--- PKGBUILD.v11	                        (rev 0)
+++ PKGBUILD.v11	2017-03-26 18:42:54 UTC (rev 291673)
@@ -0,0 +1,92 @@
+# $Id: PKGBUILD 287115 2017-01-22 01:54:44Z seblu $
+# Maintainer: Sébastien "Seblu" Luttringer <seblu at archlinux.org>
+
+pkgname=ceph
+pkgver=11.2.0
+pkgrel=0.1
+pkgdesc='Distributed, fault-tolerant storage platform delivering object, block, and file system'
+arch=('x86_64' 'i686')
+url='https://ceph.com/'
+license=('GPL')
+makedepends=('boost' 'systemd' 'xfsprogs' 'python2-sphinx' 'python2-virtualenv'
+  'cython2' 'cmake' 'yasm')
+depends=('boost-libs' 'curl' 'expat' 'fcgi' 'fuse2' 'gcc-libs' 'glibc'
+  'gperftools' 'keyutils' 'leveldb' 'libaio' 'libatomic_ops' 'libedit'
+  'libsystemd' 'libutil-linux' 'ncurses' 'nss' 'python2' 'snappy'
+  'python2-setuptools' 'xfsprogs')
+options=('!emptydirs')
+source=("https://download.ceph.com/tarballs/ceph-$pkgver.tar.gz"
+        'ceph.sysusers'
+        '14099.patch')
+md5sums=('1e394a69820d71e5df19abe38ef647a6'
+         'b3e24e3aa005a657ab475f84bfe3291a'
+         '9d376f1f6d06be71c2cc6aa267a67869')
+
+prepare() {
+  cd $pkgname-$pkgver
+  # apply patch from the source array (should be a pacman feature)
+  local filename
+  for filename in "${source[@]}"; do
+    if [[ "$filename" =~ \.patch$ ]]; then
+      msg2 "Applying patch ${filename##*/}"
+      patch -p1 -N -i "$srcdir/${filename##*/}"
+    fi
+  done
+  :
+}
+
+build() {
+  cd $pkgname-$pkgver
+  [[ -d build ]] || mkdir build
+  cd build
+  # list of options defaults: grep ^option CMakeLists.txt
+  cmake \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DCMAKE_INSTALL_SYSCONFDIR=/etc \
+    -DCMAKE_INSTALL_SBINDIR=/usr/bin \
+    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
+    -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib \
+    -DSPHINX_BUILD=/usr/bin/sphinx-build2 \
+    -DWITH_SYSTEM_BOOST=ON \
+    -DWITH_SYSTEMD=ON \
+    -DWITH_EMBEDDED=OFF \
+    -DWITH_OPENLDAP=OFF \
+    -DWITH_LTTNG=OFF \
+    -DHAVE_BABELTRACE=OFF \
+    -DWITH_TESTS=OFF \
+    ..
+  make
+}
+
+package() {
+  cd $pkgname-$pkgver/build
+
+  make DESTDIR="$pkgdir" install
+
+  cd "$pkgdir"
+
+  # install tmpfiles.d
+  install -Dm644 "$srcdir"/$pkgname-$pkgver/systemd/ceph.tmpfiles.d \
+    usr/lib/tmpfiles.d/$pkgname.conf
+  install -Dm644 "$srcdir"/ceph.sysusers \
+    usr/lib/sysusers.d/$pkgname.conf
+
+  # fix sbin path
+  msg2 'Fix sbin paths'
+  mv -v usr/sbin/* usr/bin
+
+  # fix bash completions path
+  msg2 'Fix bash completion path'
+  install -d -m 755 usr/share/bash-completion
+  mv -v etc/bash_completion.d usr/share/bash-completion/completions
+
+  # remove debian init
+  rm -v etc/init.d/ceph
+
+  # fix python2 shebang, did not do it in prepare() because cmake remplace some
+  msg2 'Fix python2 shebang'
+  find usr/bin -type f -executable -exec \
+    sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \;
+}
+
+# vim:set ts=2 sw=2 et:



More information about the arch-commits mailing list