LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File picviz.spec of Package picviz (Project home:onielsen)

#-------------------------------------------------------------------------------
#| Configuration |
#-----------------
%define my_name		picviz
%define my_version	0.6
%define my_release	1
%define my_serial	1

%define lib_version	0.6.1
%define cli_version	0.6
%define gui_version	0.7

%define lib_package	lib%{my_name}
%define cli_package	%{my_name}-cli
%define gui_package	%{my_name}-gui


# No /etc/rpm/macros.cmake
%if 0%{?suse_version}
%define	_cmake_install_prefix		-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix}
%define	_cmake_build_shared_libs	-DBUILD_SHARED_LIBS:BOOL=ON
%define _cmake_lib_suffix64		-DLIB_SUFFIX=64

%define cmake \
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
  %{_bindir}/cmake \\\
%if "%{?_lib}" == "lib64" \
        %{?_cmake_lib_suffix64} \\\
%endif \\\
        %{?_cmake_install_prefix} \\\
        %{?_cmake_build_shared_libs}
%endif
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Package info |
#----------------
Name:			%{my_name}
License:		GPL v3
Group:			Productivity/Graphics/Visualization/Other
Requires:		%{lib_package} = %{lib_version}
Version:		%{my_version}
Release:		%{my_release}
Summary:		Parallel coordinates plotter
Source0:		picviz-latest.tar.bz2
Source1:		picviz-rpmlintrc
Patch0:			libpicviz-0.6.1-libev.patch
Patch1:			libpicviz-0.6.1-cmake.patch
BuildRoot:		%{_tmppath}/%{name}-%{version}-build
%py_requires
BuildRequires:		cmake flex bison cairo-devel libev-devel pcre-devel python-devel python-qt4-devel
%if  0%{?suse_version}  > 1020
BuildRequires:		fdupes
%endif

%description
Picviz is a parallel coordinates plotter which enables easy scripting
from various input (tcpdump, syslog, iptables logs, apache logs,
etc..) to visualize your data and discover interesting results
quickly.

Its primary goal is to graph data in order to be able to quickly
analyze problems and find correlations among variables. With security
analysis in mind, the program has been designed to be very flexible,
able to graph millions of events.

The language is designed to be close to the graphviz graph description
language.



Authors:
--------
    Sebastien Tricaud <toady@gscore.org>
    Philippe Saade <psaade@gmail.com>


#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Package info |
#----------------
%package -n %{lib_package}
License:	GPL v3
Version:	%{lib_version}
Group:		System/Libraries
Summary:	PicViz Library

%description -n %{lib_package}
Picviz is a parallel coordinates plotter which enables easy scripting
from various input (tcpdump, syslog, iptables logs, apache logs,
etc..) to visualize your data and discover interesting results
quickly.

Its primary goal is to graph data in order to be able to quickly
analyze problems and find correlations among variables. With security
analysis in mind, the program has been designed to be very flexible,
able to graph millions of events.

The language is designed to be close to the graphviz graph description
language.


Authors:
--------
    Sebastien Tricaud <toady@gscore.org>
    Philippe Saade <psaade@gmail.com>


#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Package info |
#----------------
%package -n %{lib_package}-devel
License:	GPL v3
Version:	%{lib_version}
Group:		Development/Libraries/C and C++
Summary:	Include Files and Libraries mandatory for Development

%description -n %{lib_package}-devel
This package contains all necessary include files and libraries needed
to develop applications that require the provided includes and
libraries.


Authors:
--------
    Sebastien Tricaud <toady@gscore.org>
    Philippe Saade <psaade@gmail.com>


#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Package info |
#----------------
%package -n python-%{lib_package}
License:	GPL v3
Version:	%{lib_version}
Group:		Development/Libraries/Python
Summary:	Python bindings for Picviz 

%description -n python-%{lib_package}
Python bindings for Picviz 



Authors:
--------
    Sebastien Tricaud <toady@gscore.org>
    Philippe Saade <psaade@gmail.com>


#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Package info |
#----------------
%package gui
License:	GPL v3
Version:	%{gui_version}
Group:		Productivity/Graphics/Visualization/Graph
Summary:	Picviz Frontend
Requires:	%{lib_package} = %{lib_version}
Requires:	python-%{lib_package} = %{lib_version}

%description gui
Frontend to perform parallel coordinates plot analysis: dig, scale,
change axis order, correlate etc...



Authors:
--------
    Sebastien Tricaud <toady@gscore.org>
    Philippe Saade <psaade@gmail.com>


#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Prepare |
#-----------
%prep
%setup -T -c -n %{my_name}-%{my_version} -a 0
%{__mv} picviz-latest/* .
%{__rm} -Rf picviz-latest/
# -a 1 -a 2
pushd libpicviz
%patch0 -p1
%patch1 -p1
popd
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Build |
#---------
%build
export CFLAGS="${CFLAGS:-%optflags} -fno-strict-aliasing"
export CXXFLAGS="${CXXFLAGS:-%optflags}"
export FFLAGS="${FFLAGS:-%optflags}"
export LDFLAGS="${LDFLAGS:-%{-s:-s}}"

# libpicviz
pushd libpicviz
	[ -d build ] && %{__rm} -rf build
	%{__mkdir_p} build
	pushd build
		CMAKE_C_FLAGS="$CFLAGS" %{cmake} -DLIB_INSTALL_DIR=%{_libdir} -DCMAKE_SKIP_RPATH:BOOL=ON ..
		%{__make}  %{?_smp_mflags}
	popd
	pushd src/bindings/python
		%{__python} setup.py build
	popd
popd

# cli
pushd picviz-cli
	pushd src
	%{__cc} -g -I../../libpicviz/src/include -o pcv pcv.c \
		  -L../../libpicviz/build/src -lpicviz -lpcre -lev $CFLAGS
	popd
	%{__mkdir_p} build
	pushd build
		%cmake ../doc
	popd
popd

# gui
pushd picviz-gui
	%{__python} setup.py build
popd
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Install |
#-----------
%install
# libpicviz
pushd libpicviz
	#make install DESTDIR=%{buildroot}
	%{makeinstall}
	pushd src/bindings/python
		%{__python} setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot} --record-rpm=%{lib_package}-filelist
#		python ./setup.py install --root=%{buildroot} --install-lib=%{python_sitearch}
#		chmod 755 %{buildroot}/%{python_sitearch}/picviz.so
	popd
popd

# cli
pushd picviz-cli
	%{__mkdir_p} %{buildroot}/%{_bindir}
	%{__install} -p -m 755 src/pcv %{buildroot}/%{_bindir}/pcv
	%{__install} -d -D -m 755 %{buildroot}/%{_datadir}/%{name}/templates
	%{__install} -p -m 644 templates/*.pgdt %{buildroot}/%{_datadir}/%{name}/templates
	pushd build
		#make install DESTDIR=%{buildroot}
		%{makeinstall}
	popd
popd

# gui
pushd picviz-gui
	#python ./setup.py install --root=%{buildroot} --install-lib=%{python_sitearch}
	%{__python} setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot} --record-rpm=%{gui_package}-filelist
popd

#desktop-file-install --vendor="fedora" --dir=%{buildroot}/%{_datadir}/applications %{SOURCE4}



# Hardlink duplicate files
%if 0%{?suse_version} > 1020
%fdupes %{buildroot}%{_docdir}
%endif
%{__os_install_post}
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Cleanup |
#-----------
%clean
[ "%{buildroot}" != "/" ] && [ -d %{buildroot} ] && %{__rm} -rf %{buildroot}
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Files |
#---------
%files -n %{lib_package}
%defattr(-,root,root)
%{_libdir}/*.so*
%dir %{_libdir}/libpicviz
%{_libdir}/libpicviz/*.so*
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Files |
#---------
%files -n %{lib_package}-devel
%defattr(-,root,root)
%dir %{_includedir}/picviz
%{_includedir}/picviz/*
%{_libdir}/pkgconfig/*
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Files |
#---------
%files -f libpicviz/src/bindings/python/%{lib_package}-filelist -n python-%{lib_package}
%defattr(-,root,root)
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Files |
#---------
%files -f picviz-gui/%{gui_package}-filelist gui
%defattr(-,root,root)
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| Files |
#---------
%files 
%defattr(-,root,root)
%{_bindir}/pcv
%{_mandir}/man?/pcv.*
%dir %{_datadir}/picviz
%{_datadir}/picviz/*
#-------------------------------------------------------------------------------



#-------------------------------------------------------------------------------
#| ChangeLog |
#-------------
%changelog
#-------------------------------------------------------------------------------