File smt-client.spec of Package smt-client

# spec file for package smt-client
# 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

# norootforbuild

Name:           smt-client
Version:        1.0.2
Release:        0.1
Requires:       perl = %{perl_version}
Requires:       perl-XML-XPath
Requires:       perl-XML-Parser
Requires:       perl-XML-Writer
Requires:       perl-IO-Socket-SSL
Requires:       perl-base
Requires:       perl-libwww-perl
Requires:       perl-LWP-Protocol-https
Requires:       logrotate
Requires:       cron
Requires:       zypper >= 1.3.14
Requires:       libzypp >= 6.36.0
Conflicts:      smt <= 1.1.21
PreReq:         %fillup_prereq
AutoReqProv:    on
Group:          Productivity/Networking/Web/Proxy
License:        GPL-2.0+
Summary:        Subscription Management Tool
Source:         %{name}-%{version}.tar.bz2
Source1:        sysconfig.smt-client
Source2:        smt-client-rpmlintrc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This package provide everything you need to get a local NU and
registration proxy.


%setup -n %{name}-%{version}
cp -p %{S:1} .
# ---------------------------------------------------------------------------



make DESTDIR=$RPM_BUILD_ROOT DOCDIR=%{_docdir} install

mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates/
install -m 644 sysconfig.smt-client  $RPM_BUILD_ROOT/var/adm/fillup-templates/

# touching the ghost
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/
touch $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/

# ---------------------------------------------------------------------------

[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT

if [ ! -s /etc/cron.d/ ]; then
    minute=`expr $RANDOM % 60`
    echo "$minute */3 * * * root /usr/sbin/smt-agent" > %{_sysconfdir}/cron.d/
exit 0

%dir %{perl_vendorlib}/SMT
%dir %{perl_vendorlib}/SMT/Agent
%dir /usr/lib/SMT
%dir /usr/lib/SMT/bin
%dir /usr/lib/SMT/bin/job
%ghost %{_sysconfdir}/cron.d/
%config /etc/logrotate.d/smt-client
%ghost %dir /run/smtclient
%dir %{_docdir}/smt-client