Skip to content

Creating This Repo: Why and How

Campbell, Justin edited this page Feb 26, 2021 · 5 revisions

Overview

This is a fork of python-ldap from GitHub (which will be referred to as upstream.) Code here is identical to upstream except SASL dependencies have been removed from the build process.

What This Repo Is

This repo is simply a mirror of python-ldap that can be built without SASL support for webqueue2's API

What This Repo Is Not

This repo is not a place to modify python-ldap code or add new features.

Steps for Creating This Repo

This repo was made by creating an empty repository with a default origin remote then adding an upstream remote and merging from upstream into origin. Assuming you've already configured global git credentials, the steps to reproduce this repository are as follows:

  1. Initialize an empty repo:
mkdir python-ldap
cd python-ldap
git init -b master
  1. Add default origin remote:
git remote add origin git@github.itap.purdue.edu:ECN/python-ldap.git
  1. Add upstream remote:
git remote add upstream https://github.com/python-ldap/python-ldap.git
# Confirm the remotes have been added and named properly
git remote -v

# Expected Output:
origin  git@github.itap.purdue.edu:ECN/python-ldap.git (fetch)
origin  git@github.itap.purdue.edu:ECN/python-ldap.git (push)
upstream        https://github.com/python-ldap/python-ldap.git (fetch)
upstream        https://github.com/python-ldap/python-ldap.git (push)
  1. Merge upstream into origin:
# The --allow-unrelated-histories flag is required because the the repo we 
# made and the repo we are pulling from are unaware of each other.
git pull upstream master --allow-unrelated-histories
  1. Remove SASL requirements from build system:

This is the most important step.

In the setup.cfg file, change the following:

[_ldap]

# Define extra include and library dirs if needed. distutils adds non
# standard library_dirs as rpath.
# library_dirs = /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
# include_dirs = /usr/include /usr/local/include

# These defines needs OpenLDAP built with
- # ./configure --with-cyrus-sasl --with-tls
- defines = HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
+ # ./configure --with-tls
+ defines = HAVE_TLS HAVE_LIBLDAP_R
  1. Commit changes and push:
git add *
git commit
git push
  1. Create a tagged release:

See Configuring a remote for a fork - GitHub Docs. The following settings were used to match python-ldap at time of creation:

Setting Value
Tag Version python-ldap-3.3.1
Target master
Release Title 3.3.1
Release Description The initial release to support building without SASL support.

Conclusion

At this point you should have a self-hosted copy of the python-ldap repository from GitHub than can be built without SASL support.


Additional Resources