File scotty.spec of Package scotty

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

Name:           scotty
BuildRequires:  tk-devel
BuildRequires:  xorg-x11-devel
Requires:       tcl
Requires:       tk
PreReq:         permissions
Version:        2.1.11
Release:        0
Summary:        Tcl Extensions for Network Management Applications
License:        MIT
Group:          Development/Libraries/Tcl
Source:         %{name}-%{version}.tar.bz2
Patch:          %{name}-%{version}.dif
Patch1:         ntping.dif
Patch2:         scotty-http.patch
Patch3:         strcmp.patch
Patch4:         tkined-tcl85.patch
Patch5:         scotty-pie.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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.

    Jürgen Schönwälder <>

%setup -q
%patch5 -p1

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} \
make CFLAGS="$CFLAGS" tclscriptdir=%tclscriptdir

cd unix
make install sinstall \
	MAN_INSTALL_DIR=%buildroot%_mandir \
	prefix=%buildroot%_prefix \
	exec_prefix=%buildroot%_exec_prefix \
	libdir=%buildroot%_libdir \
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
pushd %buildroot%_bindir
	ln -s scotty?* scotty
	ln -s tkined?* tkined
for f in dns http icmp ined job mib netdb ntp snmp sunrpc syslog udp
do mv %buildroot%_mandir/mann/$f.n \

rm -rf %buildroot

%set_permissions /usr/bin/ntping

%verify_permissions -e %{_bindir}/ntping

%doc %_mandir/*/*
%verify(not mode) %attr(4750,root,trusted) %{_bindir}/ntping

openSUSE Build Service is sponsored by