summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 88e51019cf1a4cbdc9560c6ac8fa9b1a78237e73 (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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# $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=12.1.0.1018.g171104cb93
pkgrel=1
epoch=1
pkgdesc='Distributed, fault-tolerant storage platform delivering object, block, and file system'
arch=('x86_64'
      'i686')
url='http://ceph.com/'
license=('GPL')
depends=('libedit'
         'libsigc++'
         'gtkmm'
         'btrfs-progs'
         'crypto++'
         'gperftools>=1.8.3-2'
         'python2'
         'python2-prettytable'
         'fuse'
         'keyutils'
         'libatomic_ops'
         'curl'
         'libaio'
         'fcgi'
         'expat'
         'boost'
         'leveldb'
         'xfsprogs')
makedepends=('git'
             'boost'
             'boost-libs'
             'babeltrace'
             'gperf'
             'yasm'
             'cmake'
             'python-sphinx'
             'cython2'
             'nss')
install=ceph.install
options=('!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"
        "git+https://github.com/01org/isa-l_crypto"
        "git+https://github.com/ceph/blkin"
        "git+https://github.com/ceph/rapidjson"
        "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'
            'SKIP'
            'SKIP'
            'SKIP'
            '29483c0f6718e8830cf52c0d31e391fb52dc1b460bcb65cf9c72dfab83e5b5ce'
            'a50811ce62fd6cdcc17d8f1e4d9700c1889ab4bfc5e9a22155bd725a27715e3c'
            'b8239a04cc42e3e4ced2e141df6804e61e875131a5c95d6bcbfc3b44f388d44b'
            '9d713eca6096b28319cfd83eafee1486ece75e2f14fb505f86fe18027606a6bd')

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}"

    # put all submodules in the right places
    SRC_SUBMODULES=($(awk '/^\[submodule/ {print substr($2,2,length($2)-3)}' ${srcdir}/${pkgname%%-git}/.gitmodules | xargs -L1 basename))
    for SUBMODULE in ${SRC_SUBMODULES[@]}; do
        SUBMODULE_PATH=$(awk "/path\s*=.*${SUBMODULE}$/ {print \$3}" "${srcdir}/${pkgname%%-git}/.gitmodules")
        rm -fr "${srcdir}/${pkgname%%-git}/${SUBMODULE_PATH}"
        mv "${srcdir}/${SUBMODULE}" "${srcdir}/${pkgname%%-git}/${SUBMODULE_PATH}"
    done

    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"
    # 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 "${srcdir}/${pkgname%%-git}/build"

    make DESTDIR="${pkgdir}" install

    cd "${pkgdir}"

    # install tmpfiles.d
    install -D -m 644 "${srcdir}"/${pkgname%%-git}/systemd/ceph.tmpfiles.d \
        usr/lib/tmpfiles.d/${pkgname%%-git}.conf
    #install -D -m 644 "${srcdir}"/ceph.sysusers \
    #    usr/lib/sysusers.d/${pkgname%%-git}.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
    msg2 'Fix python2 shebang'
    find usr/bin -type f -executable -exec \
        sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \;
}