summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7270994441ecb196d09de338a787a23579c7344c (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# $Id$
# Maintainer: Jamin Collins <jamin.collins@gmail.com>
# Contributor: Ido Rosen <ido@kernel.org>
# Contributor: Evan Teitelman <teitelmanevan@gmail.com>
# Contributor: Eric Renfro <erenfro@gmail.com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Marti Raudsepp <marti@juffo.org>
# Contributor: Sandman <the0sandman@hotmail.com>
# Contributor: raw <spam@rw23.de>
# Contributor: Dave Simons <miouhpi@gmail.com>
# Contributor: Dominik Hannen <cantares1+github@gmail.com>
# Contributor: David Anderson <dave@natulte.net>
# Contributor: Joe Julian <me@joejulian.name>
#

pkgname=ceph-git
pkgver=11.1.0.7326.g3b807e763a
pkgrel=1
epoch=1
pkgdesc='Distributed, fault-tolerant file system delivering object, block, and file storage in one unified system.'
arch=('x86_64' 'i686')
url='http://ceph.com/'
license=('GPL')
depends=('libedit' 'libsigc++' 'gtkmm' 'btrfs-progs' 'crypto++'
         'gperftools>=1.8.3-2' 'python2' 'fuse' 'keyutils'
         'libatomic_ops' 'curl' 'libaio' 'fcgi' 'expat' 'boost'
         'leveldb' 'xfsprogs')
makedepends=('git' 'boost' 'boost-libs' 'yasm' 'cmake' 'python-sphinx' 'python2-lttngust' 'cython2' 'nss')
install=ceph.install
options=('!libtool' 'emptydirs')
provides=('ceph')
conflicts=('ceph')
source=("git+https://github.com/ceph/ceph.git"
        "git+https://github.com/ceph/ceph-object-corpus.git"
        "git+https://github.com/ceph/civetweb"
        "git+https://github.com/ceph/jerasure.git"
        "git+https://github.com/ceph/gf-complete.git"
        "git+https://github.com/ceph/rocksdb"
        "git+https://github.com/ceph/ceph-erasure-code-corpus.git"
        "git+https://github.com/ceph/googletest"
        "git+https://github.com/ceph/spdk.git"
        "git+https://github.com/ceph/xxHash.git"
        "git+https://github.com/ceph/isa-l"
        "git+https://github.com/ceph/lua.git"
        "git+https://github.com/ceph/Beast.git"
        "git+https://github.com/boostorg/boost.git"
        "git+https://github.com/ceph/dpdk"
        "git+https://github.com/facebook/zstd"
        "ceph-osd@.service"
        "ceph-mon@.service"
        "ceph-mds@.service"
        "ceph.install")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            '29483c0f6718e8830cf52c0d31e391fb52dc1b460bcb65cf9c72dfab83e5b5ce'
            'a50811ce62fd6cdcc17d8f1e4d9700c1889ab4bfc5e9a22155bd725a27715e3c'
            'b8239a04cc42e3e4ced2e141df6804e61e875131a5c95d6bcbfc3b44f388d44b'
            'c1669b2bedc07a313b8bd29735296791abc0fd94eb353c9683b6015f2cc2c93c')

pkgver() {
  cd "${srcdir}/${pkgname%%-git}"
  #printf "%s" "$(git describe --long --tags | sed 's/v//; s/-/./g')"
  git describe --long --tags | sed 's/^v//; s/-/./g'
}

prepare() {
  cd "${srcdir}/${pkgname%%-git}"
  SRC_SUBMODULES=('civetweb'
                  'rocksdb'
                  'googletest'
                  'spdk'
                  'xxHash'
                  'isa-l'
                  'lua'
                  'Beast'
                  'boost'
                  'dpdk'
                  'zstd'
                 )
  for SUBMODULE in ${SRC_SUBMODULES[@]}; do
    rm -fr "${srcdir}/${pkgname%%-git}/src/${SUBMODULE}"
    mv "${srcdir}/${SUBMODULE}" "${srcdir}/${pkgname%%-git}/src/${SUBMODULE}"
  done

  for SUBMODULE in ceph-object-corpus ceph-erasure-code-corpus; do
    rm -fr "${srcdir}/${pkgname%%-git}/${SUBMODULE}"
    mv "${srcdir}/${SUBMODULE}" "${srcdir}/${pkgname%%-git}/${SUBMODULE}"
  done

  rm -fr "${srcdir}/${pkgname%%-git}/src/erasure-code/jerasure/jerasure"
  mv "${srcdir}/jerasure" "${srcdir}/${pkgname%%-git}/src/erasure-code/jerasure/jerasure"

  rm -fr "${srcdir}/${pkgname%%-git}/src/erasure-code/jerasure/gf-complete"
  mv "${srcdir}/gf-complete" "${srcdir}/${pkgname%%-git}/src/erasure-code/jerasure/gf-complete"

  git submodule update --init
}

build() {
  cd "${srcdir}/${pkgname%%-git}"

  test -d build && rm -rf build
  mkdir build

  # fix python scripts to use python2
  alias python=python2

  cd "${srcdir}/${pkgname%%-git}/build"
  cmake \
    -DWITH_SYSTEM_BOOST:BOOL="1" \
    -DCMAKE_INSTALL_PREFIX:PATH="/usr" \
    -DDEBUG_GATHER:BOOL="0" \
    "$@" ..
  make DESTDIR="${pkgdir}"
}

package() {
  cd "${srcdir}/${pkgname%%-git}/build"

  make DESTDIR="${pkgdir}" install

  # Some python scripts are autogenerated through Makefiles. Fix those
  # too, or /usr/bin/ceph will have the wrong shebang.
  find ${pkgdir} -type f -exec sed -i 's,^#!/usr/bin/env python$,#!/usr/bin/env python2,g' {} \;

  install -d --mode=755 "${pkgdir}/var/run/ceph" "${pkgdir}/var/log/ceph" \
    "${pkgdir}/etc/rc.d" "${pkgdir}/etc/ceph"

  # Systemd.
  install -d --mode=755 "${pkgdir}/usr/lib/systemd/system"
  install -D --mode=644 "${srcdir}/ceph-osd@.service" "${pkgdir}/usr/lib/systemd/system/ceph-osd@.service"
  install -D --mode=644 "${srcdir}/ceph-mon@.service" "${pkgdir}/usr/lib/systemd/system/ceph-mon@.service"
  install -D --mode=644 "${srcdir}/ceph-mds@.service" "${pkgdir}/usr/lib/systemd/system/ceph-mds@.service"

  # Ceph udev rules.
  for RULE in ${srcdir}/${pkgname%%-git}/udev/*.rules; do
    install -D --mode=644 "${RULE}" "${pkgdir}/usr/lib/udev/rules.d/$(basename ${RULE})"
  done

  # Fix bin directory.
  mv "${pkgdir}/usr/sbin" "${pkgdir}/usr/bin"

  # Sample config.
  install -D --mode=644 "${pkgdir}/usr/share/doc/ceph/sample.ceph.conf" \
    "${pkgdir}/etc/ceph/ceph.conf.sample"

  # License.
  install -D --mode=644 ${srcdir}/${pkgname%%-git}/COPYING \
    "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"

  # Clean up.
  rmdir "${pkgdir}/var/run/ceph"
}