diff --git a/bdii-py3.patch b/bdii-py3.patch index 0a526d9..cc92e92 100644 --- a/bdii-py3.patch +++ b/bdii-py3.patch @@ -1,5 +1,5 @@ diff --git a/bin/bdii-update b/bin/bdii-update -index aa33c97..158fc6e 100755 +index 337e8e4..bce8f19 100755 --- a/bin/bdii-update +++ b/bin/bdii-update @@ -1,4 +1,4 @@ @@ -8,15 +8,16 @@ index aa33c97..158fc6e 100755 ############################################################################## # Copyright (c) Members of the EGEE Collaboration. 2004. # See http://www.eu-egee.org/partners/ for details on the copyright -@@ -142,6 +142,7 @@ def get_config(config): +@@ -153,7 +153,7 @@ def get_config(config): + pf = os.open(config['BDII_PASSWD_FILE'][rootdn], + os.O_WRONLY | os.O_CREAT | os.O_TRUNC, + 0o600) +- os.write(pf, rootpw) ++ os.write(pf, rootpw.encode()) + os.close(pf) + rootdn = False rootpw = False - if line.find("rootpw") > -1: - rootpw = line.replace("rootpw", "").strip() -+ rootpw = str.encode(rootpw) - if rootdn: - config['BDII_PASSWD'][rootdn] = rootpw - config['BDII_PASSWD_FILE'][rootdn] = "%s/%s" % ( -@@ -206,7 +207,7 @@ def create_daemon(log_file): +@@ -209,7 +209,7 @@ def create_daemon(log_file): e = os.open(log_file, os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o644) os.dup2(e, 2) os.close(e) @@ -25,7 +26,25 @@ index aa33c97..158fc6e 100755 # Write PID pid_file = open(config['BDII_PID_FILE'], 'w') -@@ -489,9 +490,8 @@ def fix(dns, ldif): +@@ -355,7 +355,7 @@ def convert_entry(entry_string): + attribute = line[:index].lower() + value = line[index + 1:].strip() + if value and line[index + 1] == ":": +- value = base64.b64decode(line[index + 2:].strip()) ++ value = base64.b64decode(line[index + 2:].strip()).decode() + if attribute in entry: + if value not in entry[attribute]: + entry[attribute].append(value) +@@ -392,7 +392,7 @@ def convert_back(entry): + for value in entry[attribute]: + if needs_encoding(value): + entry_string += "%s:: %s\n" % (attribute, +- base64.b64encode(value)) ++ base64.b64encode(value.encode()).decode()) + else: + entry_string += "%s: %s\n" % (attribute, value) + +@@ -517,9 +517,8 @@ def fix(dns, ldif): entry = convert_entry(ldif[dns[dn][0]:dns[dn][1]]) if dn[:11].lower() == "mds-vo-name": if 'objectclass' in entry: @@ -37,7 +56,7 @@ index aa33c97..158fc6e 100755 value = dn[12:dn.index(",")] entry = {'dn': [dn], 'objectclass': ['MDS'], -@@ -641,7 +641,7 @@ def main(config, log): +@@ -669,7 +668,7 @@ def main(config, log): log.debug("Finished Diff") log.debug("Sorting Add Keys") @@ -46,7 +65,7 @@ index aa33c97..158fc6e 100755 log.debug("Writing ldif_add to disk") if config['BDII_LOG_LEVEL'] == 'DEBUG': -@@ -660,7 +660,7 @@ def main(config, log): +@@ -688,7 +687,7 @@ def main(config, log): error_file = tempfile.mktemp() roots = group_dns(ldif_add) @@ -55,7 +74,7 @@ index aa33c97..158fc6e 100755 if "o=shadow" in suffixes: index = suffixes.index("o=shadow") if index > 0: -@@ -731,13 +731,13 @@ def main(config, log): +@@ -759,13 +758,13 @@ def main(config, log): log.error("Could not modify entries in the database.") modify_error_counter += log_errors(error_file, @@ -71,7 +90,7 @@ index aa33c97..158fc6e 100755 log.debug("Writing ldif_delete to disk") if config['BDII_LOG_LEVEL'] == 'DEBUG': -@@ -998,7 +998,7 @@ if __name__ == '__main__': +@@ -1026,7 +1025,7 @@ if __name__ == '__main__': os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o644) os.dup2(e, 2) os.close(e) diff --git a/bdii-slapd.service b/bdii-slapd.service index c6ff536..a74ed5e 100644 --- a/bdii-slapd.service +++ b/bdii-slapd.service @@ -1,7 +1,8 @@ [Unit] Description=Berkeley Database Information Index - slapd -After=remote_fs.target syslog.target -BindTo=bdii.service +After=network.target network-online.target +PartOf=bdii.service +StopWhenUnneeded=true [Service] Type=forking diff --git a/bdii.service b/bdii.service index 4eb3022..b147df1 100644 --- a/bdii.service +++ b/bdii.service @@ -3,6 +3,7 @@ Description=Berkeley Database Information Index Documentation=man:bdii-update(1) After=bdii-slapd.service Requires=bdii-slapd.service +BindsTo=bdii-slapd.service [Service] Type=forking diff --git a/bdii.spec b/bdii.spec index d5823f3..7b2d5e4 100644 --- a/bdii.spec +++ b/bdii.spec @@ -5,8 +5,8 @@ %endif Name: bdii -Version: 5.2.25 -Release: 7%{?dist} +Version: 5.2.26 +Release: 1%{?dist} Summary: The Berkeley Database Information Index (BDII) License: ASL 2.0 @@ -16,7 +16,7 @@ Source1: %{name}.service Source2: %{name}-slapd.service Source3: %{name}-slapd-start # Python 3 support (from upstream pull request) -# https://github.com/EGI-Foundation/bdii/pull/15 +# https://github.com/EGI-Foundation/bdii/pull/25 Patch0: %{name}-py3.patch BuildArch: noarch %if %{use_systemd} @@ -26,6 +26,7 @@ BuildRequires: systemd Requires: openldap-clients Requires: openldap-servers Requires: glue-schema >= 2.0.10 +Requires: logrotate Requires(post): /usr/bin/mkpasswd %if %{use_systemd} @@ -152,6 +153,11 @@ fi %license COPYRIGHT LICENSE.txt %changelog +* Tue Dec 01 2020 Mattias Ellert - 5.2.26-1 +- Version 5.2.26 +- Update python3 patch +- Update systemd unit files + * Mon Jul 27 2020 Fedora Release Engineering - 5.2.25-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 82ddd00..439f466 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (bdii-5.2.25.tar.gz) = b2ccde26fa436493b975ec7b36d974dc428f28d9b67a0a7af92a4b23e9ef83367d13d16f9bc09a3f118f182471d698278ea910afa875555ad6543de6cdf24f18 +SHA512 (bdii-5.2.26.tar.gz) = fbb18d10ddae836823d7744047b37baf4c62a3565223a7746871dcfedd0c1a85473a94b0638e9aaaf045d0d384cbe396c1aab1029de5c14707348c8c6ee65399