Blob Blame History Raw
Summary:	User and group administration tools for Samba/OpenLDAP
Name:		smbldap-tools
Version:	0.9.6
Release:	1%{?dist}
License:	GPLv2+
Group:		System Environment/Base
URL:		https://gna.org/projects/smbldap-tools/
Source0:	http://download.gna.org/smbldap-tools/packages/smbldap-tools-%{version}.tar.gz
# Need perl(IO::Socket::SSL) for LDAP over SSL (#122066, #207430)
Requires:	perl(IO::Socket::SSL)
Requires:	perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:	noarch
BuildRequires:	openssl

# Fedora integration
Patch0:		smbldap-tools-0.9.6-config.patch

# Assume UTF-8 locale rather than ISO-8859-1
# http://bugzilla.redhat.com/441833 https://gna.org/bugs/?11717
Patch1:		smbldap-tools-0.9.6-utf-8.patch

# Don't stop/start nscd, invalidate caches instead
# http://bugzilla.redhat.com/476504 https://gna.org/bugs/?13098
Patch3:		smbldap-tools-0.9.6-nscd.patch

%description
In conjunction with OpenLDAP and Samba-LDAP servers, this collection is useful
to add, modify and delete users and groups, and to change Unix and Samba
passwords. In those contexts they replace the system tools to manage users,
groups and passwords.

%prep
%setup -q
%{__perl} -pi -e 's|/etc/opt/IDEALX|%{_sysconfdir}|g;
		  s|/opt/IDEALX||g;' \
	smbldap_tools.pm configure.pl
%patch0 -p1
%patch1 -p1
%patch3 -p1

# Don't want these in %%{_sbindir}...
%{__mv} smbldap-tools.spec original-smbldap-tools.spec

# Convert docs to UTF-8 where needed
for f in CONTRIBUTORS README; do
	/usr/bin/iconv -f iso-8859-1 -t utf-8 < ${f} > ${f}.utf8
	%{__mv} -f ${f}.utf8 ${f}
done

# Generate manpages
%{__mkdir} manpages
for i in smbldap-*; do
	/usr/bin/pod2man --section=8 ${i} > manpages/${i}.8
done

# Figure out where ssl stuff goes
%define use_pki %(if [ -f /etc/pki/tls/certs/ca-bundle.crt ]; then echo 1; else echo 0; fi)
%if ! %{use_pki}
%{__perl} -pi -e 's|/etc/pki/tls/certs/|%{_datadir}/ssl/certs/|g;' smbldap.conf
%endif

# Not allowed to have executable docs any more
%{__chmod} -R -c -x+X configure.pl doc/

%build

%install
%{__rm} -rf %{buildroot}
%{__install} -d -m0755 %{buildroot}%{_sbindir}/
%{__install} -d -m0755 %{buildroot}%{_mandir}/man8/
%{__install} -d -m0755 %{buildroot}%{perl_vendorlib}/
%{__install} -p -m0755 smbldap-* %{buildroot}%{_sbindir}/
%{__install} -p -m0644 manpages/* %{buildroot}%{_mandir}/man8/
%{__install} -p -m0644 smbldap_tools.pm %{buildroot}%{perl_vendorlib}/
%{__install} -Dp -m0644 smbldap.conf %{buildroot}%{_sysconfdir}/smbldap-tools/smbldap.conf
%{__install} -Dp -m0600 smbldap_bind.conf %{buildroot}%{_sysconfdir}/smbldap-tools/smbldap_bind.conf

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc ChangeLog CONTRIBUTORS COPYING FILES INFRA INSTALL README TODO
%doc configure.pl *.conf doc/*.conf doc/migration_scripts/ doc/*.pdf
%dir %{_sysconfdir}/smbldap-tools/
%config(noreplace) %{_sysconfdir}/smbldap-tools/smbldap.conf
%config(noreplace) %{_sysconfdir}/smbldap-tools/smbldap_bind.conf
%{_sbindir}/smbldap-groupadd
%{_sbindir}/smbldap-groupdel
%{_sbindir}/smbldap-grouplist
%{_sbindir}/smbldap-groupmod
%{_sbindir}/smbldap-groupshow
%{_sbindir}/smbldap-passwd
%{_sbindir}/smbldap-populate
%{_sbindir}/smbldap-useradd
%{_sbindir}/smbldap-userdel
%{_sbindir}/smbldap-userlist
%{_sbindir}/smbldap-usermod
%{_sbindir}/smbldap-userinfo
%{_sbindir}/smbldap-usershow
%{perl_vendorlib}/smbldap_tools.pm
%{_mandir}/man8/smbldap-groupadd.8*
%{_mandir}/man8/smbldap-groupdel.8*
%{_mandir}/man8/smbldap-grouplist.8*
%{_mandir}/man8/smbldap-groupmod.8*
%{_mandir}/man8/smbldap-groupshow.8*
%{_mandir}/man8/smbldap-passwd.8*
%{_mandir}/man8/smbldap-populate.8*
%{_mandir}/man8/smbldap-useradd.8*
%{_mandir}/man8/smbldap-userdel.8*
%{_mandir}/man8/smbldap-userinfo.8*
%{_mandir}/man8/smbldap-userlist.8*
%{_mandir}/man8/smbldap-usermod.8*
%{_mandir}/man8/smbldap-usershow.8*

%changelog
* Thu Dec  9 2010 Paul Howarth <paul@city-fan.org> - 0.9.6-1
- update to 0.9.6
  - new tool: smbldap-grouplist (list LDAP groups)
  - smbldap-useradd, smbldap-usershow, smbldap-usermod:
    - change default encoding of givenName and sn to UTF-8 (bug #11717)
    - new option: -X (input/output encoding, defaults to UTF-8)
    - new option: -O (localMailAddress attribute)
    - changed option: -M (now sets only mail attribute)
    - home directory is now chowned as $userUidNumber:$userGidNumber
      to avoid race conditions (bug #11721)
    - use gecos as displayName if givenName and userSN not provided
      (bug #14517)
  - smbldap-passwd:
    - new option: -p (allow root to set password from STDIN without
      verification, e.g. using a pipe) (bug #11964)
    - change userPassword, shadowLastChange and shadowMax individually e.g. no
      shadow class or user may not have rights (bug #15052)
  - smbldap-groupmod: allow deletion of users from groups without a defined
    samba group SID)
  - remove references to smbldap_conf.pm
  - fix Z option in smbldap-useradd (custom LDAP attribute) (fixes #590429)
  - alphabetically reorganize options
  - fix several mis-spellings and typos in smbldap-useradd
- update source URL to reflect new upstream file layout
- drop upstreamed chown patch
- update remaining patches to remove fuzz
- drop dependency on openldap-servers (for /usr/sbin/slappasswd) as the
  default configuration is to hash passwords directly rather than calling out
  to slappasswd (#609056)
- drop dependency on samba-common (for /usr/bin/smbpasswd) as the default
  configuration handles the functionality directly rather than calling out to
  smbpasswd
- drop execute permissions from configuration/migration scripts in %%doc

* Wed Jun  2 2010 Marcela Maslanova <mmaslano@redhat.com> - 0.9.5-7
- mass rebuild with perl-5.12.0

* Mon Dec  7 2009 Stepan Kasal <skasal@redhat.com> - 0.9.5-6
- rebuild against perl 5.10.1

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-5
- rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri Mar  6 2009 Paul Howarth <paul@city-fan.org> 0.9.5-4
- change dependencies on samba and openldap-clients to samba-common and
  openldap-servers respectively
- invalidate nscd caches rather than restart nscd (#476504)
- add descriptions and bugzilla references to patch references in spec

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 0.9.5-3
- rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu May 22 2008 Paul Howarth <paul@city-fan.org> 0.9.5-2
- assume the user's locale uses UTF-8 rather than ISO-8859-1 (#441833)
- set ownership of home directory created by smbldap-useradd -m using UID
  number rather than username so that delays in LDAP replication don't
  affect the operation (#447758)

* Wed Apr 23 2008 Paul Howarth <paul@city-fan.org> 0.9.5-1
- update to 0.9.5
- update config patch

* Thu Mar  6 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.4-2
- rebuild for new perl

* Wed Sep 26 2007 Paul Howarth <paul@city-fan.org> 0.9.4-1
- update to 0.9.4
- new upstream, new URLs
- drop useradd_option-o enhancement patch, new included upstream
- update config patch
- new script smbldap-userlist included
- convert docs to UTF-8
- HTML docs no longer included with upstream source
- make and include manpages

* Thu Aug 23 2007 Paul Howarth <paul@city-fan.org> 0.9.2a-1
- update URLs, as original upstream source is now dead
- apply useradd_option-o enhancement patch from upstream
- clarify license as GPL version 2 or later
- add openssl buildreq for detection of TLS cert/key directory

* Sun Oct 29 2006 Paul Howarth <paul@city-fan.org> 0.9.2-5
- perl(Unicode::MapUTF8) now available on x86_64, so remove ExcludeArch
  and revert to noarch package (#211866)

* Mon Oct 23 2006 Paul Howarth <paul@city-fan.org> 0.9.2-4
- Exclude x86_64 as perl(Unicode::MapUTF8) is unavailable (#211866)
- A consequence of this is that the package can no longer be noarch
- Install smbldap_tools.pm without unnecessary exec bits
- Fix example idmapdn entry in config file

* Fri Sep 22 2006 Paul Howarth <paul@city-fan.org> 0.9.2-3
- Require IO::Socket::SSL to ensure we have SSL support even if perl-LDAP
  doesn't enforce this dependency (#122066, #207430)

* Fri Jan 27 2006 Paul Howarth <paul@city-fan.org> 0.9.2-2
- Incorporate smbldap.conf review suggestions from Steven Pritchard (#178905)
  Undefine SID so it is fetched with "net getlocalsid"
  Undefine sambaDomain so it is fetched from smb.conf
  TLS keys and certs should go in /etc/pki/tls/certs
  usersdn should be "ou=People,${suffix}" to match OpenLDAP migration tools
  groupsdn should be "ou=Group,${suffix}" to match OpenLDAP migration tools

* Wed Jan 25 2006 Paul Howarth <paul@city-fan.org> 0.9.2-1
- Update to 0.9.2

* Tue Jan 17 2006 Paul Howarth <paul@city-fan.org> 0.9.1-2
- Unpack tarball quietly
- Clean up file list
- Put smbldap_tools.pm in %%{perl_vendorlib} rather than %%{_sbindir}
- Add %%{?dist} tag

* Sat Jun 04 2005 Dag Wieers <dag@wieers.com> - 0.9.1-1 - 3108+/dag
- Updated to release 0.9.1.

* Tue Apr 05 2005 Dag Wieers <dag@wieers.com> - 0.8.8-1
- Updated to release 0.8.8.

* Wed Feb 16 2005 Dag Wieers <dag@wieers.com> - 0.8.7-2
- Fixed locations, removed /opt/IDEALX. (Alain Rykaert)

* Tue Feb 15 2005 Dag Wieers <dag@wieers.com> - 0.8.7-1
- Updated to release 0.8.7.

* Sat Jan 22 2005 Dag Wieers <dag@wieers.com> - 0.8.6-1
- Updated to release 0.8.6.

* Sun Jun 20 2004 Dag Wieers <dag@wieers.com> - 0.8.5-1
- Updated to release 0.8.5.

* Sat Mar 13 2004 Dag Wieers <dag@wieers.com> - 0.8.4-1
- Updated to release 0.8.4.

* Fri Dec 05 2003 Dag Wieers <dag@wieers.com> - 0.8.2-0
- Updated to release 0.8.2.

* Thu Oct 09 2003 Dag Wieers <dag@wieers.com> - 0.8.1-0
- Initial package. (using DAR)