File kmscon.spec of Package kmscon

#
# spec file for package kmscon
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Adam Mizerski <adam@mizerski.pl>
#
# 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/
#


%define eloop_sover 1
%define tsm_sover 1
%define uterm_sover 1

Name:           kmscon
Version:        5.git153
Release:        0
Summary:        Linux KMS/DRM based virtual Console Emulator
License:        MIT
Group:          System/Console
Url:            https://github.com/dvdhrm/kmscon/wiki/KMSCON

#Git-Clone:	git://github.com/dvdhrm/kmscon
Source:         %name-%version.tar.xz
# PATCH-FEATURE-OPENSUSE kmscon-no-date-time.patch adam@mizerski.pl -- remove __DATE__ and __TIME__. build-compare doesn't like them.
Patch0:         kmscon-no-date-time.patch
BuildRequires:  autoconf >= 2.68
BuildRequires:  automake >= 1.11
BuildRequires:  libtool >= 2.2
BuildRequires:  pkgconfig
BuildRequires:  xz
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(fontconfig)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gbm)
BuildRequires:  pkgconfig(glesv2)
BuildRequires:  pkgconfig(libdrm)
BuildRequires:  pkgconfig(libsystemd-login)
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(pango)
BuildRequires:  pkgconfig(pangoft2)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-cursor)
BuildRequires:  pkgconfig(wayland-server)
BuildRequires:  pkgconfig(xkbcommon)

%description
Kmscon is a simple terminal emulator based on linux kernel mode setting (KMS).
It is an attempt to replace the in-kernel VT implementation with a userspace
console.

%package service
Summary:        Kmscon service files
Group:          System/Daemons
BuildArch:      noarch
%{?systemd_requires}

%description service
This package provides the service unit files for systemd.

%package -n wlterm
Summary:        Wayland native client terminal emulator
Group:          Productivity/Other
# There is System/X11/Terminals, but wayland is not X11 and there is no group for Wayland

%description -n wlterm
Wayland native client terminal emulator.

%package -n libeloop%{eloop_sover}
Summary:        Epoll-based Event-Loop Library
Group:          Development/Libraries/C and C++

%description -n libeloop%{eloop_sover}
Epoll-based Event-Loop Library.

%package -n libeloop-devel
Summary:        Development libraries for libeloop
Group:          Development/Libraries/C and C++
Requires:       libeloop%{eloop_sover} = %{version}

%description -n libeloop-devel
Development libraries for libeloop.

%package -n libtsm%{tsm_sover}
Summary:        Terminal-emulator State Machine
Group:          Development/Libraries/C and C++

%description -n libtsm%{tsm_sover}
Terminal-emulator State Machine.

%package -n libtsm-devel
Summary:        Development libraries for libtsm
Group:          Development/Libraries/C and C++
Requires:       libtsm%{tsm_sover} = %{version}

%description -n libtsm-devel
Development libraries for libtsm.

%package -n libuterm%{uterm_sover}
Summary:        User-space Terminal Video/Input/Hotplug/etc Helper Library
Group:          Development/Libraries/C and C++

%description -n libuterm%{uterm_sover}
User-space Terminal Video/Input/Hotplug/etc Helper Library.

%package -n libuterm-devel
Summary:        Development libraries for libuterm
Group:          Development/Libraries/C and C++
Requires:       libuterm%{uterm_sover} = %{version}

%description -n libuterm-devel
Development libraries for libuterm.

%prep
%setup -q
%patch0 -p1

%build
mkdir -p m4
autoreconf -i
%configure \
    --enable-debug \
    --disable-static
make V=1 %{?_smp_mflags}

%install
%make_install
rm %{buildroot}%{_libdir}/*.la
install -m 644 -D docs/kmscon.service %{buildroot}%{_unitdir}/%{name}.service

%pre service
%service_add_pre %{name}.service

%post service
%service_add_post %{name}.service

%preun service
%service_del_preun %{name}.service

%postun service
%service_del_postun %{name}.service

%post -n libeloop%{eloop_sover} -p /sbin/ldconfig
%postun -n libeloop%{eloop_sover} -p /sbin/ldconfig
%post -n libtsm%{tsm_sover} -p /sbin/ldconfig
%postun -n libtsm%{tsm_sover} -p /sbin/ldconfig
%post -n libuterm%{uterm_sover} -p /sbin/ldconfig
%postun -n libuterm%{uterm_sover} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_bindir}/%{name}

%files service
%defattr(-,root,root,-)
%config(noreplace) %{_unitdir}/%{name}.service

%files -n wlterm
%defattr(-,root,root,-)
%{_bindir}/wlterm

%files -n libeloop%{eloop_sover}
%defattr(-,root,root,-)
%{_libdir}/libeloop.so.*

%files -n libeloop-devel
%defattr(-,root,root,-)
%{_includedir}/eloop.h
%{_libdir}/libeloop.so
%{_libdir}/pkgconfig/libeloop.pc

%files -n libtsm%{tsm_sover}
%defattr(-,root,root,-)
%{_libdir}/libtsm.so.*

%files -n libtsm-devel
%defattr(-,root,root,-)
%{_includedir}/tsm*.h
%{_libdir}/libtsm.so
%{_libdir}/pkgconfig/libtsm.pc

%files -n libuterm%{uterm_sover}
%defattr(-,root,root,-)
%{_libdir}/libuterm.so.*

%files -n libuterm-devel
%defattr(-,root,root,-)
%{_includedir}/uterm*.h
%{_libdir}/libuterm.so
%{_libdir}/pkgconfig/libuterm.pc

%changelog
openSUSE Build Service is sponsored by