File source-highlight.spec of Package source-highlight

#
# spec file for package source-highlight
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#



Name:           source-highlight
Version:        3.1.4
Release:        1
Summary:        Source Code Highlighter with Support for Many Languages
# ftp://ftp.gnu.org/gnu/src-highlite/source-highlight-%{version}.tar.gz
Source:         source-highlight-%{version}.tar.bz2
Source1:        source-highlight-apache2.conf
Source99:       %{name}-rpmlintrc
Patch1:         source-highlight-boost_ldflags_lib64.patch
Patch2:         source-highlight-doxygen_disable_timestamp_in_footer.patch
Url:            http://www.gnu.org/software/src-highlite
Group:          Productivity/Publishing/Other
License:        GNU General Public License version 3 (GPLv3)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  bison flex gcc-c++ glibc-devel libstdc++-devel make
BuildRequires:  boost-devel help2man libicu-devel texinfo
BuildRequires:  ctags doxygen graphviz
BuildRequires:  autoconf automake libtool pkgconfig
BuildRequires:  apache2
%if 0%{?suse_version} >= 1030
BuildRequires:  fdupes
%endif
PreReq:         %install_info_prereq
Requires:       libsource-highlight3 = %{version}-%{release}

%description
Source-highlight reads source language specifications dynamically, thus it can
be easily extended (without recompiling the sources) for handling new
languages. It also reads output format specifications dynamically, and thus it
can be easily extended (without recompiling the sources) for handling new
output formats. The syntax for these specifications is quite easy (take a look
at the manual).




Authors:
--------
    Lorenzo Bettini <bettini@dsi.unifi.it>

%package -n libsource-highlight3
License:        GNU General Public License version 3 (GPLv3)
Summary:        Source Code Highlighting C++ Library
Group:          System/Libraries
Requires:       ctags

%description -n libsource-highlight3
Source-highlight reads source language specifications dynamically, thus it can
be easily extended (without recompiling the sources) for handling new
languages. It also reads output format specifications dynamically, and thus it
can be easily extended (without recompiling the sources) for handling new
output formats. The syntax for these specifications is quite easy (take a look
at the manual).

libsource-highlight is a C++ library that provides the features of
Source-highlight.



Authors:
--------
    Lorenzo Bettini <bettini@dsi.unifi.it>

%package -n libsource-highlight-devel
License:        GNU General Public License version 3 (GPLv3)
Summary:        Source Code Highlighting C++ Library
Group:          Development/Libraries/C and C++
Requires:       libsource-highlight3 = %{version}-%{release}
PreReq:         %install_info_prereq

%description -n libsource-highlight-devel
Source-highlight reads source language specifications dynamically, thus it can
be easily extended (without recompiling the sources) for handling new
languages. It also reads output format specifications dynamically, and thus it
can be easily extended (without recompiling the sources) for handling new
output formats. The syntax for these specifications is quite easy (take a look
at the manual).

libsource-highlight is a C++ library that provides the features of
Source-highlight.

%package cgi
License:        GNU General Public License version 3 (GPLv3)
Summary:        Source Code Highlighting CGI
Group:          Productivity/Networking/Web/Utilities
Requires:       libsource-highlight3 = %{version}-%{release}
Requires:       apache2

%description cgi
Source-highlight reads source language specifications dynamically, thus it can
be easily extended (without recompiling the sources) for handling new
languages. It also reads output format specifications dynamically, and thus it
can be easily extended (without recompiling the sources) for handling new
output formats. The syntax for these specifications is quite easy (take a look
at the manual).

This package contains a CGI that can be used to highlight source code on
your webserver using source-highlight.

%prep
%setup -q
%if "%{_lib}"=="lib64"
%patch1
%endif
%patch2
%__sed -i 's/\r//g' doc/*.css

%build
BOOST_REGEX=$(/bin/ls -1 "%{_libdir}"/libboost_regex*mt*.so 2>/dev/null | head -1)
[ -n "$BOOST_REGEX" ] || BOOST_REGEX=$(/bin/ls -1 "%{_libdir}"/libboost_regex*.so 2>/dev/null | head -1)
if [ -n "$BOOST_REGEX" ]; then
    BOOST_REGEX="${BOOST_REGEX##*/lib}"
    BOOST_REGEX="${BOOST_REGEX%.so}"
    BOOST_REGEX_PARAM="--with-boost-regex=${BOOST_REGEX}"
else
    BOOST_REGEX_PARAM=""
fi

%configure \
    "$BOOST_REGEX_PARAM" \
    --with-bash-completion="%{_sysconfdir}/bash_completion.d" \
    --with-doxygen

%__make %{?jobs:-j%{jobs}}

%__make %{?jobs:-j%{jobs}} -C src source-highlight-cgi

%install
%makeinstall

%__install -d "%{buildroot}/srv/source-highlight"
libtool --mode=install install -m 0755 src/source-highlight-cgi "%{buildroot}/srv/source-highlight/source-highlight.cgi"
%__install -D -m0644 "%{SOURCE1}" "%{buildroot}/etc/apache2/conf.d/%{name}.conf"

%__rm "%{buildroot}%{_libdir}"/*.la
%__rm "%{buildroot}%{_datadir}/aclocal"/*boost*.m4

%__rm -rf "%{buildroot}%{_docdir}/%{name}/html"
%__rm -rf "%{buildroot}%{_datadir}/doc"

%__chmod 0644 AUTHORS ChangeLog COPYING CREDITS NEWS README THANKS TODO.txt

%if 0%{?suse_version} >= 1030
%fdupes -s "%{buildroot}%{_datadir}/"
%endif

%post
%install_info --info-dir="%{_infodir}" "%{_infodir}/source-highlight".info%{ext_info}

%postun
%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/source-highlight".info%{ext_info}

%post -n libsource-highlight-devel
%install_info --info-dir="%{_infodir}" "%{_infodir}/source-highlight-lib".info%{ext_info}

%postun -n libsource-highlight-devel
%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/source-highlight-lib".info%{ext_info}

%post   -n libsource-highlight3 -p /sbin/ldconfig

%postun -n libsource-highlight3 -p /sbin/ldconfig

%clean
%__rm -rf "%{buildroot}"

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING CREDITS NEWS README THANKS TODO.txt
%config %{_sysconfdir}/bash_completion.d/source-highlight-bash-completion
%{_bindir}/check-regexp
%{_bindir}/cpp2html
%{_bindir}/java2html
%{_bindir}/source-highlight
%{_bindir}/src-hilite-lesspipe.sh
%{_bindir}/source-highlight-settings
%dir %{_datadir}/source-highlight
%{_datadir}/source-highlight/*
%doc %{_mandir}/man1/check-regexp.1%{ext_man}
%doc %{_mandir}/man1/source-highlight.1%{ext_man}
%doc %{_mandir}/man1/source-highlight-settings.1%{ext_man}
%doc %{_infodir}/source-highlight.info%{ext_man}

%files -n libsource-highlight3
%defattr(-,root,root)
%{_libdir}/libsource-highlight.so.3
%{_libdir}/libsource-highlight.so.3.*.*

%files -n libsource-highlight-devel
%defattr(-,root,root)
%{_includedir}/srchilite
%{_libdir}/libsource-highlight.so
%{_libdir}/libsource-highlight.a
%{_libdir}/pkgconfig/source-highlight.pc
%doc %{_infodir}/source-highlight-lib.info%{ext_info}

%files cgi
%defattr(-,root,root)
%config(noreplace) /etc/apache2/conf.d/source-highlight.conf
%dir /srv/source-highlight
/srv/source-highlight/source-highlight.cgi

%changelog
openSUSE Build Service is sponsored by