Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > by-pkgid > 8fb4f2aef30513979633b5721be01df8 > files > 3

smbauth-1.4.3-26mdk.src.rpm

# this is messy because it provides a module for both
# apache2 and php with the help of the ADVX macros

%define	rname smbauth
%define	rversion 1.4.3
%define	phpversion 5.0.4

#Apache2 Module-Specific definitions
%define mod_version %{rversion}
%define mod_name mod_%{rname}
%define mod_conf 22_%{mod_name}.conf
%define mod_so %{mod_name}.so
%define sourcename %{mod_name}

%define apache_version 2.0.54

%define inifile 58_%{rname}.ini

Summary:	A set of modules for samba authentication
Name:		%{rname}
Version:	%{rversion}
Release:	%mkrel 26
License:	GPL
Group:		System/Servers
URL:		http://www.tekrat.com/smbauth.php
Source0:	%{rname}%{rversion}.tar.bz2
Source1:	%{mod_conf}.bz2
Patch0:		mod_smbauth-%{rversion}-register.patch.bz2
BuildRequires:	apache-devel >= %{apache_version}
BuildRequires:	file
BuildRequires:  php-devel
BuildRoot:	%{_tmppath}/%{rname}-%{rversion}-root

%description
SMBAuth is a set of modules generated via SWIG and based off of
code by the SAMBA project. The modules can be used to authenticate
users with a SMB Server or NT Domain Controller. Current modules
include commandline, Apache, Apache2, PHP, Jabber, Java, Perl, and
Python.

%package -n	apache-%{mod_name}
Summary:	Mod_%{rname} is a DSO module for the apache Web server
Version:	%{apache_version}_%{rversion}
Group:		System/Servers
Requires(pre,postun): rpm-helper
Requires(pre):	apache-conf >= 2.0.54
Requires(pre):	apache >= %{apache_version}
Provides:	apache2-%{mod_name}
Obsoletes:	apache2-%{mod_name}

%description -n	apache-%{mod_name}
Mod_%{name} is a DSO module for the apache Web server.

%package -n	php-%{rname}
Summary:	Samba auth module for PHP4
Version:	%{phpversion}_%{rversion}
Group:		System/Servers

%description -n	php-%{rname}
The php-%{rname} package contains a dynamic shared object that
will add %{rname} to PHP. PHP is an HTML-embeddable scripting
language. If you need %{name} support for PHP applications,
you will need to install this package and the php package.

%prep

%setup -q -n %{rname}%{rversion}
%patch0 -p1

# strip away annoying ^M
find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//'
find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//'

%build
%serverbuild
export CFLAGS="%{optflags} -fPIC"

# first build the lib
pushd samba-shared
    %make CFLAGS="%{optflags} -fPIC"
popd

# build the apache2 module
pushd apache2
    %{_sbindir}/apxs "-L../samba-shared ../samba-shared/*.o" -c %{sourcename}.c
popd

pushd php
    %{_usrsrc}/php-devel/buildext %{rname} smbauth_wrap.c "-L../samba-shared ../samba-shared/*.o" "-DCOMPILE_DL_SMBAUTH"
popd

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

# install the apache2 module
mv apache2/.libs .
install -d %{buildroot}%{_libdir}/apache-extramodules
install -d %{buildroot}%{_sysconfdir}/httpd/modules.d

install -m0755 .libs/*.so %{buildroot}%{_libdir}/apache-extramodules/
bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/httpd/modules.d/%{mod_conf}

# install the php module
install -d %{buildroot}%{_sysconfdir}/php.d
install -d %{buildroot}%{_libdir}/php/extensions
install -m755 php/%{rname}.so %{buildroot}%{_libdir}/php/extensions/

cat > %{buildroot}%{_sysconfdir}/php.d/%{inifile} << EOF
extension = %{rname}.so
EOF

%post -n apache-%{mod_name}
if [ -f %{_var}/lock/subsys/httpd ]; then
    %{_initrddir}/httpd restart 1>&2;
fi
    
%postun -n apache-%{mod_name}
if [ "$1" = "0" ]; then
    if [ -f %{_var}/lock/subsys/httpd ]; then
	%{_initrddir}/httpd restart 1>&2
    fi
fi

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files -n apache-%{mod_name}
%defattr(-,root,root)
%doc README README.APACHE2 apache2/example-config
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/modules.d/%{mod_conf}
%attr(0755,root,root) %{_libdir}/apache-extramodules/%{mod_so}

%files -n php-%{rname}
%defattr(-,root,root)
%doc README.PHP php/test.php
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/php.d/%{inifile}
%attr(0755,root,root) %{_libdir}/php/extensions/%{rname}.so

%changelog
* Thu Jun 02 2005 Oden Eriksson <oeriksson@mandriva.com> 1.4.3-26mdk
- rename the package
- the conf.d directory is renamed to modules.d
- use new rpm-4.4.x pre,post magic
- rebuilt for php 5.0.4

* Sat Apr 16 2005 Oden Eriksson <oeriksson@mandriva.com> 1.4.3-25mdk
- rebuilt for php 4.3.11

* Sun Mar 20 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.4.3-24mdk
- use the %%mkrel macro

* Mon Feb 28 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.4.3-23mdk
- fix %%post and %%postun to prevent double restarts

* Wed Feb 16 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.4.3-22mdk
- spec file cleanups, remove the ADVX-build stuff

* Sat Feb 12 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.4.3-21mdk
- rebuilt against a non hardened-php aware php lib

* Wed Feb 09 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.4.3-20mdk
- rebuilt for apache 2.0.53
- cleanups (php)

* Wed Nov 24 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 1.4.3-19mdk
- nuke redundant provides

* Tue Nov 09 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 1.4.3-18mdk
- rebuilt for apache 2.0.52
- rebuilt for php 4.3.9

* Sun Aug 01 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 1.4.3-17mdk
- built for apache 2.0.50
- built for php 4.3.8

* Wed Nov 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-16mdk
- built for apache 2.0.48
- built for php v4.3.3
- fix explicit-lib-dependency

* Fri Aug 29 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-15mdk
- rebuilt for php v4.3.3

* Thu Jul 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-14mdk
- rebuilt against latest apache2, requires and buildrequires

* Tue Jun 03 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-13mdk
- rebuilt for apache v2.0.46 and php v4.3.2
- buildprereq ADVX-build >= 9.2

* Tue May 06 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-12mdk
- rebuilt for apache v2.0.45

* Fri Feb 28 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 1.4.3-11mdk
- rebuild

* Tue Feb 18 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-10mdk
- built against php-4.3.1

* Tue Jan 21 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-9mdk
- rebuilt for apache v2.0.44
- fix the php versioning

* Mon Jan 20 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-8mdk
- fix buildrequires apache2-devel >= 2.0.53-1mdk, as 
  pointed out by Olivier Thauvin

* Sun Jan 19 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-7mdk
- really rebuilt against rebuilt buildrequires

* Sat Jan 18 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-6mdk
- rebuilt against rebuilt buildrequires

* Mon Jan 13 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-5mdk
- built against php-4.3.0
- follow the spec file design as in main (sorta)
- drop useless sub package
- misc spec file fixes

* Sun Nov 03 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-4mdk
- fix versioning for the apache2 module

* Sat Nov 02 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-3mdk
- rebuilt for/against apache2 where dependencies has changed in apr
- change load order

* Fri Oct 04 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-2mdk
- rebuilt for/against new apache2 version 2.0.43 (even though 2.0.42 and 
  2.0.43 are binary compatible, we have to consider rpm dependencies)

* Wed Oct 02 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.3-1mdk
- new version
- fix url
- adjusted P0

* Thu Sep 26 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.2-2mdk
- rebuilt against new apache v2.0.42

* Fri Sep 20 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.4.2-1mdk
- initial cooker contrib