debian/0000755000000000000000000000000012220635453007170 5ustar debian/changelog0000644000000000000000000000025412220216512011032 0ustar golang-openldap (0.2-1) unstable; urgency=low * Initial release. Closes: 721439. -- Tonnerre Lombard Sun, 28 Jul 2013 22:47:06 +0200 debian/copyright0000644000000000000000000000264212220216512011116 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: golang-openldap-dev Source: https://github.com/mqu/openldap/ Files: * Copyright: 2013 Marc Quinton License: MIT Files: debian/* Copyright: 2013 Tonnerre Lombard License: MIT License: MIT Use of this source code is governed by the MIT Licence : http://opensource.org/licenses/mit-license.php . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/patches/0000755000000000000000000000000012220216512010606 5ustar debian/patches/ldap-deprecated0000644000000000000000000000150712220216512013552 0ustar Description: Add some LDAP_DEPRECATED definitions for compilability. In order to compile some of the exported LDAP functions which are in reality marked as LDAP_DEPRECATED, these defines are required. Author: Tonnerre Lombard Forwarded: https://github.com/mqu/openldap/pull/1 Last-Update: 2013-09-22 --- golang-openldap-0.2.orig/add-modify-delete.go +++ golang-openldap-0.2/add-modify-delete.go @@ -29,6 +29,7 @@ package openldap /* #include #include +#define LDAP_DEPRECATED 1 #include // goc can not use union on structs ; so create a new type with same attributes and size --- golang-openldap-0.2.orig/openldap.go +++ golang-openldap-0.2/openldap.go @@ -35,6 +35,7 @@ package openldap /* +#define LDAP_DEPRECATED 1 #include #include debian/patches/ldapattributenew0000644000000000000000000000365212220216512014115 0ustar Description: Added Append(), GetValuesByName(), LdapAttributeNew(). This patch adds LdapAttributeNew() and fixes a few things, the syntax being one of them. Author: Tonnerre Lombard Origin: upstream, https://github.com/mqu/openldap/commit/0eba0d65cecdf0e6998a7e3bad2bd741426c96c0 Forwarded: not-needed Last-Update: 2013-09-22 --- golang-openldap-0.2.orig/openldap.go +++ golang-openldap-0.2/openldap.go @@ -172,6 +172,14 @@ func (self *Ldap) Search(base string, sc // ------------------------------------- Ldap* method (object oriented) ------------------------------------------------------------------- +// Create a new LdapAttribute entry with name and values. +func LdapAttributeNew(name string, values []string)(*LdapAttribute){ + a := new(LdapAttribute) + a.values = values + a.name = name + return a +} + // Append() adds an LdapAttribute to self LdapEntry func (self *LdapEntry) Append(a LdapAttribute){ self.values = append(self.values, a) @@ -197,7 +205,9 @@ func (self *LdapAttribute) ToText() stri list = append(list, a) } } - + if len(list) > 1 { + return fmt.Sprintf("%s: (%d)[%s]", self.name, len(list), strings.Join(list, ", ")) + } return fmt.Sprintf("%s: [%s]", self.name, strings.Join(list, ", ")) } @@ -263,7 +273,7 @@ func (self *LdapEntry) GetValuesByName(a return []string{} } // GetOneValueByName() ; a quick way to get a single attribute value -func (self *LdapEntry) GetOneValueByName(attrib string) string, err{ +func (self *LdapEntry) GetOneValueByName(attrib string) (string, error){ for _, a := range self.values{ if a.Name() == attrib { @@ -376,10 +386,7 @@ func (self *Ldap) SearchAll(base string, attr, _ := e.FirstAttribute() for attr != "" { - _attr := new(LdapAttribute) - _attr.values = e.GetValues(attr) - _attr.name = attr - + _attr := LdapAttributeNew(attr, e.GetValues(attr)) _e.Append(*_attr) attr, _ = e.NextAttribute() debian/patches/series0000644000000000000000000000004112220216512012016 0ustar ldap-deprecated ldapattributenew debian/rules0000755000000000000000000000056012220216512010240 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 # DH_GOPKG is the upstream path which you would normally “go get”. # Using it allows us to build applications without patching locations. export DH_GOPKG := github.com/mqu/openldap # Currently, tests can't win. override_dh_auto_test: %: dh $@ --buildsystem=golang --with=golang debian/source/0000755000000000000000000000000012220216512010457 5ustar debian/source/format0000644000000000000000000000001412220216512011665 0ustar 3.0 (quilt) debian/source/options0000644000000000000000000000003712220216512012075 0ustar extend-diff-ignore="SConstruct"debian/watch0000644000000000000000000000010412220216512010203 0ustar version=3 https://github.com/mqu/openldap/tags .*/v(\d\S*)\.tar\.gz debian/compat0000644000000000000000000000000212220635442010364 0ustar 9 debian/control0000644000000000000000000000141512220635442010572 0ustar Source: golang-openldap Section: devel Priority: extra Maintainer: Tonnerre Lombard Build-Depends: debhelper (>= 9.0.0), dh-golang (>= 1.3), golang-go (>= 1.0), libldap2-dev Standards-Version: 3.9.4 Homepage: https://github.com/mqu/openldap/ Vcs-Git: git://anonscm.debian.org/pkg-go/packages/golang-openldap.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-go/packages/golang-openldap.git;a=summary Package: golang-openldap-dev Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends}, libldap-2.4-2 Description: OpenLDAP client integration for Go, using cgo LDAP client library based on the official C client library from the OpenLDAP team. This is basically just a thin wrapper allowing to call the C API from Go.