File suseRegister.spec of Package suseRegister

#
# spec file for package suseRegister
#
# Copyright (c) 2013 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:           suseRegister
Version:        1.4
Release:        1.<RELEASE33>
Summary:        Registration Tool
License:        GPL-2.0+
Group:          Productivity/Other
Source:         %{name}-%{version}.tar.bz2
Source1:        cron_suse_register
Source2:        clientSetup4SMT.sh
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       cron
Requires:       curl
Requires:       distribution-release
Requires:       hwinfo
Requires:       openssl-certs
Requires:       perl = %{perl_version}
Requires:       perl-URI
Requires:       perl-WWW-Curl
Requires:       perl-XML-Parser
Requires:       perl-XML-Writer
Requires:       sysconfig
Requires:       util-linux
Requires:       wget
Requires:       zypper >= 0.12.6
PreReq:         coreutils sed grep
BuildArch:      noarch

%description
Command line tool for registering Novell and SUSE products.



Authors:
--------
    Michael Calmer <Michael.Calmer@novell.com>

%prep
%setup -q

%build

%install
mkdir -p $RPM_BUILD_ROOT/var/lib/suseRegister/
mkdir -p $RPM_BUILD_ROOT/usr/lib/suseRegister/bin
make DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} SYSCONFIGDIR=%{_sysconfdir} install
install -m 755 %{S:1} $RPM_BUILD_ROOT/usr/lib/suseRegister/bin
install -m 755 %{S:2} $RPM_BUILD_ROOT/usr/lib/suseRegister/bin/
# touching the ghost
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/
touch $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/novell.com-suse_register

%post
if [ ! -s %{_sysconfdir}/cron.d/novell.com-suse_register ]; then
    date +"%M %H %d * * root /usr/lib/suseRegister/bin/cron_suse_register" > %{_sysconfdir}/cron.d/novell.com-suse_register
elif ! grep "root /usr/lib/suseRegister/bin/cron_suse_register" %{_sysconfdir}/cron.d/novell.com-suse_register > /dev/null 2>&1 ; then
    sed -i 's/ \/usr\/lib\/suseRegister\/bin\/cron_suse_register/ root \/usr\/lib\/suseRegister\/bin\/cron_suse_register/' %{_sysconfdir}/cron.d/novell.com-suse_register
fi

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%doc COPYING COPYRIGHT.english README
%config %{_sysconfdir}/*.conf
%dir /usr/lib/suseRegister
%dir /usr/lib/suseRegister/bin
%{perl_vendorlib}/SUSE
%{_bindir}/*
%dir /var/lib/suseRegister
%ghost %{_sysconfdir}/cron.d/novell.com-suse_register
/usr/lib/suseRegister/bin/*

%changelog
openSUSE Build Service is sponsored by