File splashy.spec of Package splashy

#
# spec file for package splashy
#
# Copyright (c) 2012 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:           splashy
Summary:        A complete user-space boot splash system
License:        GPL-2.0+
Group:          System/Boot
Version:        0.3.13
Release:        0
Url:            http://splashy.alioth.debian.org/wiki/doku.php
PreReq:         mkinitrd coreutils
Source:         %{name}-%{version}.tar.gz
Source1:        setup-splashy.sh
Source2:        pm-utils-splashy.sh
Source3:        themes.tar.bz2
Source4:        README.themes
Source5:        splashy-branding-openSUSE.tar.bz2
Source6:        splashy-branding-SLED.tar.bz2
# Werror breaks build when used with fortify (we could also empty the _fortify_cflags macro)
#Patch0:         splashy.diff
Patch1:         splashy-0.3.8-fix-compiler-warnings.patch
Patch2:         splashy-0.3.8-glib.patch
Patch3:         splashy-disable-x11input.patch
Patch4:         splashy-0.3.13-fix-theme-path.patch
Patch5:         fix_autogen_version.diff
Patch6:         gcc46-build-fixes.patch
Patch7:         splashy-exits-prematurely-fix.patch
Patch8:         update-initramfs.patch
Patch9:         splashy-glib231.patch
Patch10:        automake-1.12.patch
BuildRequires:  DirectFB-devel
BuildRequires:  ImageMagick-devel
BuildRequires:  file-devel
BuildRequires:  glib2-devel
#BuildRequires:	procps-devel
BuildRequires:  freetype2-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libtool
# For directfb-config
Requires:       DirectFB
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Splashy is a next generation boot splashing system for Linux systems.
Unlike other splashing systems, it needs no patches to the kernel and
it´s installed like a normal package. Make your boot process eye-candy
with Splashy!

Some of Splashy´s most noticeable features include:

* Require zero kernel patches/full functionality in user-space

* Boot/halt/reboot/runlevel-switch support

* Progressbar support (with optional border)

* Verbose mode (with F2/ESC keys)

* Configuration file in XML

* Cope with any video-mode resolution/size

* Cope with 8, 16, and 24 bit framebuffers

* Alpha channel (transparency) support

* Video mode detection

* Initramfs support

* TrueType2 fonts support

* Lots of image/animation file formats supported: jpg, png, gif,
   mpg, swf

* Low dependencies and code in C to best perform

* Full LSB support

* Multiple themes support

* Really easy to create new themes

* X detection on exit

* Smooth progressbar movement

* Animations support

* Fade in/out effects

* Totally configurable

%package -n	splashy-devel
Summary:        Development tools for programs using libsplashy
Group:          Development/Languages/C and C++
Requires:       splashy = %{version}

%description -n	splashy-devel
This package contains the header files and libraries needed for
developing programs using libsplashy.

%package -n splashy-themes
Summary:        Additional themes for splashy
Group:          System/Boot
Requires:       %{name} = %{version}-%{release}

%description -n splashy-themes
Available themes: - fingerprint

- aqua

- mepis baghira

- default splashy theme



%package	branding-openSUSE
Summary:        Splashy branding for openSUSE
Group:          System/Boot
Supplements:    packageand(splashy:branding-openSUSE)
Provides:       splashy-branding = %{version}
Conflicts:      otherproviders(splashy-branding)
Requires:       splashy >= 0.3.8
PreReq:         splashy >= 0.3.8

%description	branding-openSUSE
Splashy branding for openSUSE

%package	branding-SLED
Summary:        Splashy branding for SLED
Group:          System/Boot
Supplements:    packageand(splashy:branding-SLED)
Provides:       splashy-branding = %{version}
Conflicts:      otherproviders(splashy-branding)
Requires:       splashy >= 0.3.8
PreReq:         splashy >= 0.3.8

%description	branding-SLED
Splashy branding for SLED

%post branding-openSUSE
if [ -x %{_sbindir}/splashy_config ] ; then
%{_sbindir}/splashy_config --set-theme openSUSE
fi

%postun branding-openSUSE
if [ -x %{_sbindir}/splashy_config ] ; then
%{_sbindir}/splashy_config --set-theme default
fi

%post branding-SLED
if [ -x %{_sbindir}/splashy_config ] ; then
%{_sbindir}/splashy_config --set-theme SLED
fi

%postun branding-SLED
if [ -x %{_sbindir}/splashy_config ] ; then
%{_sbindir}/splashy_config --set-theme default
fi

%prep
%setup -q
%setup -T -D -a 5
%setup -T -D -a 6
%patch1
%patch2
%patch3
%patch4 -p1
%patch5
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
find . -type f | xargs perl -pi -e "s|/usr/lib/|%{_libdir}/|g"
find . -type f | xargs perl -pi -e "s|/lib/|/%{_lib}/|g"
# build gets confused on x86_64 because of this .la file
rm -f src/libglib-2.0.la

%build
NOCONFIGURE=1 ./autogen.sh
%configure --prefix=/ --disable-static CFLAGS="$RPM_OPT_FLAGS"
make 

%pre
if test -d %{_sysconfdir}/splashy/themes -a ! -L %{_sysconfdir}/splashy/themes; then
  mv %{_sysconfdir}/splashy/themes %{_sysconfdir}/splashy/themes.bak
fi

%install
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
%makeinstall
cp -r themes $RPM_BUILD_ROOT/usr/share/splashy/
rm %{buildroot}/usr/lib*/libsplashy*.la
# remove Debian-specific files
cd %{buildroot}
rm -f  .%{_sysconfdir}/lsb-base-logging.sh
rm -rf .%{_sysconfdir}/console-tools
rm -rf .%{_datadir}/initramfs-tools
#remove splashy init script for now, it's not working anyway
#TODO, fixup init-script, install with chmod +x, link to /usr/sbin/rcsplash
rm -f .%{_sysconfdir}/init.d/splashy
mkdir -p $RPM_BUILD_ROOT/lib/mkinitrd/scripts
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/
tar xvf %{SOURCE3} -C $RPM_BUILD_ROOT/usr/share/splashy/
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/splashy/
#mkdir -p $RPM_BUILD_ROOT/usr/lib/pm-utils/sleep.d/
#cp %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/pm-utils/sleep.d/99splashy
# remove translations for now TODO: #%find_lang %name
rm %{buildroot}/%{_datadir}/locale/*/LC_MESSAGES/splashy.mo

%clean
rm -rf %{buildroot}

%post
/sbin/ldconfig
/sbin/mkinitrd_setup

%postun
/sbin/ldconfig
/sbin/mkinitrd_setup

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README TODO
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/default/*
%dir %{_sysconfdir}/splashy
%config(noreplace) %{_sysconfdir}/splashy/config.xml
%{_sbindir}/*
%{_mandir}/man1/*
%{_mandir}/man5/*
/lib/mkinitrd/scripts/setup-splashy.sh
%dir %{_datadir}/splashy
%{_libdir}/lib%{name}*.so.*
%{_datadir}/splashy/schemas
# this is a symbolic link to /usr/share/splashy/themes
%{_sysconfdir}/splashy/README.themes
%{_sysconfdir}/splashy/themes
%dir %{_datadir}/splashy/themes
/usr/share/splashy/themes/default

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

%files -n splashy-themes
%defattr(-,root,root)
%dir %{_datadir}/splashy/themes
/usr/share/splashy/themes/fingerprint
/usr/share/splashy/themes/mepis_baghira
/usr/share/splashy/themes/aqua
/usr/share/splashy/themes/openSUSE-zz

%files branding-openSUSE
%defattr(-,root,root)
%dir %{_datadir}/splashy/themes
/usr/share/splashy/themes/openSUSE

%files branding-SLED
%defattr(-,root,root)
%dir %{_datadir}/splashy/themes
/usr/share/splashy/themes/SLED

%changelog
openSUSE Build Service is sponsored by