File scotty.spec of Package scotty

#
# spec file for package scotty
#
# Copyright (c) 2011 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/
#

# norootforbuild


Name:           scotty
BuildRequires:  tk-devel xorg-x11-devel
License:        X11/MIT
Group:          Development/Libraries/Tcl
Url:            http://wwwhome.cs.utwente.nl/~schoenw/scotty/
Requires:       tcl tk
PreReq:         permissions
AutoReqProv:    on
Version:        2.1.11
Release:        808
Summary:        Tcl Extensions for Network Management Applications
Source:         %{name}-%{version}.tar.bz2
Patch:          %{name}-%{version}.dif
Patch1:         ntping.dif
Patch2:         scotty-http.patch
Patch3:         strcmp.patch
Patch4:         tkined-tcl85.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Scotty is a software package which allows implementation of
site-specific network management software using high-level,
string-based APIs. The software is based on the Tool Command Language
which simplifies the development of portable network management
scripts.  The scotty source distribution includes two major components.
The first one is the Tnm Tcl Extension which provides access to network
management information sources. The second component is the Tkined
network editor which provides a framework for an extensible network
management system.



Authors:
--------
    Jürgen Schönwälder <schoenw@cs.utwente.nl>

%prep
%setup -q
%patch
%patch1
%patch2
%patch3
%patch4

%build
cd unix
sed -i -e "s@res_mkquery@res_gethostbyname@" configure
export CFLAGS="%optflags -fno-strict-aliasing -DUSE_NON_CONST"
%configure \
	--with-tcl-config=%{_libdir} \
	--with-tk-config=%{_libdir}
make CFLAGS="$CFLAGS" tclscriptdir=%tclscriptdir

%install
cd unix
make install sinstall \
	MAN_INSTALL_DIR=%buildroot%_mandir \
	prefix=%buildroot%_prefix \
	exec_prefix=%buildroot%_exec_prefix \
	libdir=%buildroot%_libdir \
	tclscriptdir=%buildroot%tclscriptdir
mkdir -p   %buildroot/var/games
touch      %buildroot/var/games/ined.scores
chmod 0664 %buildroot/var/games/ined.scores
for i in $(find %buildroot -name pkgIndex.tcl) ; do
  sed -i -e "s,%buildroot,," $i
done
pushd %buildroot%_bindir
	ln -s scotty?* scotty
	ln -s tkined?* tkined
popd
for f in dns http icmp ined job mib netdb ntp snmp sunrpc syslog udp
do mv %buildroot%_mandir/mann/$f.n \
	%buildroot%_mandir/mann/Tnm::$f.n
done

%clean
rm -rf %buildroot

%post
%run_ldconfig
%run_permissions

%postun
%run_ldconfig
%verifyscript
%verify_permissions -e %{_bindir}/ntping

%files
%defattr(-,root,root)
%doc %_mandir/*/*
%verify(not mode) %attr(4750,root,trusted) %{_bindir}/ntping
%attr(755,root,root)%{_bindir}/straps
%_bindir/*
%_libdir/*.so
%tclscriptdir
%attr(-,root,games)/var/games/ined.scores

%changelog
openSUSE Build Service is sponsored by