wip: stalled changes

This commit is contained in:
Yann Autissier
2024-12-15 14:16:05 +01:00
parent d07a6aafaf
commit 65d739ee27
24 changed files with 393 additions and 17 deletions
+62
View File
@@ -0,0 +1,62 @@
# from: https://github.com/thorsten-l/389ds-docker-alpine
FROM --platform=$BUILDPLATFORM alpine:3.19 as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "*** BUILDPLATFORM=$BUILDPLATFORM TARGETPLATFORM=$TARGETPLATFORM"
ARG BUILD_VERSION
ARG DOCKER_BUILD_DIR
RUN apk add build-base wget libtool autoconf automake openssl-dev cracklib-dev \
libevent-dev nspr-dev nss-dev openldap-dev db-dev icu-dev \
net-snmp-dev krb5-dev pcre-dev make rsync nss-tools openssl \
linux-pam-dev python3 py3-pip python3-dev git py3-setuptools \
py3-argcomplete py3-ldap3 py3-dateutil lmdb-dev json-c-dev pcre2-dev
RUN if [ "$TARGETPLATFORM" != "linux/arm/v7" ]; then apk add rust cargo ; fi
RUN mkdir /build
WORKDIR /build
RUN wget "https://github.com/389ds/389-ds-base/archive/refs/tags/389-ds-base-$BUILD_VERSION.tar.gz"
RUN tar xvfz "389-ds-base-$BUILD_VERSION.tar.gz"
WORKDIR "/build/389-ds-base-389-ds-base-$BUILD_VERSION"
RUN ./autogen.sh
RUN if [ "$TARGETPLATFORM" != "linux/arm/v7" ]; then ./configure --with-openldap --enable-rust ; fi
RUN if [ "$TARGETPLATFORM" == "linux/arm/v7" ]; then ./configure --with-openldap; fi
RUN sed -e 's/.*build_manpages.*/\tcd \$\(srcdir\)\/src\/lib389\; \$\(PYTHON\) setup.py build/g' Makefile > M
RUN mv M Makefile
COPY ${DOCKER_BUILD_DIR}/setup.py src/lib389/setup.py
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk add zig@testing
RUN make -j 8 && make lib389 -j 8 && make install && make lib389-install
FROM alpine:3.19
RUN apk add openssl cracklib libevent nspr nss openldap db icu \
net-snmp krb5 pcre nss-tools openssl linux-pam python3 \
lmdb json-c pcre2 elfutils libffi libexpat
COPY --from=builder /opt /opt
COPY --from=builder /usr/sbin/ds* /usr/sbin/
COPY --from=builder /usr/lib/python3.10 /usr/lib/python3.10
COPY --from=builder /usr/libexec/dirsrv /usr/libexec/dirsrv
RUN mkdir -p /data /data/config /data/run /opt/dirsrv/var/run/dirsrv; \
ln -s /data/run /opt/dirsrv/var/run/dirsrv; \
ln -s /data/ssca /opt/dirsrv/etc/dirsrv/ssca; \
ln -s /data/config /opt/dirsrv/etc/dirsrv/slapd-localhost
HEALTHCHECK --start-period=5m --timeout=5s --interval=5s --retries=2 \
CMD /usr/libexec/dirsrv/dscontainer -H
WORKDIR /data
VOLUME /data
EXPOSE 3389 3636
CMD [ "/usr/libexec/dirsrv/dscontainer", "-r" ]
+86
View File
@@ -0,0 +1,86 @@
#!/usr/bin/python3
# --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2018 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
#
# A setup.py file
#
from setuptools import setup, find_packages
from os import path
from setuptools.command.build_py import build_py
here = path.abspath(path.dirname(__file__))
# fedora/rhel versioning or PEP440?; ATM semantic versioning
# with open(path.join(here, 'VERSION'), 'r') as version_file:
# version = version_file.read().strip()
version = "1.4.0.1"
with open(path.join(here, 'README.md'), 'r') as f:
long_description = f.read()
setup(
name='lib389',
license='GPLv3+',
version=version,
description='A library for accessing and configuring the 389 Directory ' +
'Server',
long_description=long_description,
url='http://www.port389.org/docs/389ds/FAQ/upstream-test-framework.html',
author='Red Hat Inc., and William Brown',
author_email='389-devel@lists.fedoraproject.org',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing'],
keywords='389 directory server test configure',
packages=find_packages(exclude=['tests*']),
# find lib389/clitools -name ds\* -exec echo \''{}'\', \;
data_files=[
('/usr/sbin/', [
'cli/dsctl',
'cli/dsconf',
'cli/dscreate',
'cli/dsidm',
'cli/openldap_to_ds',
]),
('/usr/libexec/dirsrv/', [
'cli/dscontainer',
]),
],
install_requires=[
'pyasn1',
'pyasn1-modules',
'python-dateutil',
'argcomplete',
'argparse-manpage',
'python-ldap',
'setuptools',
'distro',
],
cmdclass={
}
)