File kmscon.spec of Package kmscon

#
# spec file for package kmscon
#
# Copyright (c) 2013 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:        7
Release:        0
Summary:        Linux KMS/DRM based virtual Console Emulator
License:        MIT
Group:          System/Console
Url:            http://freedesktop.org/wiki/Software/kmscon

#Git-Clone:	git://github.com/dvdhrm/kmscon
#DL-URL:	http://people.freedesktop.org/~dvdhrm/kmscon/releases/
Source:         %name-%version.tar.xz
Patch1:         kmscon-no-date-time.patch
Patch2:         kmscon-x-linking.patch
BuildRequires:  autoconf >= 2.68
BuildRequires:  automake >= 1.11
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  libtool >= 2.2
BuildRequires:  pkgconfig
BuildRequires:  xsltproc
BuildRequires:  xz
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(fontconfig)
BuildRequires:  pkgconfig(fuse)
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)
# O/P added for 13.1
Obsoletes:      %name-service < %version-%release
Provides:       %name-service < %version-%release

%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 -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:          System/Libraries

%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:          System/Libraries

%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:          System/Libraries

%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
%patch -P 1 -p1 -P 2 -p1

%build
echo "#define BUILD_GIT_HEAD \"unknown-revision\"" > src/githead.h
mkdir -p m4
autoreconf -fiv
%configure --enable-wlterm --enable-debug --disable-static
make %{?_smp_mflags}

%install
b="%buildroot"
make install DESTDIR="$b"
mkdir -p "$b/%_unitdir"
install -pm0644 docs/*.service "$b/%_unitdir/"
find "$b" -type f -name "*.la" -print -delete

%pre
%service_add_pre %name.service

%post
%service_add_post %name.service

%preun
%service_del_preun %name.service

%postun
%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
%dir %_libdir/kmscon
%_libdir/kmscon/*.so
%_mandir/man1/kmscon.1*
%_unitdir/kmscon*.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