rpms/libsx/devel libsx-link_mkdir.diff, NONE, 1.1 libsx-strdup.diff, NONE, 1.1 libsx.spec, 1.8, 1.9 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 Feb 15 15:49:16 UTC 2007


Author: pertusus

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

Modified Files:
	libsx.spec 
Added Files:
	libsx-link_mkdir.diff libsx-strdup.diff 
Removed Files:
	libsx-mkdir_p.diff libsx-protect_strdup.diff libsx-shared.diff 
Log Message:
* 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


libsx-link_mkdir.diff:

--- NEW FILE libsx-link_mkdir.diff ---
--- libsx-2.05/src/Makefile.link_mkdir	2003-08-09 13:17:23.000000000 +0200
+++ libsx-2.05/src/Makefile	2007-02-15 16:39:54.000000000 +0100
@@ -13,6 +13,9 @@
 INCLUDEDIR=/usr/X11R6/include/X11/SX
 SHAREDIR=/usr/share/libsx
 
+mkinstalldirs = mkdir -p
+#mkinstalldirs = mkdirhier
+
 CC=gcc
 
 #
@@ -38,10 +41,10 @@
 
 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,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-2.05/libsx_defs.link_mkdir	1999-12-14 13:59:35.000000000 +0100
+++ libsx-2.05/libsx_defs	2007-02-15 16:42:05.000000000 +0100
@@ -44,7 +44,7 @@
 #  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 @@
 #
 
 #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-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/devel/libsx.spec,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- libsx.spec	15 Feb 2007 15:08:09 -0000	1.8
+++ libsx.spec	15 Feb 2007 15:48:43 -0000	1.9
@@ -1,7 +1,7 @@
 Name:           libsx
 Summary:        Simple X library
 Version:        2.05
-Release:        11%{?dist}
+Release:        12%{?dist}
 Group:          System Environment/Libraries
 License:        LGPL
 Url:            ftp://ftp.ac-grenoble.fr/ge/Xlibraries/
@@ -10,10 +10,9 @@
 Source1:        libsx-simple_freq.c
 Patch0:         libsx-no_nested_prototypes.diff
 Patch1:         libsx-comment_caddr_t.diff
-Patch2:         libsx-protect_strdup.diff
+Patch2:         libsx-strdup.diff
 Patch3:         libsx-examples.diff
-Patch4:         libsx-mkdir_p.diff
-Patch5:         libsx-shared.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
@@ -46,14 +45,14 @@
 # don't redefine caddr_t
 %patch1
 # set strdup prototypes only if strdup isn't a macro
-%patch2 -p1
+%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
-%patch4 -p1
 # shared library with fine soname
-%patch5 -p1
+# fix compile flags
+%patch4 -p1 -b .link_mkdir
 # allow the rgb file location to be redefined
 %patch6 -p1 -b .rgb
 
@@ -61,7 +60,7 @@
 cp %{SOURCE1} freq/simple_freq.c
 
 %build
-make CFLAGS="%{optflags} -fPIC -DRGBTXT=\"\\\"%{_datadir}/X11/rgb.txt\\\"\"" src
+make CFLAGS="%{optflags} -fPIC -DRGBTXT=\"\\\"%{_datadir}/X11/rgb.txt\\\"\""
 
 %install
 rm -rf %{buildroot}
@@ -75,11 +74,18 @@
 # prepare examples directory
 rm -rf examples
 mkdir examples
-cp -a bezier controlbox creq demo* draw_demo frac freq multireq \
-  pcurve skel xmore xrootbg libsx_defs 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 examples/
 # remove symlinks pointing to libsx.h in example directories
 find examples/ -name libsx.h -a -type l -exec rm \{\} \;
 find examples/ -name makefile.examples -exec rm \{\} \;
+rm examples/freq/freq.c.strdup
+for dir in $example_dirs; do
+  make -C examples/$dir clean
+done
+
 
 # fix symbolic links for shared library. It is not completly obvious
 # that using 0.0.0 like in libtool makes sense, do it anyway.
@@ -111,6 +117,12 @@
 %{_includedir}/libsx.h
 
 %changelog
+* 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


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


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


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




More information about the fedora-extras-commits mailing list