1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
# $Source: $
%define version 0.9.4
%define release 1
%define name smbldap-tools
%define _prefix /usr
Summary: User & Group administration tools for Samba/LDAP
Name: %{name}
version: %{version}
Release: %{release}
Group: System Environment/Base
License: GPL
URL: http://sourceforge.net/projects/smbldap-tools/
Packager: Jerome Tournier <jtournier@gmail.com>
Source0: smbldap-tools-%{version}.tgz
BuildRoot: /%{_tmppath}/%{name}
BuildRequires: perl >= 5.6
Requires: perl >= 5.6
Prefix: %{_prefix}
BuildArch: noarch
%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
This was first contributed by IDEALX (http://www.opentrust.com/)
%prep
%setup -q
%build
sed -i "s,/etc/opt/IDEALX/smbldap-tools/,%{_sysconfdir}/smbldap-tools/,g" smbldap_tools.pm
sed -i "s,/etc/opt/IDEALX/smbldap-tools/,%{_sysconfdir}/smbldap-tools/,g" configure.pl
sed -i "s,/etc/opt/IDEALX/,%{_sysconfdir}/,g" smbldap.conf
%install
%{__rm} -rf %{buildroot}
mkdir -p $RPM_BUILD_ROOT/%_sysconfdir/smbldap-tools
mkdir -p $RPM_BUILD_ROOT/%_prefix/{bin,sbin}
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man8/
for i in smbldap-[pgut]*
do
install $i $RPM_BUILD_ROOT/%prefix/sbin/$i
done
cp -a smbldap.conf smbldap_bind.conf $RPM_BUILD_ROOT/%{_sysconfdir}/smbldap-tools/
cp -a smbldap_tools.pm $RPM_BUILD_ROOT/%{prefix}/sbin/
for i in smbldap-[gpu]*;
do
pod2man --section=8 $i > $RPM_BUILD_ROOT/usr/share/man/man8/$i.8
done
%clean
if [ -n "$RPM_BUILD_ROOT" ] ; then
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
fi
%pre
files=`ls %{_prefix}/sbin/smbldap*.pl 2>/dev/null`
if [ "$files" != "" ];
then
echo "WARNING: new scripts do not have any .pl extension"
echo " You need to update the smb.conf file"
fi
%post
# from smbldap-tools-0.8-2, libraries are loaded with the FindBin perl package
if [ -f /usr/lib/perl5/site_perl/smbldap_tools.pm ];
then
rm -f /usr/lib/perl5/site_perl/smbldap_tools.pm
fi
if [ -f /usr/lib/perl5/site_perl/smbldap_conf.pm ];
then
rm -f /usr/lib/perl5/site_perl/smbldap_conf.pm
fi
if [ ! -n `grep with_slappasswd %{_sysconfdir}/smbldap-tools/smbldap.conf | grep -v "^#"` ];
then
echo "Check if you have the with_slappasswd parameter defined"
echo "in smbldap.conf file (see the INSTALL file)"
fi
%files
%defattr(-,root,root)
%{prefix}/sbin/smbldap-groupadd
%{prefix}/sbin/smbldap-groupdel
%{prefix}/sbin/smbldap-groupmod
%{prefix}/sbin/smbldap-groupshow
%{prefix}/sbin/smbldap-populate
%{prefix}/sbin/smbldap-passwd
%{prefix}/sbin/smbldap-useradd
%{prefix}/sbin/smbldap-userdel
%{prefix}/sbin/smbldap-usermod
%{prefix}/sbin/smbldap-userinfo
%{prefix}/sbin/smbldap-userlist
%{prefix}/sbin/smbldap-usershow
%{prefix}/sbin/smbldap_tools.pm
%doc CONTRIBUTORS COPYING ChangeLog FILES INFRA README INSTALL TODO
%doc doc/smb.conf doc/slapd.conf smbldap.conf smbldap_bind.conf
%doc doc/smbldap-*
%doc doc/html
%doc doc/migration_scripts
%doc /usr/share/man/man8/*
%doc configure.pl
%defattr(644,root,root)
%config(noreplace) %{_sysconfdir}/smbldap-tools/smbldap.conf
%defattr(600,root,root)
%config(noreplace) %{_sysconfdir}/smbldap-tools/smbldap_bind.conf
%exclude %{prefix}/sbin/smbldap-tools.spec
%changelog
* Fri Aug 10 2007 Jerome Tournier <jtournier@gmail.com> 0.9.4-1
- see Changelog file for updates in scripts
|