rpms/libsx/EL-5 libsx-examples.diff, NONE, 1.1 libsx-link_mkdir.diff, NONE, 1.1 libsx-rgb.diff, NONE, 1.1 libsx-simple_freq.c, NONE, 1.1 libsx-strdup.diff, NONE, 1.1 libsx.spec, 1.7, 1.8 libsx-freq_simple.diff, 1.1, NONE libsx-mkdir_p.diff, 1.1, NONE libsx-protect_strdup.diff, 1.1, NONE libsx-shared.diff, 1.2, NONE

Patrice Dumas (pertusus) fedora-extras-commits at redhat.com
Thu Dec 27 09:21:38 UTC 2007


Author: pertusus

Update of /cvs/extras/rpms/libsx/EL-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5938

Modified Files:
	libsx.spec 
Added Files:
	libsx-examples.diff libsx-link_mkdir.diff libsx-rgb.diff 
	libsx-simple_freq.c libsx-strdup.diff 
Removed Files:
	libsx-freq_simple.diff libsx-mkdir_p.diff 
	libsx-protect_strdup.diff libsx-shared.diff 
Log Message:
sync with devel

libsx-examples.diff:

--- NEW FILE libsx-examples.diff ---
--- libsx-2.05/demo0/makefile.examples	1999-06-22 14:41:40.000000000 +0200
+++ libsx-2.05/demo0/makefile	2007-02-15 13:46:00.000000000 +0100
@@ -21,9 +21,9 @@
 
 
 # main.o depends on main.c (of course) and main.h and callbacks.h
-main.o : main.c main.h callbacks.h libsx.h
+main.o : main.c main.h callbacks.h
 
-callbacks.o : libsx.h callbacks.c main.h
+callbacks.o : callbacks.c main.h
 
 
 #
--- libsx-2.05/pcurve/makefile.examples	1994-11-06 00:21:09.000000000 +0100
+++ libsx-2.05/pcurve/makefile	2007-02-15 13:46:00.000000000 +0100
@@ -1,20 +1,23 @@
-#!smake
+include ../libsx_defs
 
 CFLAGS	= -g -I../controlbox
 
-CLIBS	= ../src/libsxGL.a -lGLU -lGL -lXaw -lXt -lXmu -lX11 -lm
-LDFLAGS = $(LIBPATH) $(LIBS)
+CLIBS	= -lGLU -lGL -lXaw -lXt -lXmu -lX11 -lm
+LDFLAGS = $(LIBPATH) $(LIBS) $(CLIBS)
 
 OBJS = fogl.o cfogl.o
-OTHEROBJS = ../controlbox/controlbox.o
+OTHEROBJS = controlbox.o
 
-default:	pcurve
+default: $(OTHEROBJS) pcurve
+
+controlbox.o: ../controlbox/controlbox.c
+	cc -c $(CFLAGS) ../controlbox/controlbox.c -o controlbox.o
 
 clean:
 	rm -f $(OBJS) cool
 
-pcurve:	pcurve.c
-	cc $(CFLAGS) pcurve.c -o pcurve $(OTHEROBJS) $(LIBPATH) $(CLIBS)
+pcurve:	pcurve.c $(OTHEROBJS)
+	cc $(CFLAGS) pcurve.c -o pcurve $(OTHEROBJS) $(LDFLAGS)
 
-cool2:	cool2.c
-	cc $(CFLAGS) cool2.c $(OTHEROBJS) -o cool2 $(LIBPATH) $(CLIBS)
+cool2:	cool2.c $(OTHEROBJS)
+	cc $(CFLAGS) cool2.c $(OTHEROBJS) -o cool2 $(LDFLAGS)
--- libsx-2.05/demo3/makefile.examples	2007-02-15 13:48:46.000000000 +0100
+++ libsx-2.05/demo3/makefile	2007-02-15 15:47:47.000000000 +0100
@@ -10,9 +10,9 @@
 
 
 # main.o depends on main.c (of course) and main.h and callbacks.h
-main.o : main.c main.h callbacks.h libsx.h
+main.o : main.c main.h callbacks.h
 
-callbacks.o : libsx.h callbacks.c main.h
+callbacks.o : callbacks.c main.h
 
 
 clean :
--- libsx-2.05/controlbox/makefile.examples	2000-07-23 20:57:49.000000000 +0200
+++ libsx-2.05/controlbox/makefile	2007-02-15 13:46:00.000000000 +0100
@@ -10,9 +10,9 @@
 
 
 # main.o depends on main.c (of course) and main.h and callbacks.h
-main.o : main.c main.h callbacks.h libsx.h controlbox.h
+main.o : main.c main.h callbacks.h controlbox.h
 
-callbacks.o : libsx.h callbacks.c
+callbacks.o : callbacks.c
 
 controlbox.o : controlbox.c controlbox.c
 
--- libsx-2.05/freq/makefile.examples	1994-02-02 17:54:22.000000000 +0100
+++ libsx-2.05/freq/makefile	2007-02-15 13:46:00.000000000 +0100
@@ -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
+main.o : main.c 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
--- libsx-2.05/multireq/makefile.examples	2007-02-15 13:47:36.000000000 +0100
+++ libsx-2.05/multireq/makefile	2007-02-15 13:47:45.000000000 +0100
@@ -9,7 +9,7 @@
 multireq : $(OBJS)
 	$(CC) -g -o $@ $(OBJS) $(LIBS)
 
-main.o : main.c libsx.h multireq.h
+main.o : main.c multireq.h
 
 multireq.o : multireq.c multireq.h
 
--- libsx-2.05/skel/makefile.examples	1994-01-19 21:10:46.000000000 +0100
+++ libsx-2.05/skel/makefile	2007-02-15 13:46:00.000000000 +0100
@@ -10,9 +10,9 @@
 
 
 # main.o depends on main.c (of course) and main.h and callbacks.h
-main.o : main.c main.h callbacks.h libsx.h
+main.o : main.c main.h callbacks.h
 
-callbacks.o : libsx.h callbacks.c
+callbacks.o : callbacks.c
 
 clean :
 	rm -f *.o *~ core skel
--- libsx-2.05/demo2/makefile.examples	1994-01-19 21:12:08.000000000 +0100
+++ libsx-2.05/demo2/makefile	2007-02-15 13:46:00.000000000 +0100
@@ -10,9 +10,9 @@
 
 
 # main.o depends on main.c (of course) and main.h and callbacks.h
-main.o : main.c main.h callbacks.h libsx.h
+main.o : main.c main.h callbacks.h
 
-callbacks.o : libsx.h callbacks.c main.h
+callbacks.o : callbacks.c main.h
 
 
 clean :
--- libsx-2.05/demo1/makefile.examples	1994-01-19 21:12:13.000000000 +0100
+++ libsx-2.05/demo1/makefile	2007-02-15 13:46:00.000000000 +0100
@@ -10,9 +10,9 @@
 
 
 # main.o depends on main.c (of course) and main.h and callbacks.h
-main.o : main.c main.h callbacks.h libsx.h
+main.o : main.c main.h callbacks.h
 
-callbacks.o : libsx.h callbacks.c main.h
+callbacks.o : callbacks.c main.h
 
 
 #
--- libsx-2.05/xrootbg/makefile.examples	1999-12-14 21:02:00.000000000 +0100
+++ libsx-2.05/xrootbg/makefile	2007-02-15 13:46:00.000000000 +0100
@@ -1,7 +1,7 @@
 #
 #
-XAWLIB=Xaw95
-# XAWLIB=Xaw
+#XAWLIB=Xaw95
+XAWLIB=Xaw
 include ../libsx_defs
 CFLAGS = -Wall -O2 -D_POSIX_SOURCE -D$(XAWLIB)
 
--- libsx-2.05/creq/makefile.examples	1994-01-19 21:21:40.000000000 +0100
+++ libsx-2.05/creq/makefile	2007-02-15 13:46:00.000000000 +0100
@@ -10,7 +10,7 @@
 creq : $(OBJS) 
 	$(CC) -o $@ $(OBJS) $(LIBS)
 
-main.o : main.c libsx.h creq.h
+main.o : main.c creq.h
 
 creq.o : creq.c
 

libsx-link_mkdir.diff:

--- NEW FILE libsx-link_mkdir.diff ---
diff -up libsx-2.05/src/Makefile.link_mkdir libsx-2.05/src/Makefile
--- libsx-2.05/src/Makefile.link_mkdir	2003-08-09 13:17:23.000000000 +0200
+++ libsx-2.05/src/Makefile	2007-12-27 09:39:41.000000000 +0100
@@ -13,6 +13,11 @@ LIBDIR=/usr/X11R6/lib
 INCLUDEDIR=/usr/X11R6/include/X11/SX
 SHAREDIR=/usr/share/libsx
 
+mkinstalldirs = mkdir -p
+#mkinstalldirs = mkdirhier
+
+copyfile = cp -f
+
 CC=gcc
 
 #
@@ -38,10 +43,10 @@ libsx.a : $(LIBSXOBJS)
 
 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
+	grabpix.o colorsel.o version.o -o libsx.so $(XLIBS)
 
 draw.o : draw.c libsx.h libsx_private.h
 
@@ -89,12 +94,12 @@ main.o : main.c main.h libsx.h callbacks
 callbacks.o : libsx.h callbacks.c
 
 install:
-	mkdirhier $(LIBDIR)
-	cp -f libsx.a libsx.so $(LIBDIR)
-	mkdirhier $(INCLUDEDIR)
-	cp -f libsx.h $(INCLUDEDIR)
-	mkdirhier $(SHAREDIR)
-	cp -f dialogs/dialogs* $(SHAREDIR)
+	$(mkinstalldirs) $(LIBDIR)
+	$(copyfile) libsx.a libsx.so $(LIBDIR)
+	$(mkinstalldirs) $(INCLUDEDIR)
+	$(copyfile) -f libsx.h $(INCLUDEDIR)
+	$(mkinstalldirs) $(SHAREDIR)
+	$(copyfile) dialogs/dialogs* $(SHAREDIR)
 
 clean:
 	rm -f *.o *~ dialogs/*~ core libsx.a libsx.so
diff -up libsx-2.05/libsx_defs.link_mkdir libsx-2.05/libsx_defs
--- libsx-2.05/libsx_defs.link_mkdir	1999-12-14 13:59:35.000000000 +0100
+++ libsx-2.05/libsx_defs	2007-12-27 09:31:42.000000000 +0100
@@ -44,7 +44,7 @@ CC     = gcc
 #  CFLAGS = -O3 -D_POSIX_SOURCE
 #
 # On Linux, use CC=cc, RANLIB=ranlib, and:
-CFLAGS = -Wall -O2 -D_POSIX_SOURCE
+CFLAGS = -Wall -g -O2 -D_POSIX_SOURCE
 #  
 # On a Motorola Delta/88K box, you can use (with gcc):
 #  CFLAGS = -O2 -DSYSV -DUSG -DMOTOROLA -DMOTOR32V2
@@ -98,9 +98,11 @@ endif
 #
 
 #LIBSX  = ../src/libsx.a
-LIBSX = -lsx -L/usr/X11R6/lib
+LIBSX = -L../src -lsx
+
+XLIBS = -lXpm -l$(XAWLIB) -lXmu -lXt -lX11
 
 XPM_SUPPORT = yes
 
-LIBS   =  $(LIBSX) -lXpm -l$(XAWLIB) -lXmu -lXt -lX11 -L/usr/X11R6/lib
+LIBS   =  $(LIBSX) $(XLIBS)
 

libsx-rgb.diff:

--- NEW FILE libsx-rgb.diff ---
--- libsx-2.05/src/colorsel.c.rgb	2000-07-29 11:10:32.000000000 +0200
+++ libsx-2.05/src/colorsel.c	2007-02-15 15:49:55.000000000 +0100
@@ -12,7 +12,9 @@
 char *SX_ColorSelector_Label[] = {
 };
 
+#ifndef RGBTXT
 #define RGBTXT     "/usr/lib/X11/rgb.txt"
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>


--- NEW FILE libsx-simple_freq.c ---
#include "libsx.h"
#include "freq.h"

char *SimpleGetFile(char *path)
{
   return GetFile("Simple file requestor", path, NULL, NULL);
}

libsx-strdup.diff:

--- NEW FILE libsx-strdup.diff ---
--- libsx-2.05/src/dirlist.c.strdup	1999-12-30 08:22:14.000000000 +0100
+++ libsx-2.05/src/dirlist.c	2007-02-15 16:15:22.000000000 +0100
@@ -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;
 
--- libsx-2.05/src/freq.c.strdup	2007-02-15 16:16:18.000000000 +0100
+++ libsx-2.05/src/freq.c	2007-02-15 16:16:48.000000000 +0100
@@ -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-2.05/src/dialog.c.strdup	2000-07-23 18:02:11.000000000 +0200
+++ libsx-2.05/src/dialog.c	2007-02-15 16:15:22.000000000 +0100
@@ -247,8 +247,10 @@
 
 void PopdownDialog(Dialog popup, char **answer)
 {
-  char *tmp;
+#ifndef strdup
   extern char *strdup(char *str);
+#endif
+  char *tmp;
   
     if (answer)
      {
--- libsx-2.05/freq/freq.c.strdup	1999-07-04 06:07:13.000000000 +0200
+++ libsx-2.05/freq/freq.c	2007-02-15 16:15:22.000000000 +0100
@@ -56,8 +56,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.


Index: libsx.spec
===================================================================
RCS file: /cvs/extras/rpms/libsx/EL-5/libsx.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- libsx.spec	10 Sep 2006 21:59:15 -0000	1.7
+++ libsx.spec	27 Dec 2007 09:20:54 -0000	1.8
@@ -1,17 +1,19 @@
 Name:           libsx
 Summary:        Simple X library
 Version:        2.05
-Release:        10%{?dist}
+Release:        13%{?dist}
 Group:          System Environment/Libraries
-License:        LGPL
+License:        LGPLv2+
 Url:            ftp://ftp.ac-grenoble.fr/ge/Xlibraries/
 Source:         ftp://ftp.ac-grenoble.fr/ge/Xlibraries/%{name}-%{version}.tar.bz2
-Patch:          libsx-no_nested_prototypes.diff
+# simpler example for freq
+Source1:        libsx-simple_freq.c
+Patch0:         libsx-no_nested_prototypes.diff
 Patch1:         libsx-comment_caddr_t.diff
-Patch2:         libsx-protect_strdup.diff
-Patch3:         libsx-freq_simple.diff
-Patch4:         libsx-mkdir_p.diff
-Patch5:         libsx-shared.diff
+Patch2:         libsx-strdup.diff
+Patch3:         libsx-examples.diff
+Patch4:         libsx-link_mkdir.diff
+Patch6:         libsx-rgb.diff
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 # libXt-devel requires libX11-devel and libXaw-devel requires libXmu-devel
 BuildRequires:  libXaw-devel libXpm-devel libXt-devel 
@@ -38,39 +40,62 @@
 
 %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
+# static function cannot be within other function
+%patch0 -p1
+# don't redefine caddr_t
+%patch1
+# set strdup prototypes only if strdup isn't a macro
+%patch2 -p1 -b .strdup
+# use the new GetFile in freq, remove libsx.h from prerequisite and other
+# fixes allowing examples to compile
+%patch3 -p1 -b .examples
 # use mkdir -p to create directories
-%patch -p1 -P 4
 # shared library with fine soname
-%patch -p1 -P 5
+# fix compile flags
+%patch4 -p1 -b .link_mkdir
+# allow the rgb file location to be redefined
+%patch6 -p1 -b .rgb
+
+# example of a simple use of the new GetFile
+cp -p %{SOURCE1} freq/simple_freq.c
 
 %build
-make CFLAGS="%{optflags} -fPIC" src
+make CFLAGS="%{optflags} -fPIC -DRGBTXT=\"\\\"%{_datadir}/X11/rgb.txt\\\"\""
 
 %install
 rm -rf %{buildroot}
 
+pushd src
+make install LIBDIR=%{buildroot}%{_libdir} \
+      INCLUDEDIR=%{buildroot}%{_includedir} \
+      SHAREDIR=%{buildroot}%{_datadir}/libsx \
+      copyfile='cp -p'
+popd
+
+# prepare examples directory
+rm -rf __dist_examples
+mkdir -p __dist_examples/examples
+# pcurve doesn't build since it requires OPENGL_SUPPORT to be used, 
+# and we don't use it, since it is maked as experimental.
+example_dirs="bezier controlbox creq demo* draw_demo frac freq multireq skel xmore xrootbg" 
+cp -a $example_dirs libsx_defs pcurve __dist_examples/examples/
 # remove symlinks pointing to libsx.h in example directories
-find . -name libsx.h -a -type l -exec rm \{\} \;
+find __dist_examples/examples/ -name libsx.h -a -type l -exec rm \{\} \;
+find __dist_examples/examples/ -name makefile.examples -exec rm \{\} \;
+rm __dist_examples/examples/freq/freq.c.strdup
+for dir in $example_dirs; do
+  make -C __dist_examples/examples/$dir clean
+done
 
-cd src
-%makeinstall LIBDIR=%{buildroot}%{_libdir} \
-      INCLUDEDIR=%{buildroot}%{_includedir} \
-      SHAREDIR=%{buildroot}%{_datadir}/libsx
 
-# fix symbolic links for shared library
-cd $RPM_BUILD_ROOT/%{_libdir}
+# fix symbolic links for shared library. It is not completly obvious
+# that using 0.0.0 like in libtool makes sense, do it anyway.
+pushd %{buildroot}/%{_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 libsx.so
+popd
 
 %post -p /sbin/ldconfig
 
@@ -87,13 +112,27 @@
 
 %files devel
 %defattr(-,root,root,-)
-%doc bezier controlbox creq demo* docs draw_demo frac freq multireq
-%doc pcurve skel xmore xrootbg libsx_defs
+%doc docs/ __dist_examples/examples/
 %{_libdir}/libsx.a
 %{_libdir}/libsx.so
 %{_includedir}/libsx.h
 
 %changelog
+* Thu Dec 27 2007 Patrice Dumas <pertusus at free.fr> 2.05-13
+- keep timestamps
+
+* Thu Feb 15 2007 Patrice Dumas <pertusus at free.fr> 2.05-12
+- build examples as part of building the library
+- replace libsx-protect_strdup.diff with libsx-strdup.diff, which has the fix
+  for freq/freq.c, not only for file in src/
+- merge libsx-shared.diff and libsx-mkdir_p.diff in libsx-link_mkdir.diff
+
+* Thu Feb 15 2007 Patrice Dumas <pertusus at free.fr> 2.05-11
+- use only %%{buildroot}
+- put examples in a directory and fix them
+- set the rgb database location to a correct value
+- replace libsx-freq_simple.diff by libsx-examples.diff + libsx-simple_freq.c
+
 * Sun Sep 10 2006 Patrice Dumas <pertusus at free.fr> 2.05-10
 - add defattr to devel
 


--- libsx-freq_simple.diff DELETED ---


--- libsx-mkdir_p.diff DELETED ---


--- libsx-protect_strdup.diff DELETED ---


--- libsx-shared.diff DELETED ---




More information about the fedora-extras-commits mailing list