smbldap-tools/smbldap-tools.spec

130 lines
4.7 KiB
RPMSpec
Raw Normal View History

Name: smbldap-tools
Version: 0.9.10
Release: 1mamba
Summary: A set of perl scripts designed to manage user and group accounts stored in an LDAP directory
Group: System/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://gna.org/projects/smbldap-tools/
Source: http://download.gna.org/smbldap-tools/sources/%{version}/smbldap-tools-%{version}.tar.gz
Source1: smbldap-tools-smbldap.conf
Source2: smbldap-tools-smbldap_bind.conf
Source3: smbldap-tools-slapd.conf
Source4: smbldap-tools-smb.conf.master
Patch0: smbldap-tools-0.9.10-administrator_and_guest.patch
Patch1: smbldap-tools-0.9.10-fix_minUidGid.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: perl-Crypt-SmbHash
BuildRequires: perl-devel
BuildRequires: perl-Net-LDAP
## AUTOBUILDREQ-END
Requires(post):samba-server
Requires: samba-winbind
Requires(post):openldap-server
Requires(post):libnss_ldap
Requires(post):pam_ldap
Requires: openldap-clients
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Smbldap-tools is a set of perl scripts designed to manage user and group accounts stored in an LDAP directory. They can be used both by users and administrators of Linux systems:
* administrators can perform users and groups management operations, in a way similar to the standard useradd or groupmod commands
* users can change their LDAP password from the command line and get/change personnal informations
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
%configure
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
install -d -m0755 %{buildroot}%{_sysconfdir}/smbldap-tools
install -d -m0755 %{buildroot}%{_mandir}/man8
cp -a %{SOURCE1} %{buildroot}%{_sysconfdir}/smbldap-tools/smbldap.conf
cp -a %{SOURCE2} %{buildroot}%{_sysconfdir}/smbldap-tools/smbldap_bind.conf
install -D -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/openldap/slapd-samba.conf.example
install -D -m0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/samba/smb.conf.master
for i in smbldap-[gpu]*;
do
pod2man --section=8 $i > %{buildroot}%{_mandir}/man8/$i.8
done
#. initialize the ldap directory
# $ smbldap-populate
#. If not already done : "smbpasswd -w secret" to set up
# the ldap admin password in secrets.tdb
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
if [ $1 -eq 1 ]; then
# new install
. %{_sysconfdir}/sysconfig/network
conf_hostname=${HOSTNAME}
[ -e %{_sysconfdir}/openldap/slapd.conf ] && {
suffix=`grep ^suffix %{_sysconfdir}/openldap/slapd.conf | awk '{ print $2 }'`
rootdn=`grep ^rootdn %{_sysconfdir}/openldap/slapd.conf | awk '{ print $2 }'`
sid=`net getlocalsid 2>/dev/null| awk '{ print $6 }'`
sambadomain=`grep "[[:space:]]*workgroup =" %{_sysconfdir}/samba/smb.conf | awk '{ print $3 }'`
}
[ "$suffix" -a "$rootdn" ] && {
sed -i "s|\"__suffix__\"|$suffix|
s|__SID__|$sid|
s|__sambaDomain__|$sambadomain|
s|__mailDomain__|$conf_hostname|" \
%{_sysconfdir}/smbldap-tools/smbldap.conf
sed -i "s|\"__slaveDN__\"|$rootdn|
s|\"__masterDN__\"|$rootdn|" \
%{_sysconfdir}/smbldap-tools/smbldap_bind.conf
sed -i "s|__sambaDomain__|$sambadomain|
s|__suffix__|$suffix|
s|__rootdn__|$rootdn|" \
%{_sysconfdir}/samba/smb.conf.master
sed -i "s|__suffix__|$suffix|
s|__rootdn__|$rootdn|" \
%{_sysconfdir}/openldap/slapd-samba.conf.example
}
fi
:
%files
%defattr(-,root,root)
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/smbldap-tools/smbldap.conf
%attr(600,root,root) %config(noreplace) %{_sysconfdir}/smbldap-tools/smbldap_bind.conf
%{_sysconfdir}/samba/smb.conf.master
%{_sysconfdir}/openldap/slapd-samba.conf.example
%{_sbindir}/smbldap-*
%{perl_vendorlib}/smbldap_tools.pm
%{_mandir}/man8/smbldap-*.8*
%doc COPYING
#ChangeLog README TODO
%changelog
* Fri Jul 19 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.10-1mamba
- update to 0.9.10
- smbldap-tools-slapd.conf: added missing indexes
* Mon Apr 11 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.6-4mamba
- set scripts/logon.bat as default logon script
* Tue Mar 29 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.6-3mamba
- added patch to change minimum UID and GID from 1000 to 10000
* Thu Mar 17 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.6-2mamba
- support automatic configuration on first install
* Wed Mar 09 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.6-1mamba
- package created by autospec
smbldap-tools-0.9.6-fix_minUidGid.patch