summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6378927ebcc8a09b649b2428e1804658829e604d (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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# Maintainer: Brad Ackerman <brad@facefault.org>
# Contributor: Felix Golatofski <contact@xdfr.de>
# Contributor: EoleDev
# Contributor: Jan Cholasta <grubber at grubber cz>
# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to>

pkgbase=freeipa
pkgname=(python-ipalib
         python-ipaclient
         freeipa-common
         freeipa-client-common
         freeipa-client)
pkgver=4.8.10
pkgrel=1
pkgdesc='The Identity, Policy and Audit system'
arch=('i686' 'x86_64')
url='http://www.freeipa.org/'
license=('GPL3')
makedepends=('openldap'
             'krb5>=1.15.1'
             'xmlrpc-c>=1.27.4'
             'popt'
             'gettext'
             'python'
             'python-setuptools'
             'nspr'
             'nss'
             'openssl'
             'ding-libs'
             'libsasl'
             'sssd>=1.13.0'
             'python-jinja'
             'python-pyasn1-modules')
options=(emptydirs)
validpgpkeys=('0E63D716D76AC080A4A33513F40800B6298EB963')
source=("https://releases.pagure.org/freeipa/freeipa-${pkgver}.tar.gz"
        "https://releases.pagure.org/freeipa/freeipa-${pkgver}.tar.gz.asc"
        0001-platform-add-Arch-Linux-platform.patch
        freeipa-client-update-sshd_config
        freeipa-client-update-sshd_config.hook)
sha256sums=('01e1d239e24c8841b1221c36d4fe50b7b4f165c022b888b8bdfb376fa55dc999'
            'b3b9a8355c785ce7b9f24529aed3f39f297c0fb7bc8ed05b2d9bd3c6c9499a99'
            '07571a3899e4403a404ffe2ad96816f9978dc4c8efc3204df9748784623f253b'
            '9fbac49fa4bc23afe0c4d575ea2795f1da435399289dbd04c5a3ac47580e2a0d'
            '1e73f394d276357dcd578df7a349b1f381c9edc7b1c053ecf65f7a9255c0490d')

prepare() {
    cd freeipa-${pkgver}

    rm -rf ipaplatform/arch

    patch -p1 -i"$srcdir"/0001-platform-add-Arch-Linux-platform.patch

    # Workaround: We want to build Python things twice. To be sure we do not mess
    # up something, do two separate builds in separate directories.
    cp -r ../freeipa-${pkgver} ../freeipa-${pkgver}-python3
}

build() {
    cd freeipa-${pkgver}

    export PYTHON=/usr/bin/python3
    # Workaround: make sure all shebangs are pointing to Python 3
    # This should be solved properly using setuptools
    # and this hack should be removed.
    find \
        ! -name '*.pyc' -a \
        ! -name '*.pyo' -a \
        -type f -exec grep -qsm1 '^#!.*\bpython' {} \; \
        -exec sed -i -e '1 s|^#!.*\bpython[^ ]*|#!/usr/bin/python3|' {} \;
    ./configure --prefix=/usr \
                --sysconfdir=/etc \
                --sbindir=/usr/bin \
                --with-vendor-suffix=-arch-${pkgrel} \
                --disable-server \
                --without-ipatests \
                --disable-pylint --without-jslint \
		--with-ipaplatform=arch

    mkdir -p ../install

    # Please put as much logic as possible into make install. It allows:
    # - easier porting to other distributions
    # - rapid devel & install cycle using make install
    #   (instead of full RPM build and installation each time)
    #
    # All files and directories created by spec install should be marked as ghost.
    # (These are typically configuration files created by IPA installer.)
    # All other artifacts should be created by make install.
    #
    # Exception to this rule are test programs which where want to install
    # Python2/3 versions at the same time so we need to rename them. Yuck.

    # Python 3 installation needs to be done first. Subsequent Python 2 install
    # will overwrite /usr/bin/ipa and other scripts with variants using
    # python2 shebang.
    (cd ipaclient && make install DESTDIR=../../install)
    (cd ipalib && make install DESTDIR=../../install)
    (cd ipaplatform && make install DESTDIR=../../install)
    (cd ipapython && make install DESTDIR=../../install)

    # Python 2 installation
    make install DESTDIR="$PWD"/../install

    # remove files which are useful only for make uninstall
    find ../install -wholename '*/site-packages/*/install_files.txt' -exec rm {} \;

    mkdir -p ../install/etc/ipa
    mkdir -p ../install/etc/ipa/nssdb
    mkdir -p ../install/var/lib/ipa-client/pki
    mkdir -p ../install/var/lib/ipa-client/sysrestore

    touch ../install/etc/ipa/default.conf
    touch ../install/etc/ipa/ca.crt
}

package_python-ipalib() {
    pkgdesc='Python libraries used by IPA'
    arch=('any')
    depends=("freeipa-common=$pkgver-$pkgrel"
             'python-gssapi>=1.2.0'
             'gnupg'
             'keyutils'
             'python-nss>=0.16'
             'python-cryptography>=1.4'
             'python-netaddr>=0.7.16'
             'sssd'
             'python-qrcode>=5.0.0'
             'python-pyasn1'
             'python-pyasn1-modules'
             'python-dateutil'
             'python-yubico>=1.2.3'
             'python-dbus'
             'python-setuptools'
             'python-six'
             'python-ldap'
             'python-netaddr'
             'python-dnspython>=1.15'
             'python-netifaces>=0.10.4'
             'python-pyusb')
    provides=("python-ipapython=$pkgver-$pkgrel"
              "python-ipaplatform=$pkgver-$pkgrel")

    cd freeipa-${pkgver}

    install -D -m644 -t"$pkgdir"/usr/share/doc/$pkgname README.md \
                                                        Contributors.txt

    local _file
    for _file in ../install/usr/lib/python3.*/site-packages/ipapython \
                 ../install/usr/lib/python3.*/site-packages/ipalib \
                 ../install/usr/lib/python3.*/site-packages/ipaplatform \
                 ../install/usr/lib/python3.*/site-packages/ipapython-*.egg-info \
                 ../install/usr/lib/python3.*/site-packages/ipalib-*.egg-info \
                 ../install/usr/lib/python3.*/site-packages/ipaplatform-*.egg-info
    do
        _file="${_file#../install/}"
        mkdir -p "$pkgdir"/"${_file%/*}"
        mv ../install/"$_file" "$pkgdir"/"$_file"
    done
}

package_python-ipaclient() {
    pkgdesc='Python libraries used by IPA client'
    arch=('any')
    depends=("freeipa-client-common=$pkgver-$pkgrel"
             "freeipa-common=$pkgver-$pkgrel"
             "python-ipalib=$pkgver-$pkgrel"
             'python-dnspython>=1.15'
             'python-jinja')

    cd freeipa-${pkgver}

    install -D -m644 -t"$pkgdir"/usr/share/doc/$pkgname README.md \
                                                        Contributors.txt

    local _file
    for _file in ../install/usr/lib/python3.*/site-packages/ipaclient \
                 ../install/usr/lib/python3.*/site-packages/ipaclient-*.egg-info
    do
        _file="${_file#../install/}"
        mkdir -p "$pkgdir"/"${_file%/*}"
        mv ../install/"$_file" "$pkgdir"/"$_file"
    done
}

package_freeipa-common() {
    pkgdesc='Common files used by IPA'
    arch=('any')
    conflicts=('freeipa-python')
    replaces=('freeipa-python')

    cd freeipa-${pkgver}

    install -D -m644 -t"$pkgdir"/usr/share/doc/$pkgname README.md \
                                                        Contributors.txt

    local _file
    for _file in ../install/usr/share/locale/*/*/ipa.mo
    do
        _file="${_file#../install/}"
        mkdir -p "$pkgdir"/"${_file%/*}"
        mv ../install/"$_file" "$pkgdir"/"$_file"
    done
}

package_freeipa-client-common() {
    pkgdesc='Common files used by IPA client'
    arch=('any')

    cd freeipa-${pkgver}

    install -D -m644 -t"$pkgdir"/usr/share/doc/$pkgname README.md \
                                                        Contributors.txt

    local _file
    for _file in ../install/etc/ipa/nssdb \
                 ../install/var/lib/ipa-client/pki \
                 ../install/var/lib/ipa-client/sysrestore \
                 ../install/usr/share/man/man5/default.conf.5*
    do
        _file="${_file#../install/}"
        mkdir -p "$pkgdir"/"${_file%/*}"
        mv ../install/"$_file" "$pkgdir"/"$_file"
    done

}

package_freeipa-client() {
    pkgdesc='IPA authentication for use on clients'
    depends=("freeipa-client-common=$pkgver-$pkgrel"
             "freeipa-common=$pkgver-$pkgrel"
             "python-ipaclient=$pkgver-$pkgrel"
             'python-augeas'
             'cyrus-sasl-gssapi'
             'ntp'
             'krb5'
             'authconfig'
             'curl>=7.21.7'
             'yp-tools'
             'xmlrpc-c>=1.27.4'
             'sssd>=1.14.0'
             'certmonger>=0.78'
             'nss'
             'bind-tools'
             'oddjob'
             'python-gssapi>=1.2.0'
             'autofs'
             'nfsidmap'
             'nfs-utils')
    conflicts=('freeipa-admintools')
    replaces=('freeipa-admintools')
    install=freeipa-client.install

    cd freeipa-${pkgver}

    install -D -t"$pkgdir"/usr/share/libalpm/scripts \
            "$srcdir"/freeipa-client-update-sshd_config
    install -D -m644 -t"$pkgdir"/usr/share/libalpm/hooks \
            "$srcdir"/freeipa-client-update-sshd_config.hook \

    install -D -m644 -t"$pkgdir"/usr/share/doc/$pkgname README.md \
                                                        Contributors.txt

    local _file
    for _file in ../install/etc/bash_completion.d \
                 ../install/usr/bin/ipa \
                 ../install/usr/bin/ipa-client-install \
                 ../install/usr/bin/ipa-client-automount \
                 ../install/usr/bin/ipa-certupdate \
                 ../install/usr/bin/ipa-getkeytab \
                 ../install/usr/bin/ipa-rmkeytab \
                 ../install/usr/bin/ipa-join \
                 ../install/usr/share/man/man1/ipa.1 \
                 ../install/usr/share/man/man1/ipa-getkeytab.1* \
                 ../install/usr/share/man/man1/ipa-rmkeytab.1* \
                 ../install/usr/share/man/man1/ipa-client-install.1* \
                 ../install/usr/share/man/man1/ipa-client-automount.1* \
                 ../install/usr/share/man/man1/ipa-certupdate.1* \
                 ../install/usr/share/man/man1/ipa-join.1*
    do
        _file="${_file#../install/}"
        mkdir -p "$pkgdir"/"${_file%/*}"
        mv ../install/"$_file" "$pkgdir"/"$_file"
    done
}