Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > 6d7a63a38d102f802661bc81d6453eae > files > 3

base-1.4.4-1mdv2010.1.src.rpm

# (oe) undefining these makes the build _real_ quick.
%undefine __find_provides
%undefine __find_requires

Summary:	Basic Analysis and Security Engine
Name:		base
Version:	1.4.4
Release:	%mkrel 1
License:	GPLv2+
Group:		System/Servers
URL:		http://base.secureideas.net/
Source0:	http://prdownloads.sourceforge.net/secureideas/%{name}-%{version}.tar.gz
Patch0:		base-1.2.4-mdv_conf.diff
Requires(pre):	apache-mod_php apache-mod_ssl php-mysql php-sockets php-adodb
Requires:	apache-mod_php apache-mod_ssl php-mysql php-sockets php-adodb
Requires(post):	ccp >= 0.4.0
Requires(post):	rpm-helper
Requires:	php-pear-Image_Graph
Requires:	php-pear-Numbers_Words
Requires:	php-pear-Image_Graph
BuildArch:	noarch
BuildRequires:	dos2unix
BuildRequires:	apache-base >= 2.0.54
Provides:	acid
Obsoletes:	acid
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
BASE is the Basic Analysis and Security Engine. It is based on the code from
the Analysis Console for Intrusion Databases (ACID) project. This application
provides a web front-end to query and analyze the alerts coming from a SNORT
IDS system. BASE is a web interface to perform analysis of intrusions that
snort has detected on your network. It uses a user authentication and role-base
system, so that you as the security 'admin can decide what and how much
information each user can see.  It also has a simple to use, web-based setup
program for people not comfortable with editing files directly.

%prep

%setup -q
%patch0 -p0

rm -rf docs/contrib

# clean up CVS stuff
for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do
    if [ -e "$i" ]; then rm -r $i; fi >&/dev/null
done

# fix dir perms
find . -type d | xargs chmod 755

# fix file perms
find . -type f | xargs chmod 644

# strip away annoying ^M
find -type f | grep -v "\.gif" | grep -v "\.png" | grep -v "\.jpg" | xargs dos2unix -U

# instead of a patch
find -type f | xargs perl -pi -e "s|base_conf\.php|/etc/base/base_conf.php|g"
find -type f | xargs perl -pi -e "s|\.\.\/\/etc\/base\/base_conf\.php|/etc/base/base_conf.php|g"

%build

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d
install -d %{buildroot}%{_sysconfdir}/%{name}
install -d %{buildroot}/var/www/%{name}

cp -aRf * %{buildroot}/var/www/%{name}/

install -m0644 base_conf.php.dist %{buildroot}%{_sysconfdir}/%{name}/base_conf.php

cat > README.MDK << EOF
S E T U P  H O W T O
--------------------

There is two ways to configure %{name}-%{version}

1. As root edit the %{_sysconfdir}/%{name}/base_conf.php file (easier)

2. rm -f %{_sysconfdir}/%{name}/base_conf.php
   touch %{_sysconfdir}/%{name}/base_conf.php
   chown apache:apache /var/www/%{name}
   chown apache:apache %{_sysconfdir}/%{name}/base_conf.php
   chmod 666 %{_sysconfdir}/%{name}/base_conf.php
   go to http://localhost/base/
EOF

cat > %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d/%{name}.conf << EOF

Alias /%{name} /var/www/%{name}

<Directory /var/www/%{name}>
    Allow from All
</Directory>

#<LocationMatch /%{name}>
#    Options FollowSymLinks
#    RewriteEngine on
#    RewriteCond %{SERVER_PORT} !^443$
#    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
#</LocationMatch>

EOF

# cleanup
rm -rf %{buildroot}/var/www/%{name}/docs
rm -f %{buildroot}/var/www/%{name}/base_conf.php.dist
rm -f %{buildroot}/var/www/%{name}/README.MDK

%post
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile %{_sysconfdir}/%{name}/base_conf.php --newfile %{_sysconfdir}/%{name}/base_conf.php.rpmnew
%_post_webapp

%postun
%_postun_webapp

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc docs/* README.MDK
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf/webapps.d/%{name}.conf
%dir %attr(0755,root,root) %{_sysconfdir}/%{name}
%attr(0640,apache,root) %config(noreplace) %{_sysconfdir}/%{name}/base_conf.php
/var/www/%{name}


%changelog
* Fri Jan 08 2010 Oden Eriksson <oeriksson@mandriva.com> 1.4.4-1mdv2010.1
+ Revision: 487545
- 1.4.4 (fixes CVE-2009-4592)

* Tue Jun 09 2009 Jérôme Brenier <incubusss@mandriva.org> 1.4.3.1-1mdv2010.0
+ Revision: 384190
- update to new version 1.4.3.1
- requires(post) : rpm-helper
- fix URL / Source
- fix license

* Sun Aug 17 2008 Oden Eriksson <oeriksson@mandriva.com> 1.4.1-1mdv2009.0
+ Revision: 272931
- 1.4.1

* Tue Jul 22 2008 Thierry Vignaud <tvignaud@mandriva.com> 1.3.6-3mdv2009.0
+ Revision: 240439
- rebuild
- kill re-definition of %%buildroot on Pixel's request

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

* Fri Jun 08 2007 Oden Eriksson <oeriksson@mandriva.com> 1.3.6-1mdv2008.0
+ Revision: 37298
- 1.3.6
- drop the menu integration


* Fri May 19 2006 Oden Eriksson <oeriksson@mandriva.com> 1.2.4-1mdk
- 1.2.4
- rediffed P0
- fix a menuentry
- add mod_rewrite rules to enforce ssl connections
- fix deps

* Sat May 28 2005 Oden Eriksson <oeriksson@mandriva.com> 1.1.2-1mdk
- 1.1.2
- fix deps
- rediff P0

* Wed May 11 2005 Oden Eriksson <oeriksson@mandriva.com> 1.0-2mdk
- fix deps
- fix P0
- strip away annoying ^M

* Fri Nov 26 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 1.0-1mdk
- initial mandrake package