File yixue_console.spec of Package yixue_console

# Yixue Console
%define name        yixue_console
%define version     1.0.0
%define release     1

%define httpd_name      httpd
# User and Group under which Apache is running
# Red Hat: apache:apache
%define httpd_user      apache
%define httpd_group     apache
# OpenSUSE: wwwrun:www
%if "%{_vendor}" == "suse"
    %define httpd_name  apache2
    %define httpd_user  wwwrun
    %define httpd_group www

# Red Hat
# Apache server is packaged under the name of:
# - apache: up to Red Hat 9.0, FC6 and Red Hat Enterprise 2.1
# - httpd: after these releases above
%define is_rh7      0
%define is_el2      0
%define is_centos2  0
%if %(test -f "/etc/redhat-release" && echo 1 || echo 0)
    %define is_rh7 %(test -n "`cat /etc/redhat-release | grep '(Valhalla)'`" && echo 1 || echo 0)
    %define is_el2 %(test -n "`cat /etc/redhat-release | grep '(Pensacola)'`" && echo 1 || echo 0)
    %define is_centos2 %(test -n "`cat /etc/redhat-release | grep 'CentOS release 2'`" && echo 1 || echo 0)
    %define is_fedora %(test -n "`cat /etc/redhat-release | grep 'Fedora'`" && echo 1 || echo 0)
%define is_apache   0
%if %{is_rh7}
%define is_apache   1
%if %{is_el2}
%define is_apache   1
%if %{is_centos2}
%define is_apache   1
%if %{is_fedora}
%define is_apache   1
# Evaluate PHP version
%define phpver_lt_430 %(out=`rpm -q --queryformat='%{VERSION}' php` 2>&1 >/dev/null || out=0 ; out=`echo $out | tr . : | sed s/://g` ; if [ $out -lt 430 ] ; then out=1 ; else out=0; fi ; echo $out)

Summary:            Web Console for Yixue
Name:               %{name}
Version:            %{version}
Release:            %{release}
License:            GPL
Vendor:             Miguel Angel Canon 
Source0:            %{name}.tar.gz
Group:              Productivity/Networking/Web/Utilities
Packager:           Manuel Arostegui <>

%if "%{_vendor}" == "suse"
Prefix:             /srv/www
Prefix:             /var/www/html
BuildRoot:          %{_tmppath}/%{name}-buildroot
BuildArchitectures: noarch

AutoReq:            0
%if "%{_vendor}" == "suse"
Requires:           apache2

Requires:           mysql, php4-mysql
%if %{is_apache}
Requires:           apache
Requires:           httpd
Requires:           php >= 4.3.0
Requires:           php-gd
Requires:           mysql, mysql-server, php-mysql jpgraph 

Provides:           %{name}-%{version}

Yixue is a free firewall analysis tool oriented to enterprise-grade environments that need tools to improve, analyze and study their installations.

Yixue means "medicine", and this is its primary goal: to cure the massive degradation on corporate firewalls.
This is the web interface to manage it.

%setup -q -n yixue_console


mkdir -p $RPM_BUILD_ROOT%{prefix}/%{name}
mkdir -p $RPM_BUILD_ROOT/usr/
mkdir -p $RPM_BUILD_ROOT/usr/share/
mkdir -p $RPM_BUILD_ROOT/usr/share/man/
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
cp -aRf * $RPM_BUILD_ROOT%{prefix}/%{name}
if [ -f $RPM_BUILD_ROOT%{prefix}/%{name}/%{name}.spec ] ; then
    rm $RPM_BUILD_ROOT%{prefix}/%{name}/%{name}.spec

%docdir %{prefix}/%{name}/docs