rpms/libsx/devel libsx-comment_caddr_t.diff, NONE, 1.1 libsx-freq_simple.diff, NONE, 1.1 libsx-mkinstalldirs.diff, NONE, 1.1 libsx-no_nested_prototypes.diff, NONE, 1.1 libsx-protect_strdup.diff, NONE, 1.1 libsx-shared.diff, NONE, 1.1 libsx.spec, NONE, 1.1 mkinstalldirs, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Patrice Dumas (pertusus) fedora-extras-commits at redhat.com
Fri Aug 26 20:16:27 UTC 2005


Author: pertusus

Update of /cvs/extras/rpms/libsx/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23943/devel

Modified Files:
	.cvsignore sources 
Added Files:
	libsx-comment_caddr_t.diff libsx-freq_simple.diff 
	libsx-mkinstalldirs.diff libsx-no_nested_prototypes.diff 
	libsx-protect_strdup.diff libsx-shared.diff libsx.spec 
	mkinstalldirs 
Log Message:
auto-import libsx-2.05-4 on branch devel from libsx-2.05-4.src.rpm

libsx-comment_caddr_t.diff:

--- NEW FILE libsx-comment_caddr_t.diff ---
--- src/drawing.c.old	2005-08-11 21:57:10.000000000 +0200
+++ src/drawing.c	2005-08-11 21:57:30.000000000 +0200
@@ -14,11 +14,11 @@
 #include <X11/Xaw/SimpleP.h>
 #include <X11/Xmu/Xmu.h>
 #include "drawingP.h"
-
+/*
 #ifndef caddr_t
 extern char *caddr_t;
 #endif
-
+*/
 static void	Initialize();
 static void     MyRealize();  /* So we can do our own visual */
 static void	Destroy();

libsx-freq_simple.diff:

--- NEW FILE libsx-freq_simple.diff ---
diff -u --new-file ../libsx-2.05/freq/freq.c ./freq/freq.c
--- ../libsx-2.05/freq/freq.c	1999-07-04 06:07:13.000000000 +0200
+++ ./freq/freq.c	2005-08-15 00:51:14.000000000 +0200
@@ -56,8 +56,10 @@
  * in the butt.  Why on earth isn't strdup() in the POSIX standard
  * but something completely useless like mbstowcs() is?
  */
-char *strdup(const char *str);
 
+#ifndef strdup
+char *strdup(const char *str);
+#endif
 
 /*
  * Here's where the real code begins.
diff -u --new-file ../libsx-2.05/freq/makefile ./freq/makefile
--- ../libsx-2.05/freq/makefile	1994-02-02 17:54:22.000000000 +0100
+++ ./freq/makefile	2005-08-16 11:03:51.000000000 +0200
@@ -3,9 +3,11 @@
 include ../libsx_defs
 
 FREQ_OBJS  = freq.o dirlist.o
+SIMPLE_FREQ_OBJS = simple_freq.o
 OBJS       = main.o libfreq.a
+SIMPLE_OBJS = main.o libsimplefreq.a
 
-all : libfreq.a freq
+all : libfreq.a freq libsimplefreq.a simple_freq
 
 
 libfreq.a : $(FREQ_OBJS)
@@ -13,16 +15,24 @@
 	ar rc libfreq.a $(FREQ_OBJS)
 	$(RANLIB) libfreq.a
 
+libsimplefreq.a : $(SIMPLE_FREQ_OBJS)
+	rm -f libsimplefreq.a
+	ar rc libsimplefreq.a $(SIMPLE_FREQ_OBJS)
+	$(RANLIB) libsimplefreq.a
 
 freq : $(OBJS) 
 	$(CC) -o $@ $(OBJS) $(LIBS)
 
+simple_freq : $(SIMPLE_OBJS)
+	$(CC) -o $@ $(SIMPLE_OBJS) $(LIBS)
 
 main.o : main.c libsx.h freq.h
 
 freq.o : freq.c
 
+simple_freq.o : simple_freq.c
+
 dirlist.o : dirlist.c
 
 clean:
-	rm -f *.o *~ core freq libfreq.a
+	rm -f *.o *~ core freq libfreq.a simple_freq libsimplefreq.a
diff -u --new-file ../libsx-2.05/freq/simple_freq.c ./freq/simple_freq.c
--- ../libsx-2.05/freq/simple_freq.c	1970-01-01 01:00:00.000000000 +0100
+++ ./freq/simple_freq.c	2005-08-16 10:49:51.000000000 +0200
@@ -0,0 +1,7 @@
+#include "libsx.h"
+#include "freq.h"
+
+char *SimpleGetFile(char *path)
+{
+   return GetFile("Simple file requestor", path, NULL, NULL);
+}

libsx-mkinstalldirs.diff:

--- NEW FILE libsx-mkinstalldirs.diff ---
--- libsx-2.05.save/src/Makefile	2003-08-09 13:17:23.000000000 +0200
+++ libsx-2.05/src/Makefile	2005-08-16 13:02:02.000000000 +0200
@@ -13,6 +13,9 @@
 INCLUDEDIR=/usr/X11R6/include/X11/SX
 SHAREDIR=/usr/share/libsx
 
+mkinstalldirs = ../mkinstalldirs
+#mkinstalldirs = mkdirhier
+
 CC=gcc
 
 #
@@ -89,11 +92,11 @@
 callbacks.o : libsx.h callbacks.c
 
 install:
-	mkdirhier $(LIBDIR)
+	$(mkinstalldirs) $(LIBDIR)
 	cp -f libsx.a libsx.so $(LIBDIR)
-	mkdirhier $(INCLUDEDIR)
+	$(mkinstalldirs) $(INCLUDEDIR)
 	cp -f libsx.h $(INCLUDEDIR)
-	mkdirhier $(SHAREDIR)
+	$(mkinstalldirs) $(SHAREDIR)
 	cp -f dialogs/dialogs* $(SHAREDIR)
 
 clean:

libsx-no_nested_prototypes.diff:

--- NEW FILE libsx-no_nested_prototypes.diff ---
Seulement dans libsx-2.05_orig/src: button.o
Seulement dans libsx-2.05_orig/src: colormap.o
Seulement dans libsx-2.05_orig/src: dialog.o
Seulement dans libsx-2.05_orig/src: dirlist.o
Seulement dans libsx-2.05_orig/src: drawing.o
Seulement dans libsx-2.05_orig/src: draw.o
Seulement dans libsx-2.05_orig/src: font.o
Seulement dans libsx-2.05_orig/src: freq.o
diff -u --recursive libsx-2.05_orig/src/grabpix.c libsx-2.05/src/grabpix.c
--- libsx-2.05_orig/src/grabpix.c	1999-06-22 21:28:38.000000000 +0200
+++ libsx-2.05/src/grabpix.c	2005-08-11 14:44:41.000000000 +0200
@@ -43,6 +43,13 @@
 } RootWindowRec;
 
 static void Realize();
+/*
+static void InitCursors();
+static void SetupGC();
+static Window FindWindow(int x, int y);
+static void CreateRoot();
+static void StartRootPtrGrab();
+*/
 
 RootWindowClassRec rootWindowClassRec = {
   { /* core fields */
@@ -138,7 +145,7 @@
    0x8f, 0x07, 0x77, 0x07, 0xfe, 0x0f, 0xfc, 0x1f, 0xf8, 0x3f, 0x00, 0x7f,
    0x00, 0xfe, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x10};
 
-static void
+void
 InitCursors()
 {
 Pixmap cursor,mask;
@@ -155,7 +162,7 @@
                    lens_x_hot,lens_y_hot);
 }
 
-static void 
+void 
 SetupGC()
 {
     selectGCV.function = GXxor;
@@ -165,7 +172,7 @@
 		       &selectGCV);
 }  
 
-static Window 
+Window 
 FindWindow(x, y)
      int x, y;	  
 {
@@ -187,14 +194,14 @@
   return findW;
 }
 
-static void
+void
 CreateRoot()
 {
   root = XtCreateWidget("root", rootWindowWidgetClass, toplevel, NULL, 0);
   XtRealizeWidget(root);
 }
 
-static void
+void
 StartRootPtrGrab()   
 {
   Window    rootR, childR, window;
Seulement dans libsx-2.05_orig/src: libsx.o
Seulement dans libsx-2.05_orig/src: list.o
Seulement dans libsx-2.05_orig/src: menu.o
Seulement dans libsx-2.05_orig/src: misc.o
Seulement dans libsx-2.05_orig/src: popups.o
Seulement dans libsx-2.05_orig/src: scrollbar.o
Seulement dans libsx-2.05_orig/src: string_entry.o
Seulement dans libsx-2.05_orig/src: toggle.o

libsx-protect_strdup.diff:

--- NEW FILE libsx-protect_strdup.diff ---
diff -u --recursive libsx-2.05/src/dialog.c libsx-2.05-new/src/dialog.c
--- libsx-2.05/src/dialog.c	2000-07-23 18:02:11.000000000 +0200
+++ libsx-2.05-new/src/dialog.c	2005-08-11 22:16:47.000000000 +0200
@@ -247,8 +247,10 @@
 
 void PopdownDialog(Dialog popup, char **answer)
 {
-  char *tmp;
+#ifndef strdup
   extern char *strdup(char *str);
+#endif
+  char *tmp;
   
     if (answer)
      {
Seulement dans libsx-2.05-new/src: dialog.c.old
Seulement dans libsx-2.05-new/src: dialog.o
diff -u --recursive libsx-2.05/src/dirlist.c libsx-2.05-new/src/dirlist.c
--- libsx-2.05/src/dirlist.c	1999-12-30 08:22:14.000000000 +0100
+++ libsx-2.05-new/src/dirlist.c	2005-08-11 22:16:07.000000000 +0200
@@ -32,7 +32,9 @@
 #include <sys/param.h>
 #include <sys/stat.h>
 
+#ifndef strdup
 extern char *strdup(char *str);
+#endif
 extern char _FreqFilter[84];
 extern int view_dir, view_pt;
 
Seulement dans libsx-2.05-new/src: dirlist.o
diff -u --recursive libsx-2.05/src/freq.c libsx-2.05-new/src/freq.c
--- libsx-2.05/src/freq.c	2000-07-29 11:19:31.000000000 +0200
+++ libsx-2.05-new/src/freq.c	2005-08-11 22:34:16.000000000 +0200
@@ -60,8 +60,9 @@
  * in the butt.  Why on earth isn't strdup() in the POSIX standard
  * but something completely useless like mbstowcs() is?
  */
+#ifndef strdup
 char *strdup(const char *str);
-
+#endif
 
 /*
  * Here's where the real code begins.

libsx-shared.diff:

--- NEW FILE libsx-shared.diff ---
--- src/Makefile.old	2005-08-16 13:31:25.000000000 +0200
+++ src/Makefile	2005-08-16 13:51:25.000000000 +0200
@@ -41,7 +41,7 @@
 
 libsx.so : $(LIBSXOBJS)
 	rm -f libsx.so
-	$(CC) -shared -Wl,-soname,libsx.so draw.o toggle.o \
+	$(CC) -shared -Wl,-soname,libsx.so.0 draw.o toggle.o \
 	button.o string_entry.o libsx.o misc.o list.o font.o scrollbar.o \
 	menu.o popups.o colormap.o drawing.o dialog.o dirlist.o freq.o \
 	grabpix.o colorsel.o version.o -o libsx.so


--- NEW FILE libsx.spec ---
Name:           libsx
Summary:        Simple X library
Version:        2.05
Release:        4
Group:          System Environment/Libraries
License:        LGPL
Url:            ftp://ftp.ac-grenoble.fr/ge/Xlibraries/
Source:	        ftp://ftp.ac-grenoble.fr/ge/Xlibraries/%{name}-%{version}.tar.bz2
Source1:        mkinstalldirs
Patch:          libsx-no_nested_prototypes.diff
Patch1:         libsx-comment_caddr_t.diff
Patch2:         libsx-protect_strdup.diff
Patch3:         libsx-freq_simple.diff
Patch4:         libsx-mkinstalldirs.diff
Patch5:         libsx-shared.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  xorg-x11-devel

%description
Libsx (the Simple X library) is a library of code that sits on top of and 
to the side of the Athena widget set.  Its purpose is to make writing X 
applications *much* easier.  

%package devel
Summary:       Headers and development libraries for libsx
Group:         Development/Libraries
Requires:      %{name} = %{version}-%{release}
Requires:      xorg-x11-devel

%description devel
Libsx (the Simple X library) is a library of code that sits on top of and
to the side of the Athena widget set.

The libsx-devel package contains headers and development libraries
necessary for building programs against libsx.


%prep
%setup -q
%patch -p1
# caddr_t redefined?
%patch -P 1
# with RPM_OPT_FLAGS (maybe FORTIFY_SOURCE) all the strdup prototypes
# have to be commented.
%patch -p1 -P 2
# use the new GetFile in freq
%patch -p1 -P 3
# use mkinstalldirs (from automake 1.9) to create directories
%patch -p1 -P 4
cp %{SOURCE1} .
# shared library with fine soname
%patch -p0 -P 5

%build
%ifarch x86_64
	mv libsx_defs libsx_defs-old
#	sed -e s/'CFLAGS = -Wall -O2 -D_POSIX_SOURCE'/'CFLAGS = -Wall -O2 -D_POSIX_SOURCE -fPIC'/g \
	sed -e s/'\/usr\/X11R6\/lib'/'\/usr\/X11R6\/lib64'/g \
	libsx_defs-old >libsx_defs
%endif
mv libsx_defs libsx_defs-old
sed -e s/'CFLAGS = -Wall -O2 -D_POSIX_SOURCE'/"CFLAGS = %{optflags} -fPIC"/g \
	libsx_defs-old >libsx_defs
make src

%install
rm -rf %{buildroot}

# remove symlinks pointing to libsx.h in example directories
find . -name libsx.h -a -type l -exec rm \{\} \;

cd src
%makeinstall LIBDIR=%{buildroot}%{_libdir} \
		INCLUDEDIR=%{buildroot}%{_includedir} \
		SHAREDIR=%{buildroot}%{_datadir}/libsx

# fix symbolic links for shared library
cd $RPM_BUILD_ROOT/%{_libdir}
mv libsx.so libsx.so.0.0.0
chmod +x libsx.so.0.0.0
ln -s libsx.so.0.0.0 libsx.so.0
ln -s libsx.so.0.0 libsx.so

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc CHANGES HELP HINTS LICENSE README 
%{_libdir}/libsx.so.*
%{_datadir}/libsx

%files devel
%doc bezier controlbox creq demo* docs draw_demo frac freq multireq
%doc pcurve skel xmore xrootbg libsx_defs
%{_libdir}/libsx.a
%{_libdir}/libsx.so
%{_includedir}/libsx.h

%changelog
* Fri Aug 26 2005 Patrice Dumas <dumas at centre-cired.fr> 2.05-4
- correct Requires
- remove links to the libsx.h header files in the example directories

* Tue Aug 16 2005 Patrice Dumas <dumas at centre-cired.fr> 2.05-3
- don't ship freq.h or libfreq.a, it is an example
- add a simpler definition of SimpleGetFile in freq
- ship the example dirs and the doc
- use and ship mkinstalldirs to create the dirs instead of mkdirhier
- handle correctly shared libraries

* Fri Aug 12 2005 Patrice Dumas <dumas at centre-cired.fr> 2.05-2
- use %{optflags} and build on fedora with gcc4
- reused spec from http://monkeyrpms.net/fc2-i386/html/libsx.html


--- NEW FILE mkinstalldirs ---
#! /bin/sh
# mkinstalldirs --- make directory hierarchy

scriptversion=2005-02-02.21

# Original author: Noah Friedman <friedman at prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to <bug-automake at gnu.org> or send patches to
# <automake-patches at gnu.org>.

errstatus=0
dirmode=""

usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...

Create each directory DIR (with mode MODE, if specified), including all
leading file name components.

Report bugs to <bug-automake at gnu.org>."

# process command line arguments
while test $# -gt 0 ; do
  case $1 in
    -h | --help | --h*)         # -h for help
      echo "$usage"
      exit $?
      ;;
    -m)                         # -m PERM arg
      shift
      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
      dirmode=$1
      shift
      ;;
    --version)
      echo "$0 $scriptversion"
      exit $?
      ;;
    --)                         # stop option processing
      shift
      break
      ;;
    -*)                         # unknown option
      echo "$usage" 1>&2
      exit 1
      ;;
    *)                          # first non-opt arg
      break
      ;;
  esac
done

for file
do
  if test -d "$file"; then
    shift
  else
    break
  fi
done

case $# in
  0) exit 0 ;;
esac

# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error.  This is a problem when calling mkinstalldirs
# from a parallel make.  We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
  '')
    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
      echo "mkdir -p -- $*"
      exec mkdir -p -- "$@"
    else
      # On NextStep and OpenStep, the `mkdir' command does not
      # recognize any option.  It will interpret all options as
      # directories to create, and then abort because `.' already
      # exists.
      test -d ./-p && rmdir ./-p
      test -d ./--version && rmdir ./--version
    fi
    ;;
  *)
    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
       test ! -d ./--version; then
      echo "mkdir -m $dirmode -p -- $*"
      exec mkdir -m "$dirmode" -p -- "$@"
    else
      # Clean up after NextStep and OpenStep mkdir.
      for d in ./-m ./-p ./--version "./$dirmode";
      do
        test -d $d && rmdir $d
      done
    fi
    ;;
esac

for file
do
  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
  shift

  pathcomp=
  for d
  do
    pathcomp="$pathcomp$d"
    case $pathcomp in
      -*) pathcomp=./$pathcomp ;;
    esac

    if test ! -d "$pathcomp"; then
      echo "mkdir $pathcomp"

      mkdir "$pathcomp" || lasterr=$?

      if test ! -d "$pathcomp"; then
	errstatus=$lasterr
      else
	if test ! -z "$dirmode"; then
	  echo "chmod $dirmode $pathcomp"
	  lasterr=""
	  chmod "$dirmode" "$pathcomp" || lasterr=$?

	  if test ! -z "$lasterr"; then
	    errstatus=$lasterr
	  fi
	fi
      fi
    fi

    pathcomp="$pathcomp/"
  done
done

exit $errstatus

# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/libsx/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	26 Aug 2005 20:15:10 -0000	1.1
+++ .cvsignore	26 Aug 2005 20:16:25 -0000	1.2
@@ -0,0 +1 @@
+libsx-2.05.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/libsx/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	26 Aug 2005 20:15:10 -0000	1.1
+++ sources	26 Aug 2005 20:16:25 -0000	1.2
@@ -0,0 +1 @@
+7b143a59e9fc6d78e4cb72418f2e55dc  libsx-2.05.tar.bz2




More information about the fedora-extras-commits mailing list