File ccfe.spec of Package ccfe

#
# spec file for package ccfe
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2011-2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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:           ccfe
Version:        1.58
Release:        0
Summary:        Curses Command Frontend
License:        GPL-2.0+
Group:          System/Management
URL:            http://ccfe.altervista.org/
Source:         http://ccfe.altervista.org/dnload/ccfe-%{version}.tar.gz
Patch1:         ccfe-destdir.patch
BuildRequires:  perl(Curses)
BuildRequires:  perl(File::Temp)
BuildRequires:  perl(Sys::Hostname)
BuildRequires:  perl(Term::ANSIColor)
Requires:       perl-base = %{perl_version}
Requires:       perl(Curses)
Requires:       perl(File::Temp)
Requires:       perl(Sys::Hostname)
Requires:       perl(Term::ANSIColor)
BuildArch:      noarch
BuildRoot:      %{_tmppath}/build-%{name}-%{version}

%description
CCFE is a simple tool to quickly supply an interactive screen-oriented
interface to command line scripts and commands: it prompts users for the
informations needed to run them, and can be programmed with your preferred
shell to provide predefined selections and/or run-time defaults.

It provides:
* A generic curses form-based interface to enter options and arguments required by scripts/commands;
* A menu system to hierarchically organize them;
* A viewer to browse the standard output and standard error of invoked script/command.

In its simplest usage, you only have to describe the data type requested by the
command and specify the command itself: user interaction and screen layout are
automatically adapted so you don't have to care about it, but for complex
situations, CCFE is programmable with your preferred shell command language
interpreter and can propose lists of admitted values selectable by user for
parameters to enter.

%prep
%setup -q
%patch1
# fix shebang
sed -i 's|^#!/usr/bin/env perl|#!%{_bindir}/perl|' ccfe.pl

%build

%install
DESTDIR=%{buildroot} \
./install.sh \
    -b \
    -p "%{_prefix}" \
    -c "%{_sysconfdir}" \
    -l "%{_prefix}/lib" \
    -e "%{_bindir}" \
    -o "%{_localstatedir}/log/%{name}" \
    -m "%{_datadir}/%{name}/locale" \
    -a "%{_mandir}" \
    -d "%{_docdir}/%{name}"

find "%{buildroot}%{_prefix}/lib/ccfe/" -type f -exec chmod 0644 {} \;
rm -f "%{buildroot}%{_docdir}/%{name}"/install.sh
find "%{buildroot}%{_docdir}/%{name}/" -type f -exec chmod 0644 {} \;

install -d "%{buildroot}%{_localstatedir}/log/%{name}"

L="$PWD/ccfe.lang"
echo -n >"$L"
pushd "%{buildroot}%{_datadir}/%{name}/locale"
/bin/ls -1 | while read d; do
    echo "%lang($d) %doc %{_datadir}/%{name}/locale/$d" >>"$L"
    echo "%lang($d) %doc %{_datadir}/%{name}/locale/$d/ccfe" >>"$L"
done
popd #locale

%files -f ccfe.lang
%defattr(-,root,root)
%docdir %{_docdir}/%{name}
%dir %doc %{_docdir}/%{name}
%doc %{_docdir}/%{name}/*
%config(noreplace) %{_sysconfdir}/ccfe.conf
%config(noreplace) %{_sysconfdir}/ccfeinstall.conf
%{_bindir}/ccfe
%{_prefix}/lib/ccfe
%dir %{_datadir}/ccfe
%dir %{_datadir}/ccfe/locale
%dir %{_localstatedir}/log/%{name}
%{_mandir}/man1/ccfe.1%{ext_man}
%{_mandir}/man5/ccfe*.5%{ext_man}

%changelog
openSUSE Build Service is sponsored by