ldapscripts: use the source from stx upstream
[pti/rtp.git] / meta-stx / recipes-support / ldapscripts / ldapscripts_2.0.8.bb
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 DESCRIPTION = " \
17 The ldapscripts are originally designed to be used within Samba 3.x's \
18 smb.conf file. They allow to manipulate POSIX entries for users, groups \
19 and machines in an LDAP directory. They are written in shell and need ldap \
20 client commands to work correctly (ldapadd, ldapdelete, ldapmodify, \
21 ldapsearch). Other scripts also are provided as simple tools to (manually) \
22 query your LDAP directory : ldapfinger, ldapid, lsldap (...). \
23  \
24 They are designed to be used under GNU/Linux or FreeBSD (any other \
25 recent UNIX-like should also work) and require several binaries that should \
26 come with your OS (uuencode, getent/pw, date, grep, sed, cut...). \
27  \
28 Latest version available on http://contribs.martymac.org \
29 "
30
31 SUMMARY = "Shell scripts to manage POSIX accounts in LDAP"
32
33 SECTION = "base"
34 LICENSE = "GPLv2"
35
36 LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
37
38 PROTOCOL = "https"
39 BRANCH = "r/stx.3.0"
40 SRCNAME = "integ"
41 SRCREV = "0bf4b546df8c7fdec8cfc6cb6f71b9609ee54306"
42
43 SRC_URI = " \
44         https://downloads.sourceforge.net/project/ldapscripts/ldapscripts/ldapscripts-2.0.8/ldapscripts-2.0.8.tgz \
45         git://opendev.org/starlingx/${SRCNAME}.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH};destsuffix=stx-patches;subpath=ldap/ldapscripts/files \
46         "
47 SRC_URI[md5sum] = "99a7222215eaea2c8bc790d0437f22ea"
48 SRC_URI[sha256sum] = "7db3848501f257a10417c9bcfc0b70b76d0a8093eb993f2354925e156c3419ff"
49
50 do_patch_append () {
51     bb.build.exec_func('stx_do_patch', d)
52 }
53
54 stx_do_patch () {
55         cd ${S}
56         patch -p1 < ${WORKDIR}/stx-patches/sudo-support.patch
57         patch -p1 < ${WORKDIR}/stx-patches/sudo-delete-support.patch
58         patch -p1 < ${WORKDIR}/stx-patches/log_timestamp.patch
59         patch -p1 < ${WORKDIR}/stx-patches/ldap-user-setup-support.patch
60         patch -p1 < ${WORKDIR}/stx-patches/allow-anonymous-bind-for-ldap-search.patch
61 }
62
63 SOURCE1 = "${WORKDIR}/stx-patches/ldapscripts.conf.cgcs"
64 SOURCE2 = "${WORKDIR}/stx-patches/ldapadduser.template.cgcs"
65 SOURCE3 = "${WORKDIR}/stx-patches/ldapaddgroup.template.cgcs"
66 SOURCE4 = "${WORKDIR}/stx-patches/ldapmoduser.template.cgcs"
67 SOURCE5 = "${WORKDIR}/stx-patches/ldapaddsudo.template.cgcs"
68 SOURCE6 = "${WORKDIR}/stx-patches/ldapmodsudo.template.cgcs"
69 SOURCE7 = "${WORKDIR}/stx-patches/ldapscripts.passwd"
70
71 do_configure () {
72         cd ${S}
73         oe_runmake -e configure
74 }
75
76 do_compile () {
77         :
78 }
79
80 do_install () {
81         cd ${S}
82         oe_runmake -e DESTDIR=${D} SBINDIR=${sbindir} \
83                 MANDIR=${mandir} ETCDIR=${sysconfdir}/ldapscripts \
84                 LIBDIR=${libdir} install
85
86         rm -Rf ${D}${mandir}/*
87         rm -f ${D}${sbindir}/*machine*
88         rm -f ${D}${sysconfdir}//ldapscripts/ldapaddmachine.template.sample
89         install -m 644 ${SOURCE1} ${D}${sysconfdir}/ldapscripts/ldapscripts.conf
90         install -m 644 ${SOURCE2} ${D}${sysconfdir}/ldapscripts/ldapadduser.template.cgcs
91         install -m 644 ${SOURCE3} ${D}${sysconfdir}/ldapscripts/ldapaddgroup.template.cgcs
92         install -m 644 ${SOURCE4} ${D}${sysconfdir}/ldapscripts/ldapmoduser.template.cgcs
93         install -m 644 ${SOURCE5} ${D}${sysconfdir}/ldapscripts/ldapaddsudo.template.cgcs
94         install -m 644 ${SOURCE6} ${D}${sysconfdir}/ldapscripts/ldapmodsudo.template.cgcs
95         install -m 600 ${SOURCE7} ${D}${sysconfdir}/ldapscripts/ldapscripts.passwd
96 }
97
98 FILES_${PN}_append = " ${libdir}/runtime \
99                        ${sysconfdir} \
100 "