libgnugetopt stable port information

Package: libgnugetopt
Version: 1.3
Revision: 1
Source: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/lioux/%n-%v.tar.bz2
Source-MD5: 99425102b193eb35d808e415334af001
BuildDepends: fink (>= 0.24.12-1)
Depends: %N-shlibs (= %v-%r)
Replaces: %N-shlibs (<< 1.2-3)
BuildDependsOnly: true
PatchFile: %n.patch
PatchFile-MD5: 1a208cd74ed12763343f04c8e29ca4cb
PatchScript: <<
%{default_script}
head -n 25 getopt.c > LICENSE
<<
SetCFLAGS: -Wall -DHAVE_STRING_H
CompileScript: make prefix=%p
InstallScript: make install prefix=%i
SplitOff: <<
Package: %N-shlibs
Replaces: %N (<< %v-%r)
Files: lib/libgnugetopt.1.*dylib
Shlibs: %p/lib/%N.1.dylib 1.2.0 %n (>= 1.2-1)
DocFiles: LICENSE README
<<
DocFiles: LICENSE README
Description: GNU getopt library
DescDetail: <<
GNU getopt library similar but more powerful than the standard getopt(3).
It includes the GNU-style getopt_long() function.
Use with -lgnugetopt for linking and gnugetopt/getopt.h for include.
<<
DescPackaging: <<
%N:Replaces:%N-shlibs(<< 1.2-3) because -3 relocated a file %N-shlibs->%N

Former maintainer: Yves de Champlain
<<
DescPort: <<
Rewrite Makefile for Darwin-style shared libraries.

Fix all warnings.
<<
License: GPL
Maintainer: Daniel Macks
Homepage: http://www.FreeBSD.org/cgi/url.cgi?ports/devel/libgnugetopt/pkg-descr

libgnugetopt stable port .patch

diff -Nurd libgnugetopt-1.3.orig/Makefile libgnugetopt-1.3/Makefile
--- libgnugetopt-1.3.orig/Makefile 2004-06-24 10:11:13.000000000 -0400
+++ libgnugetopt-1.3/Makefile 2008-03-14 03:50:02.000000000 -0400
@@ -2,21 +2,33 @@
# GNU getopt library
#

-all: libgnugetopt.so.1 libgnugetopt.a
+all: libgnugetopt.1.3.0.dylib libgnugetopt.a

-libgnugetopt.so.1: getopt.o getopt1.o
- ${CC} ${CFLAGS} -shared -Wl,-soname,libgnugetopt.so.1 -o libgnugetopt.so.1 getopt.o getopt1.o
+libgnugetopt.1.3.0.dylib: getopt.o getopt1.o
+ ${CC} ${CFLAGS} -dynamiclib \
+ -install_name $(prefix)/lib/libgnugetopt.1.dylib \
+ -compatibility_version 1.2.0 -current_version 1.3.0 \
+ -o libgnugetopt.1.3.0.dylib getopt.o getopt1.o

libgnugetopt.a: getopt.o getopt1.o
- @echo building static libgnugetopt library
- ar cq libgnugetopt.a `lorder getopt.o getopt1.o | tsort -q`
+ ar cr libgnugetopt.a getopt.o getopt1.o
ranlib libgnugetopt.a

getopt1.o: getopt1.c
- ${CC} ${CFLAGS} -fPIC -o getopt1.o -c -s getopt1.c
+ ${CC} ${CFLAGS} -fno-common -o getopt1.o -c getopt1.c

getopt.o: getopt.c
- ${CC} ${CFLAGS} -fPIC -o getopt.o -c -s getopt.c
+ ${CC} ${CFLAGS} -fno-common -o getopt.o -c getopt.c

clean:
- rm *.o *.so.1
+ rm *.o *.dylib
+
+install:
+ install -d -p -m 755 $(prefix)/lib $(prefix)/include/gnugetopt
+ install -c -p -m 644 libgnugetopt.a $(prefix)/lib
+ install -c -p -m 755 libgnugetopt.1.3.0.dylib $(prefix)/lib
+ ranlib $(prefix)/lib/libgnugetopt.a
+ install -c -p -m 644 getopt.h $(prefix)/include/gnugetopt
+# -@rm -f $(prefix)/lib/libgnugetopt.dylib $(prefix)/lib/libgnugetopt.1.dylib
+ ln -sf libgnugetopt.1.3.0.dylib $(prefix)/lib/libgnugetopt.1.dylib
+ ln -sf libgnugetopt.1.3.0.dylib $(prefix)/lib/libgnugetopt.dylib

libgnugetopt _unstable_ port .patch