Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 3b7efd1e293e4985a73906b786555d5b > files > 3

smbauth-1.4.3-11mdk.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	release		11mdk

#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}

#New ADVX macros
%define ADVXdir %{_datadir}/ADVX
%{expand:%(cat %{ADVXdir}/ADVX-build)}
%{expand:%%global ap_version %(%{apxs} -q ap_version)}

#Standard ADVX requires
Prereq:		%{ap_name} = %{ap_version}
Prereq:		%{ap_name}-conf
BuildRequires:  ADVX-build >= 1.1
BuildRequires:  %{ap_name}-devel >= 2.0.43-5mdk

%define phpsource       %{_prefix}/src/php-devel
%{expand:%(cat /usr/src/php-devel/PHP_BUILD||(echo -e "error: failed build dependencies:\n        php-devel >= 430 (4.3.0) is needed by this package." >/dev/stderr;kill -2 $PPID))}
%define inifile 58_%{rname}.ini

Summary:		A set of modules for samba authentication
Name:			%{rname}
Version:		%{rversion}
Release:		%{release}
URL:			http://www.tekrat.com/smbauth.php
License:		GPL
Source0:		%{rname}%{rversion}.tar.bz2
Source1:		%{mod_conf}.bz2
Patch0:			mod_smbauth-%{rversion}-register.patch.bz2
Group:			System/Servers
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		%{ap_name}-%{mod_name}
Summary:		Mod_%{rname} is a DSO module for the %{ap_name} Web server.
Version:		%{ap_version}_%{rversion}
Group:			System/Servers
URL:			http://www.tekrat.com/smbauth.php
License:		Apache License
Requires:		%{ap_name} = %{ap_version}
Requires:		%{ap_name}-conf
Provides: 		ADVXpackage
Provides:		AP20package

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

%package -n		php-%{rname}
Summary:		Samba auth module for PHP4
Version:		%{phpversion}_%{rversion}
Group:			System/Servers
URL:			http://www.tekrat.com/smbauth.php
License:		PHP License
Provides:		php-%{rname} = %{phpversion}
Requires:		libphp_common%{libversion}
Requires:		php%{libversion}
BuildRequires:  	php%{libversion}-devel
Provides: 		ADVXpackage
Provides:		AP20package

%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

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

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

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

pushd php
    %{phpsource}/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 .
%ADVXinstlib
%ADVXinstconf %{SOURCE1} %{mod_conf}

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

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

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

%post -n		%{ap_name}-%{mod_name}
%ADVXpost

%postun -n		%{ap_name}-%{mod_name}
%ADVXpost

%files -n		%{ap_name}-%{mod_name}
%defattr(-,root,root)
%doc README README.APACHE2 apache2/example-config
%config(noreplace) %{ap_confd}/%{mod_conf}
%{ap_extralibs}/%{mod_so}

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

%changelog
* 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.43-5mdk, 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