Browse Source

completely work-off packaging

master
parent
commit
dd86542d7d
  1. 340
      inetutils/inetutils.patch
  2. 30
      inetutils/inetutils.spec
  3. 62
      inetutils/setenv.c
  4. 29
      inetutils/setenv.h
  5. 65
      inetutils/unsetenv.c
  6. 29
      inetutils/unsetenv.h

340
inetutils/inetutils.patch

@ -1,84 +1,6 @@
--- libinetutils/xalloc.h.orig 2002-12-11 13:51:10.000000000 +0100
+++ libinetutils/xalloc.h 2003-09-12 16:25:19.000000000 +0200
@@ -39,7 +39,9 @@
/* Exit value when the requested amount of memory is not available.
It is initialized to EXIT_FAILURE, but the caller may set it to
some other value. */
+#ifdef __GLIBC__
extern int xalloc_exit_failure;
+#endif
/* If this pointer is non-zero, run the specified function upon each
allocation failure. It is initialized to zero. */
--- libinetutils/xmalloc.c.orig 2002-12-11 13:42:01.000000000 +0100
+++ libinetutils/xmalloc.c 2003-09-12 16:25:51.000000000 +0200
@@ -23,6 +23,7 @@
#if STDC_HEADERS
# include <stdlib.h>
+# include <stdio.h>
#else
void *calloc ();
void *malloc ();
@@ -34,7 +35,9 @@
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
+#ifdef __GLIBC__
#include "error.h"
+#endif
#include "xalloc.h"
#ifndef EXIT_FAILURE
@@ -53,7 +56,9 @@
/* Exit value when the requested amount of memory is not available.
The caller may set it to some other value. */
+#ifdef __GLIBC__
int xalloc_exit_failure = EXIT_FAILURE;
+#endif
/* If non NULL, call this function when memory is exhausted. */
void (*xalloc_fail_func) PARAMS ((void)) = 0;
@@ -67,7 +72,11 @@
{
if (xalloc_fail_func)
(*xalloc_fail_func) ();
+#ifdef __GLIBC__
error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted));
+#else
+ fprintf(stderr, "%s", _(xalloc_msg_memory_exhausted));
+#endif
/* The `noreturn' cannot be given to error, since it may return if
its first argument is 0. To help compilers understand the
xalloc_die does terminate, call exit. */
--- talk/io.c.orig 2001-06-02 17:27:15.000000000 +0200
+++ talk/io.c 2003-09-12 16:27:15.000000000 +0200
@@ -129,7 +129,9 @@
}
extern int errno;
+#if !defined(__FreeBSD__)
extern int sys_nerr;
+#endif
/*
* p_error prints the system error message on the standard location
Index: libinetutils/ttymsg.c
--- libinetutils/ttymsg.c.orig 2001-11-01 16:52:19 +0100
+++ libinetutils/ttymsg.c 2006-01-23 11:52:04 +0100
@@ -132,7 +132,7 @@
}
if (wret)
{
- (char *)iov->iov_base += wret;
+ iov->iov_base += wret;
iov->iov_len -= wret;
}
continue;
Index: ftp/ftp_var.h
--- ftp/ftp_var.h.orig 2000-07-08 03:00:53 +0200
+++ ftp/ftp_var.h 2006-01-23 14:39:09 +0100
--- ftp/ftp_var.h.orig 2000-07-08 03:00:53.000000000 +0200
+++ ftp/ftp_var.h 2006-10-06 08:11:07.845316590 +0200
@@ -36,6 +36,24 @@
#include <sys/param.h>
#include <setjmp.h>
@ -128,8 +50,9 @@ Index: ftp/ftp_var.h
FTP_EXTERN int macnum; /* number of defined macros */
FTP_EXTERN struct macel macros[16];
--- libinetutils/revoke.c.orig 2006-03-30 16:00:38.000000000 -0500
+++ libinetutils/revoke.c 2006-03-30 16:00:44.000000000 -0500
Index: libinetutils/revoke.c
--- libinetutils/revoke.c.orig 2002-06-26 05:15:06.000000000 +0200
+++ libinetutils/revoke.c 2006-10-06 08:11:07.855316674 +0200
@@ -10,6 +10,14 @@
extern int errno;
#endif
@ -150,3 +73,256 @@ Index: ftp/ftp_var.h
return -1;
}
+#endif
Index: libinetutils/setenv.c
--- libinetutils/setenv.c.orig 2002-12-11 13:40:24.000000000 +0100
+++ libinetutils/setenv.c 2006-10-06 08:12:44.556778332 +0200
@@ -1,129 +1,49 @@
-/* Copyright (C) 1992, 1995, 2000 Free Software Foundation, Inc.
-
-NOTE: The canonical source of this file is maintained with the GNU C Library.
-Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA. */
#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <errno.h>
-
-#if _LIBC || HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if _LIBC || HAVE_STRING_H
-# include <string.h>
-#endif
-#if _LIBC || HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#ifndef HAVE_GNU_LD
-# define __environ environ
+#include "config.h"
#endif
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
-int
-setenv (name, value, replace)
- const char *name;
- const char *value;
- int replace;
+#ifndef HAVE_SETENV
+int setenv(const char *kszName, const char *kszValue, int nOverwrite)
{
- register char **ep;
- register size_t size;
- const size_t namelen = strlen (name);
- const size_t vallen = strlen (value) + 1;
-
- size = 0;
- for (ep = __environ; *ep != NULL; ++ep)
- if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
- break;
- else
- ++size;
-
- if (*ep == NULL)
- {
- static char **last_environ;
- char **new_environ;
- if (__environ == last_environ)
- /* We allocated this space; we can extend it. */
- new_environ = (char **) realloc (last_environ,
- (size + 2) * sizeof (char *));
- else
- new_environ = (char **) malloc ((size + 2) * sizeof (char *));
-
- if (new_environ == NULL)
- return -1;
-
- new_environ[size] = malloc (namelen + 1 + vallen);
- if (new_environ[size] == NULL)
- {
- free ((char *) new_environ);
- errno = ENOMEM;
- return -1;
- }
-
- if (__environ != last_environ)
- memcpy ((char *) new_environ, (char *) __environ,
- size * sizeof (char *));
-
- memcpy (new_environ[size], name, namelen);
- new_environ[size][namelen] = '=';
- memcpy (&new_environ[size][namelen + 1], value, vallen);
-
- new_environ[size + 1] = NULL;
-
- last_environ = __environ = new_environ;
- }
- else if (replace)
- {
- size_t len = strlen (*ep);
- if (len + 1 < namelen + 1 + vallen)
- {
- /* The existing string is too short; malloc a new one. */
- char *new = malloc (namelen + 1 + vallen);
- if (new == NULL)
- return -1;
- *ep = new;
- }
- memcpy (*ep, name, namelen);
- (*ep)[namelen] = '=';
- memcpy (&(*ep)[namelen + 1], value, vallen);
- }
+ char *szPair = NULL;
- return 0;
+ if (nOverwrite == 0 && getenv(kszName) != 0)
+ return 0;
+ szPair = malloc(strlen(kszName) + 1 + strlen(kszValue) + 1);
+ if (szPair == NULL)
+ return -1;
+ strcpy(szPair, kszName);
+ strcat(szPair, "=");
+ strcat(szPair, kszValue);
+ putenv(szPair);
+ return 0;
}
+#endif /* !HAVE_SETENV */
-void
-unsetenv (name)
- const char *name;
+#ifndef HAVE_UNSETENV
+extern char **environ;
+void unsetenv(const char *kszName)
{
- const size_t len = strlen (name);
- char **ep;
-
- for (ep = __environ; *ep; ++ep)
- if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
- {
- /* Found it. Remove this pointer by moving later ones back. */
- char **dp = ep;
- do
- dp[0] = dp[1];
- while (*dp++);
- /* Continue the loop in case NAME appears again. */
- }
+ int nLen;
+ const char *kszTail;
+ char **ppEnv;
+
+ if (kszName == 0 || environ == 0)
+ return;
+ for (kszTail = kszName; *kszTail && *kszTail != '='; kszTail++)
+ /* noop */;
+ nLen = kszTail - kszName;
+ for (ppEnv = environ; *ppEnv != 0; ppEnv++)
+ if (strncmp(*ppEnv, kszName, nLen) == 0 && (*ppEnv)[nLen] == '=')
+ break;
+ while (*ppEnv != 0) {
+ *ppEnv = *(ppEnv + 1);
+ ppEnv++;
+ }
}
+#endif /* !HAVE_UNSETENV */
+
Index: libinetutils/ttymsg.c
--- libinetutils/ttymsg.c.orig 2001-11-01 16:52:19.000000000 +0100
+++ libinetutils/ttymsg.c 2006-10-06 08:11:07.855316674 +0200
@@ -132,7 +132,7 @@
}
if (wret)
{
- (char *)iov->iov_base += wret;
+ iov->iov_base += wret;
iov->iov_len -= wret;
}
continue;
Index: libinetutils/xalloc.h
--- libinetutils/xalloc.h.orig 2002-12-11 13:51:10.000000000 +0100
+++ libinetutils/xalloc.h 2006-10-06 08:11:07.855316674 +0200
@@ -39,7 +39,9 @@
/* Exit value when the requested amount of memory is not available.
It is initialized to EXIT_FAILURE, but the caller may set it to
some other value. */
+#ifdef __GLIBC__
extern int xalloc_exit_failure;
+#endif
/* If this pointer is non-zero, run the specified function upon each
allocation failure. It is initialized to zero. */
Index: libinetutils/xmalloc.c
--- libinetutils/xmalloc.c.orig 2002-12-11 13:42:01.000000000 +0100
+++ libinetutils/xmalloc.c 2006-10-06 08:11:07.855316674 +0200
@@ -23,6 +23,7 @@
#if STDC_HEADERS
# include <stdlib.h>
+# include <stdio.h>
#else
void *calloc ();
void *malloc ();
@@ -34,7 +35,9 @@
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
+#ifdef __GLIBC__
#include "error.h"
+#endif
#include "xalloc.h"
#ifndef EXIT_FAILURE
@@ -53,7 +56,9 @@
/* Exit value when the requested amount of memory is not available.
The caller may set it to some other value. */
+#ifdef __GLIBC__
int xalloc_exit_failure = EXIT_FAILURE;
+#endif
/* If non NULL, call this function when memory is exhausted. */
void (*xalloc_fail_func) PARAMS ((void)) = 0;
@@ -67,7 +72,11 @@
{
if (xalloc_fail_func)
(*xalloc_fail_func) ();
+#ifdef __GLIBC__
error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted));
+#else
+ fprintf(stderr, "%s", _(xalloc_msg_memory_exhausted));
+#endif
/* The `noreturn' cannot be given to error, since it may return if
its first argument is 0. To help compilers understand the
xalloc_die does terminate, call exit. */
Index: talk/io.c
--- talk/io.c.orig 2001-06-02 17:27:15.000000000 +0200
+++ talk/io.c 2006-10-06 08:11:07.855316674 +0200
@@ -129,7 +129,9 @@
}
extern int errno;
+#if !defined(__FreeBSD__)
extern int sys_nerr;
+#endif
/*
* p_error prints the system error message on the standard location

30
inetutils/inetutils.spec

@ -22,8 +22,6 @@
## SUCH DAMAGE.
##
# FIXME: rse: uses OSSP fsl but provides no fsl.inetutils
# package information
Name: inetutils
Summary: GNU Internet Utilities
@ -35,18 +33,13 @@ Class: EVAL
Group: Network
License: GPL
Version: 1.4.2
Release: 20060331
Release: 20061006
# package options
%option with_fsl yes
%option with_legacy no
# list of sources
Source0: ftp://ftp.gnu.org/gnu/inetutils/inetutils-%{version}.tar.gz
Source1: setenv.h
Source2: setenv.c
Source3: unsetenv.h
Source4: unsetenv.c
Patch0: inetutils.patch
# build information
@ -54,19 +47,14 @@ Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, make
PreReq: OpenPKG, openpkg >= 20040130
%if "%{with_fsl}" == "yes"
BuildPreReq: fsl >= 1.2.0
PreReq: fsl >= 1.2.0
%endif
AutoReq: no
AutoReqProv: no
%description
The GNU Internet Utilities are a collection of common network
programs.
Please note that specific to this OpenPKG version only a subset of
the original GNU Internet Utilities is provided.
programs. Please note that specific to this OpenPKG version only a
subset of the original GNU Internet Utilities is provided. Mainly we
provide networking clients only.
%track
prog inetutils = {
@ -78,17 +66,12 @@ AutoReqProv: no
%prep
%setup -q
%patch -p0
cp -f %{SOURCE setenv.c} libinetutils/
cp -f %{SOURCE setenv.h} libinetutils/
cp -f %{SOURCE unsetenv.c} libinetutils/
cp -f %{SOURCE unsetenv.h} libinetutils/
%build
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
LIBS="%{l_fsl_libs}" \
LDFLAGS="%{l_ldflags}" \
./configure \
--prefix=%{l_prefix} \
--program-prefix=g \
@ -123,7 +106,8 @@ AutoReqProv: no
done
done
%endif
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%attr(4711,%{l_susr},%{l_sgrp}) %{l_prefix}/bin/gping' \
'%attr(4711,%{l_susr},%{l_sgrp}) %{l_prefix}/bin/grcp' \
'%attr(4711,%{l_susr},%{l_sgrp}) %{l_prefix}/bin/grlogin' \

62
inetutils/setenv.c

@ -1,62 +0,0 @@
/*
** setenv.c: ISO C implementation
** Copyright (c) 2003 Michael Schloh von Bennewitz <michael@schloh.com>
** Copyright (c) 2003 Cable & Wireless <http://www.cw.com/de/>
**
** Permission to use, copy, modify, and distribute this software for
** any purpose with or without fee is hereby granted, provided that
** the above copyright notice and this permission notice appear in all
** copies.
**
** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
**
*/
#ifdef HAVE_CONFIG_H
#include <sys/types.h>
#include "config.h"
#endif
#ifndef HAVE_SETENV
#include <stdlib.h> /* For putenv(3) and malloc(3) */
#include <string.h> /* For strcpy(3) and strcat(3) */
/*
** Implements setenv(3) C library function for platforms not including it
*/
int setenv(const char *kszName, const char *kszValue, int nOverwrite)
{
char *szPair = NULL; /* String we will pass to putenv(3) */
/* Short circuite if overwrite is not enabled on an existing variable */
if (nOverwrite == 0 && getenv(kszName) != 0)
return 0;
/* Allocate space for name, value, equals, and string terminator */
szPair = malloc(strlen(kszName) + strlen(kszValue) + strlen("=") + 1);
if (szPair == NULL) /* Memory error */
return 1; /* Unsuccessful */
/* Copy the incoming variables */
strcpy(szPair, kszName);
strcat(szPair, "=");
strcat(szPair, kszValue);
putenv(szPair); /* Handoff */
return 0; /* Success */
}
#endif /* !HAVE_SETENV */

29
inetutils/setenv.h

@ -1,29 +0,0 @@
/*
** setenv.h: ISO C interface
** Copyright (c) 2003 Michael Schloh von Bennewitz <michael@schloh.com>
** Copyright (c) 2003 Cable & Wireless <http://www.cw.com/de/>
**
** Permission to use, copy, modify, and distribute this software for
** any purpose with or without fee is hereby granted, provided that
** the above copyright notice and this permission notice appear in all
** copies.
**
** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
**
*/
#ifndef LOC_SETENV_H
# define LOC_SETENV_H
int setenv(const char *, const char *, int);
#endif /* not LOC_SETENV_H */

65
inetutils/unsetenv.c

@ -1,65 +0,0 @@
/*
** unsetenv.c: ISO C implementation
** Copyright (c) 2003 Michael Schloh von Bennewitz <michael@schloh.com>
** Copyright (c) 2003 Cable & Wireless <http://www.cw.com/de/>
**
** Permission to use, copy, modify, and distribute this software for
** any purpose with or without fee is hereby granted, provided that
** the above copyright notice and this permission notice appear in all
** copies.
**
** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
**
*/
#ifdef HAVE_CONFIG_H
#include <sys/types.h>
#include "config.h"
#endif
#ifndef HAVE_UNSETENV
#include <stdlib.h> /* For putenv(3) and malloc(3) */
#include <string.h> /* For strcpy(3) and strcat(3) */
extern char **environ;
/*
** Implements unsetenv(3) C library function for platforms not including it
*/
void unsetenv(const char *kszName)
{
int nLen;
const char *kszTail;
char **ppEnv;
if (kszName == 0 || environ == 0)
return;
for (kszTail = kszName; *kszTail && *kszTail != '='; kszTail++)
/* noop */;
nLen = kszTail - kszName;
for (ppEnv = environ; *ppEnv != 0; ppEnv++)
if (strncmp(*ppEnv, kszName, nLen) == 0 && (*ppEnv)[nLen] == '=')
break;
while (*ppEnv != 0) {
*ppEnv = *(ppEnv + 1);
ppEnv++;
}
}
#endif /* !HAVE_UNSETENV */

29
inetutils/unsetenv.h

@ -1,29 +0,0 @@
/*
** unsetenv.h: ISO C interface
** Copyright (c) 2003 Michael Schloh von Bennewitz <michael@schloh.com>
** Copyright (c) 2003 Cable & Wireless <http://www.cw.com/de/>
**
** Permission to use, copy, modify, and distribute this software for
** any purpose with or without fee is hereby granted, provided that
** the above copyright notice and this permission notice appear in all
** copies.
**
** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
**
*/
#ifndef LOC_UNSETENV_H
# define LOC_UNSETENV_H
void unsetenv(const char *);
#endif /* not LOC_UNSETENV_H */
Loading…
Cancel
Save