File tntnet.spec of Package tntnet

#
# spec file for package tntnet
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%define major   13
Name:           tntnet
Version:        3.0
Release:        0
Summary:        A web application server for web applications written in C++
License:        GPL-2.0-only
Group:          Productivity/Networking/Web/Servers
URL:            http://www.tntnet.org/index.html
Source0:        http://www.tntnet.org/download/tntnet-3.0.tar.gz
Source1:        tntnet@.service
Source2:        tntnet.target
Source99:       tntnet-rpmlintrc
# PATCH-FIX-OPENSUSE tntnet-3.0-avoid-version.patch do not create versioned module -- aloisio@gmx.com
Patch1:         tntnet-3.0-avoid-version.patch
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(cxxtools) >= 3.0
BuildRequires:  pkgconfig(libsystemd)
BuildRequires:  pkgconfig(zlib)
%systemd_requires

%description
Tntnet is a web application server for web applications written in C++.

You can write a Web-page with HTML and with special tags you embed
C++-code into the page for active contents. These pages, called
components are compiled into C++-classes with the ecpp-compilier
"ecppc", then compiled into objectcode and linked into a shared library.
This shared library is loaded by the webserver "tntnet" on request and
executed.

%package -n libtntnet%{major}
Summary:        Shared library part of tntnet
Group:          System/Libraries

%description -n libtntnet%{major}
Tntnet is a web application server for web applications written in C++.

Shared library part of tntnet

%package demos
Summary:        Example applications for tntnet
Group:          Productivity/Networking/Web/Servers
Requires:       tntnet

%description demos
Tntnet is a web application server for web applications written in C++.

This package provides few examples written in it.

%package devel
Summary:        A c++-class-library for easy database-access
Group:          Development/Libraries/C and C++
Requires:       libtntnet%{major} = %{version}
Requires:       pkgconfig(cxxtools)
Requires:       pkgconfig(zlib)
# various home projects does use spurious lib prefix for devel files, lets be compatible
Provides:       lib%{name}-devel = %{version}

%description devel
Tntnet is a web application server for web applications written in C++.
Development files

%prep
%autosetup -p1
cp -r demo demos-pure
find . -type f -name ".gitignore" -delete -print

%build
%configure --disable-static
%make_build

%install
%make_install
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}@.service
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.target
cp -r demos-pure %{buildroot}%{_datadir}/tntnet/demos
find %{buildroot} -type f -name "*.la" -delete -print
mkdir -pv %{buildroot}%{_sbindir}
pushd %{buildroot}%{_sbindir}
 ln -s %{_sbindir}/service rc%{name}
popd
%fdupes %{buildroot}%{_datadir}/tntnet/template

%pre
%service_add_pre tntnet@.service tntnet.target

%post
%service_add_post tntnet@.service tntnet.target

%preun
%service_del_preun tntnet@.service tntnet.target

%postun
%service_del_postun tntnet@.service tntnet.target

%post -n libtntnet%{major} -p /sbin/ldconfig
%postun -n libtntnet%{major} -p /sbin/ldconfig

%files
%license COPYING
%doc AUTHORS ChangeLog README
%{_bindir}/ecppc
%{_bindir}/tntnet
%{_bindir}/tntnet-project
%{_sbindir}/rc%{name}
%dir %{_sysconfdir}/tntnet
%{_datadir}/tntnet
%exclude %{_datadir}/tntnet/demos
%exclude %{_datadir}/tntnet/template
%{_mandir}/man1/ecppc.1%{?ext_man}
%{_mandir}/man1/tntnet-defcomp.1%{?ext_man}
%{_mandir}/man7/ecpp.7%{?ext_man}
%{_mandir}/man7/tntnet.xml.7%{?ext_man}
%{_mandir}/man8/tntnet.8%{?ext_man}
%{_unitdir}/%{name}@.service
%{_unitdir}/%{name}.target


%files demos
%config(noreplace)%{_sysconfdir}/tntnet/tntnet.xml
%dir %{_libdir}/tntnet
%{_libdir}/tntnet/tntnet.so
%dir %{_datadir}/tntnet
%{_datadir}/tntnet/demos

%files -n libtntnet%{major}
%{_libdir}/libtntnet_sdk.so.%{major}*
%{_libdir}/libtntnet.so.%{major}*

%files devel
%{_datadir}/tntnet/template
%{_includedir}/tnt
%{_libdir}/libtntnet_sdk.so
%{_libdir}/libtntnet.so
%{_libdir}/pkgconfig/tntnet.pc
%{_libdir}/pkgconfig/tntnet_sdk.pc

%changelog
openSUSE Build Service is sponsored by