2007-07-30 Doug Scott <
[email protected]>
* SFEzgv.spec: *NEW* Fullscreen Image viewer
* SFElibpcd.spec: *NEW* Kodak PhotoCD library
* SFElibdiscid.spec: *NEW* Musicbrainz DiscID library
* SFElibmusicbrainz3.spec: *NEW* Musicbrainz 3 library
* patches/libmusicbrainz3-01-cppunit.diff: patch for cppunit code
* patches/zgv-02-config.diff: Solaris patch for config.mak
* patches/zgv-01-solaris.diff: Solaris patch
* patches/libdiscid-01-solaris.diff: Solaris patch
* patches/libpcd-01-makefile.diff: Solaris Makefile
--- a/ChangeLog Mon Jul 30 00:44:32 2007 +0000
+++ b/ChangeLog Mon Jul 30 05:31:02 2007 +0000
@@ -1,3 +1,15 @@
+2007-07-30 Doug Scott <[email protected]>
+
+ * SFEzgv.spec: *NEW* Fullscreen Image viewer
+ * SFElibpcd.spec: *NEW* Kodak PhotoCD library
+ * SFElibdiscid.spec: *NEW* Musicbrainz DiscID library
+ * SFElibmusicbrainz3.spec: *NEW* Musicbrainz 3 library
+ * patches/libmusicbrainz3-01-cppunit.diff: patch for cppunit code
+ * patches/zgv-02-config.diff: Solaris patch for config.mak
+ * patches/zgv-01-solaris.diff: Solaris patch
+ * patches/libdiscid-01-solaris.diff: Solaris patch
+ * patches/libpcd-01-makefile.diff: Solaris Makefile
+
2007-07-30 Mark Wright <[email protected]>
* SFEsqlite.spec: bump to 3.4.1.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SFElibdiscid.spec Mon Jul 30 05:31:02 2007 +0000
@@ -0,0 +1,87 @@
+#
+# spec file for package SFElibdiscid
+#
+# includes module(s): libdiscid
+#
+%include Solaris.inc
+
+%define src_ver 0.1.1
+%define src_name libdiscid
+%define src_url http://users.musicbrainz.org/~matt
+
+Name: SFElibdiscid
+Summary: Library for creating MusicBrainz DiscIDs
+Version: %{src_ver}
+License: GPL v2.1+
+Source: %{src_url}/%{src_name}-%{version}.tar.gz
+Patch1: libdiscid-01-solaris.diff
+SUNW_BaseDir: %{_basedir}
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+
+%description
+libdiscid is a C library for creating MusicBrainz DiscIDs from audio
+CDs. It reads a CD's table of contents (TOC) and generates an
+identifier which can be used to lookup the CD at MusicBrainz.
+Additionally, it provides a submission URL for adding the DiscID to
+the database.
+
+%package devel
+Summary: %{summary} - development files
+SUNW_BaseDir: %{_prefix}
+%include default-depend.inc
+Requires: %name
+
+%prep
+%setup -q -n %{src_name}-%version
+cp src/disc_linux.c src/disc_solaris.c
+%patch1 -p1
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+ CPUS=1
+fi
+
+export CFLAGS="%optflags"
+export LDFLAGS="%_ldflags"
+
+libtoolize --copy --force
+aclocal
+autoconf -f
+autoheader
+automake -a -f
+./configure --prefix=%{_prefix} \
+ --bindir=%{_bindir} \
+ --libdir=%{_libdir} \
+ --includedir=%{_includedir} \
+ --mandir=%{_mandir} \
+ --infodir=%{_infodir} \
+ --disable-static \
+ --enable-shared \
+ --disable-debug
+
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.*a
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_libdir}
+%{_libdir}/lib*.so*
+
+%files devel
+%defattr (-, root, bin)
+%{_includedir}
+%dir %attr (0755, root, bin) %{_libdir}
+%dir %attr (0755, root, other) %{_libdir}/pkgconfig
+%{_libdir}/pkgconfig/*
+
+%changelog
+* Mon Jul 30 2007 - [email protected]
+- Initial spec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SFElibmusicbrainz3.spec Mon Jul 30 05:31:02 2007 +0000
@@ -0,0 +1,80 @@
+#
+# spec file for package SFElibmusicbrainz3
+#
+# includes module(s): libmusicbrainz3
+#
+%include Solaris.inc
+
+%define src_ver 3.0.1
+%define src_name libmusicbrainz
+%define src_url ftp://ftp.musicbrainz.org/pub/musicbrainz
+
+Name: SFElibmusicbrainz3
+Summary: library for accesing MusicBrainz servers
+Version: %{src_ver}
+License: LGPL
+Source: %{src_url}/%{src_name}-%{version}.tar.gz
+Patch1: libmusicbrainz3-01-cppunit.diff
+SUNW_BaseDir: %{_basedir}
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: SFEcmake
+Requires: SUNWneon
+BuildRequires: SFElibdiscid-devel
+Requires: SFElibdiscid
+BuildRequires: SFEcppunit-devel
+Requires: SFEcppunit
+
+%description
+The MusicBrainz client library allows applications to make metadata
+lookup to a MusicBrainz server, generate signatures from WAV data and
+create CD Index Disk ids from audio CD roms.
+
+%package devel
+Summary: %{summary} - development files
+SUNW_BaseDir: %{_prefix}
+%include default-depend.inc
+Requires: %name
+
+%prep
+%setup -q -n %{src_name}-%version
+%patch1 -p1
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+ CPUS=1
+fi
+
+export LDFLAGS="%_ldflags -i"
+cmake -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_C_COMPILER:FILEPATH=$(CC) \
+ -DCMAKE_C_FLAGS:STRING="%optflags" \
+ -DCMAKE_CXX_COMPILER:FILEPATH=g++ \
+ -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O4 -fno-omit-frame-pointer" \
+ -DCMAKE_VERBOSE_MAKEFILE=1
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT CMAKE_INSTALL_PREFIX=/usr
+rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.*a
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_libdir}
+%{_libdir}/lib*.so*
+
+%files devel
+%defattr (-, root, bin)
+%{_includedir}
+%dir %attr (0755, root, bin) %{_libdir}
+%dir %attr (0755, root, other) %{_libdir}/pkgconfig
+%{_libdir}/pkgconfig/*
+
+%changelog
+* Mon Jul 30 2007 - [email protected]
+- Initial spec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SFElibpcd.spec Mon Jul 30 05:31:02 2007 +0000
@@ -0,0 +1,64 @@
+#
+# spec file for package SFElibpcd
+#
+# includes module(s): libpcd
+#
+%include Solaris.inc
+
+%define src_name libpcd
+%define src_url http://dl.bytesex.org/releases/libpcd
+
+Name: SFElibpcd
+Summary: Library for reading PhotoCD images
+Version: 1.0.1
+Source: %{src_url}/%{src_name}_%{version}.tar.gz
+Patch1: libpcd-01-makefile.diff
+SUNW_BaseDir: %{_basedir}
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+%include default-depend.inc
+
+%package devel
+Summary: %{summary} - development files
+SUNW_BaseDir: %{_prefix}
+%include default-depend.inc
+Requires: %name
+
+%prep
+%setup -q -n %{src_name}-%version
+%patch1 -p1
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+ CPUS=1
+fi
+
+export CFLAGS="%optflags"
+export LDFLAGS="%_ldflags"
+export PICFLAGS="-KPIC"
+export SHAREDFLAGS="-G -Wl,-h"
+export WARN=""
+export PREFIX=%{_prefix}
+
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.*a
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_libdir}
+%{_libdir}/lib*.so*
+
+%files devel
+%defattr (-, root, bin)
+%{_includedir}
+
+%changelog
+* Mon Jul 30 2007 - [email protected]
+- Initial spec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SFEzgv.spec Mon Jul 30 05:31:02 2007 +0000
@@ -0,0 +1,92 @@
+#
+# spec file for package SFEzgv
+#
+# includes module(s): zgv
+#
+%include Solaris.inc
+
+%define src_name zgv
+%define src_url ftp://metalab.unc.edu/pub/Linux/apps/graphics/viewers/svga
+
+Name: SFEzgv
+Summary: Console viewer for many graphics formats
+Version: 5.9
+Source: %{src_url}/%{src_name}-%{version}.tar.gz
+Patch1: zgv-01-solaris.diff
+Patch2: zgv-02-config.diff
+SUNW_BaseDir: %{_basedir}
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+%include default-depend.inc
+BuildRequires: SFElibpcd-devel
+Requires: SFElibpcd
+BuildRequires: SUNWjpg-devel
+Requires: SUNWjpg
+BuildRequires: SUNWTiff-devel
+Requires: SUNWTiff
+BuildRequires: SFEgawk
+
+%prep
+%setup -q -n %{src_name}-%version
+%patch1 -p1
+%patch2 -p1
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+ CPUS=1
+fi
+
+export CFLAGS="%optflags"
+export LDFLAGS="%_ldflags"
+export OPTFLAGS="$CFLAGS"
+export BACKEND=SDL
+export RGB_DB="/usr/X11/lib/X11/rgb.txt"
+export RCFILE="%{_sysconfdir}/zgv.conf"
+export PREFIX="%{_prefix}"
+export AWK=/usr/xpg4/bin/awk
+export SHARE_INFIX=/share
+export PCDDEF=-DPCD_SUPPORT
+
+make all
+make info
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+export CFLAGS="%optflags"
+export LDFLAGS="%_ldflags"
+export OPTFLAGS="$CFLAGS"
+export BACKEND=SDL
+export RGB_DB="/usr/X11/lib/X11/rgb.txt"
+export RCFILE="%{_sysconfdir}/zgv.conf"
+export PREFIX="%{_prefix}"
+export AWK=/usr/xpg4/bin/awk
+export SHARE_INFIX=/share
+export PCDDEF=-DPCD_SUPPORT
+
+make install DESTDIR=$RPM_BUILD_ROOT
+rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.*a
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+[ ! -x /usr/sbin/fix-info-dir ] || {
+ /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+}
+
+%postun
+[ ! -x /usr/sbin/fix-info-dir ] || {
+ /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+}
+
+%files
+%defattr (-, root, bin)
+%{_bindir}
+%dir %attr (0755, root, sys) %{_datadir}
+%{_infodir}
+%{_mandir}
+
+%changelog
+* Mon Jul 30 2007 - [email protected]
+- Initial spec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/libdiscid-01-solaris.diff Mon Jul 30 05:31:02 2007 +0000
@@ -0,0 +1,81 @@
+--- libdiscid-0.1.1/src/disc_solaris.c.orig 2007-07-30 10:30:44.305278610 +0700
++++ libdiscid-0.1.1/src/disc_solaris.c 2007-07-30 10:37:14.815554646 +0700
+@@ -30,14 +30,14 @@
+ #include <sys/ioctl.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+-#include <linux/cdrom.h>
++#include <sys/cdio.h>
+ #include <assert.h>
+
+
+ #include "discid/discid_private.h"
+
+
+-#define MB_DEFAULT_DEVICE "/dev/cdrom"
++#define MB_DEFAULT_DEVICE "/dev/sr0"
+
+ #define XA_INTERVAL ((60 + 90 + 2) * CD_FRAMES)
+
+@@ -48,7 +48,7 @@
+
+ static int read_toc_header(int fd, int *first, int *last) {
+ struct cdrom_tochdr th;
+- struct cdrom_multisession ms;
++ // struct cdrom_multisession ms;
+
+ int ret = ioctl(fd, CDROMREADTOCHDR, &th);
+
+@@ -63,11 +63,11 @@
+ * currently only dual-session discs with one track in the second
+ * session are handled correctly.
+ */
+- ms.addr_format = CDROM_LBA;
+- ret = ioctl(fd, CDROMMULTISESSION, &ms);
+-
+- if ( ms.xa_flag )
+- (*last)--;
++// ms.addr_format = CDROM_LBA;
++// ret = ioctl(fd, CDROMMULTISESSION, &ms);
++//
++// if ( ms.xa_flag )
++// (*last)--;
+
+ return ret;
+ }
+@@ -92,16 +92,16 @@
+
+
+ static int read_leadout(int fd, unsigned long *lba) {
+- struct cdrom_multisession ms;
++ // struct cdrom_multisession ms;
+ int ret;
+
+- ms.addr_format = CDROM_LBA;
+- ret = ioctl(fd, CDROMMULTISESSION, &ms);
+-
+- if ( ms.xa_flag ) {
+- *lba = ms.addr.lba - XA_INTERVAL;
+- return ret;
+- }
++// ms.addr_format = CDROM_LBA;
++// ret = ioctl(fd, CDROMMULTISESSION, &ms);
++//
++// if ( ms.xa_flag ) {
++// *lba = ms.addr.lba - XA_INTERVAL;
++// return ret;
++// }
+
+ return read_toc_entry(fd, CDROM_LEADOUT, lba);
+ }
+--- libdiscid-0.1.1/configure.ac.orig 2007-07-30 10:06:43.836430441 +0700
++++ libdiscid-0.1.1/configure.ac 2007-07-30 10:08:22.851599959 +0700
+@@ -25,7 +25,7 @@
+ #*-netbsd*) os=netbsd ;;
+ #*-openbsd*) os=openbsd ;;
+ #*-os2_emx*) os=os2 ;;
+- #*-solaris*) os=solaris; LIBS='-lsocket -lnsl' ;;
++ *-solaris*) os=solaris; LIBS='-lsocket -lnsl' ;;
+ #*-qnx*) os=qnx; LIBS='-lsocket' ;;
+ *) AC_MSG_ERROR([unsupported operating system]) ;;
+ esac
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/libmusicbrainz3-01-cppunit.diff Mon Jul 30 05:31:02 2007 +0000
@@ -0,0 +1,14 @@
+--- libmusicbrainz-3.0.0/test/main.cpp.orig 2006-05-27 20:54:06.000000000 +0200
++++ libmusicbrainz-3.0.0/test/main.cpp 2007-05-28 21:13:09.985711321 +0200
+@@ -1,9 +1,10 @@
++//#include <string>
++#include <cppunit/CompilerOutputter.h>
+ #include <cppunit/TestResult.h>
+ #include <cppunit/TestResultCollector.h>
+ #include <cppunit/TestRunner.h>
+ #include <cppunit/extensions/TestFactoryRegistry.h>
+ #include <cppunit/BriefTestProgressListener.h>
+-#include <cppunit/CompilerOutputter.h>
+
+ int
+ main(int argc, char **argv)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/libpcd-01-makefile.diff Mon Jul 30 05:31:02 2007 +0000
@@ -0,0 +1,55 @@
+--- libpcd-1.0.1/GNUmakefile.orig 2007-07-30 07:15:52.724984222 +0700
++++ libpcd-1.0.1/GNUmakefile 2007-07-30 07:23:21.155705767 +0700
+@@ -1,14 +1,16 @@
+
+-DESTDIR :=
+-prefix := /usr/local
++DESTDIR ?=
++prefix := /usr
+
+ incdir := $(DESTDIR)$(prefix)/include
+ libdir := $(DESTDIR)$(prefix)/lib
+
+-CC := gcc
+-WARN := -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
++CC ?= gcc
++WARN ?= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
+ CFLAGS ?= -g -O2
+ CFLAGS += $(WARN)
++PICFLAGS ?= -fPIC
++SHAREDFLAGS ?= -shared -Wl,-soname,$(SONAME)
+
+ MAJOR := 2
+ MINOR := 2.0.1
+@@ -23,10 +25,10 @@
+ all build: $(TARGETS)
+
+ %.o: %.c
+- $(CC) $(CFLAGS) -Wp,-MD,$(depfile) -c -o $@ $<
++ $(CC) $(CFLAGS) -c -o $@ $<
+
+ %.pic.o: %.c
+- $(CC) $(CFLAGS) -Wp,-MD,$(depfile) -fPIC -c -o $@ $<
++ $(CC) $(CFLAGS) $(PICFLAGS) -c -o $@ $<
+
+ libpcd.a: $(STATIC)
+ rm -f $@
+@@ -35,15 +37,15 @@
+
+ libpcd.so.$(MINOR): $(SHARED)
+ rm -f $@
+- $(CC) $(CFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $(SHARED)
++ $(CC) $(CFLAGS) $(SHAREDFLAGS),$(SONAME) -o $@ $(SHARED)
+
+ install:
+ install -d $(libdir)
+ install -d $(incdir)
+ install -m644 libpcd.a $(libdir)
+ install -m755 libpcd.so.$(MINOR) $(libdir)
+- ln -s libpcd.so.$(MINOR) $(libdir)/libpcd.so.$(MAJOR)
+- ln -s libpcd.so.$(MINOR) $(libdir)/libpcd.so
++ ( cd $(libdir) && ln -s libpcd.so.$(MINOR) libpcd.so.$(MAJOR) )
++ ( cd $(libdir) && ln -s libpcd.so.$(MINOR) libpcd.so )
+ install -m644 pcd.h $(incdir)
+
+ clean:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/zgv-01-solaris.diff Mon Jul 30 05:31:02 2007 +0000
@@ -0,0 +1,121 @@
+--- zgv-5.9/doc/zgv.texi.orig 2007-07-30 08:34:54.591547847 +0700
++++ zgv-5.9/doc/zgv.texi 2007-07-30 08:35:03.798713968 +0700
+@@ -1,6 +1,6 @@
+ \input texinfo @c -*-texinfo-*-
+ @c %**start of header
+-@setfilename zgv
++@setfilename zgv.info
+ @settitle The zgv manual
+ @setchapternewpage odd
+ @c %**end of header
+--- zgv-5.9/doc/Makefile.orig 2007-07-30 08:29:39.384942792 +0700
++++ zgv-5.9/doc/Makefile 2007-07-30 08:43:47.961479414 +0700
+@@ -43,22 +43,10 @@
+ else
+ install: ../src/install-info
+ endif
+- $(RM) /usr/share/man/man1/zgv.1* /usr/share/info/zgv*
+- install -m 644 zgv.1 $(MANDIR)
+- install -m 644 zgv zgv-? $(INFODIR)
+-# Update info `dir' file.
+-# Info always uses a dir file in preference to a dir.gz, so we don't use
+-# dir.gz unless it's the only game in town.
+-ifneq ($(INFO_DIR_UPDATE),no)
+- if [ -f $(INFODIR)/dir.gz -a ! -f $(INFODIR)/dir ]; then \
+- gzip -d $(INFODIR)/dir.gz; \
+- ../src/install-info zgv $(INFODIR)/dir; \
+- gzip $(INFODIR)/dir; \
+- else \
+- ../src/install-info zgv $(INFODIR)/dir; \
+- chmod a+r $(INFODIR)/dir; \
+- fi
+-endif
++ mkdir -p $(DESTDIR)$(MANDIR)
++ mkdir -p $(DESTDIR)$(INFODIR)
++ install -m 644 zgv.1 $(DESTDIR)$(MANDIR)
++ install -m 644 zgv.info $(DESTDIR)$(INFODIR)
+
+ ../src/install-info: ../src/install-info.c
+ cd ../src && $(MAKE) install-info
+--- zgv-5.9/src/zgv.h.orig 2007-07-30 08:00:45.255800352 +0700
++++ zgv-5.9/src/zgv.h 2007-07-30 08:02:43.109863268 +0700
+@@ -7,8 +7,10 @@
+ #define ZGV_VER "5.9"
+
+
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__)
+ #define OSTYPE_FREEBSD 1
++#elif defined(sun)
++#define OSTYPE_SOLARIS 1
+ #else
+ #define OSTYPE_LINUX 1
+ #endif
+--- zgv-5.9/src/readnbkey.c.orig 2007-07-30 08:19:35.180788964 +0700
++++ zgv-5.9/src/readnbkey.c 2007-07-30 08:20:19.395529133 +0700
+@@ -270,7 +270,7 @@
+
+ #endif /* OSTYPE_LINUX */
+
+-#ifdef OSTYPE_FREEBSD
++#if defined(OSTYPE_FREEBSD) || defined(OSTYPE_SOLARIS)
+
+ /* version for FreeBSD */
+ int readnbkey(int ttyfd)
+--- zgv-5.9/src/zgv.c.orig 2007-07-30 08:03:01.777205386 +0700
++++ zgv-5.9/src/zgv.c 2007-07-30 08:06:27.555771221 +0700
+@@ -45,6 +45,10 @@
+ #ifdef OSTYPE_FREEBSD
+ #include <sys/consio.h>
+ #endif
++#ifdef OSTYPE_SOLARIS
++#include <fcntl.h>
++#endif
++
+ #include "readgif.h"
+ #include "vgadisp.h"
+ #include "readnbkey.h"
+@@ -3893,7 +3897,9 @@
+ void wait_for_foreground()
+ {
+ vga_runinbackground(0);
++#if !defined(OSTYPE_SOLARIS)
+ ioctl(zgv_ttyfd,VT_WAITACTIVE,zgv_vt);
++#endif
+ }
+
+
+--- zgv-5.9/src/Makefile.orig 2007-07-30 07:54:08.825867888 +0700
++++ zgv-5.9/src/Makefile 2007-07-30 08:29:06.589967796 +0700
+@@ -13,8 +13,8 @@
+ # having /usr/local/{include,lib} like this is apparently needed for
+ # FreeBSD, but shouldn't cause problems on Linux.
+ #
+-CFLAGS+=-I/usr/local/include
+-ZGV_LIBS=-L/usr/local/lib
++CFLAGS+=-I$(PREFIX)/include
++ZGV_LIBS=-L$(PREFIX)/lib
+
+ CFLAGS+=-DBACKEND_$(BACKEND)
+
+@@ -61,16 +61,14 @@
+ #
+ install: all
+ @if [ "$(BACKEND)" = SVGALIB ]; then \
+- echo $(RM) /usr/bin/zgv; \
+- $(RM) /usr/bin/zgv; \
+ echo install -m 4755 -o root -g root -s zgv $(BINDIR); \
+ install -m 4755 -o root -g root -s zgv $(BINDIR); \
+ fi
+ @if [ "$(BACKEND)" = SDL ]; then \
+- echo $(RM) /usr/bin/zgv-sdl; \
+- $(RM) /usr/bin/zgv-sdl; \
+- echo install -m 755 -s zgv $(BINDIR)/zgv-sdl; \
+- install -m 755 -s zgv $(BINDIR)/zgv-sdl; \
++ echo mkdir -p $(DESTDIR)$(BINDIR); \
++ mkdir -p $(DESTDIR)$(BINDIR); \
++ echo install -m 755 zgv $(DESTDIR)$(BINDIR)/zgv; \
++ install -m 755 zgv $(DESTDIR)$(BINDIR)/zgv; \
+ fi
+
+ uninstall:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/zgv-02-config.diff Mon Jul 30 05:31:02 2007 +0000
@@ -0,0 +1,62 @@
+--- zgv-5.9/config.mk.orig 2007-07-30 08:51:55.859285387 +0700
++++ zgv-5.9/config.mk 2007-07-30 08:52:44.113938239 +0700
+@@ -7,8 +7,8 @@
+ # Set the C compiler to use, and options for it.
+ # This is likely to be what you'll want for most systems:
+ #
+-CC=gcc
+-CFLAGS=-O2 -Wall -fomit-frame-pointer -finline-functions
++CC?=gcc
++CFLAGS?=-O2 -Wall -fomit-frame-pointer -finline-functions
+ #
+ # If you're brave enough to try compiling zgv on a non-x86 system :-),
+ # this might be a better bet:
+@@ -20,13 +20,13 @@
+ # (This should be a `new' awk, such as gawk or mawk.) This setting
+ # should work for Linux and *BSD.
+ #
+-AWK=awk
++AWK?=awk
+
+ # Set display backend to use. svgalib is the `native' one and
+ # is likely to remain preferable. The SDL backend is now quite
+ # usable, but tends to be rather slower.
+ #
+-BACKEND=SVGALIB
++BACKEND?=SVGALIB
+ #BACKEND=SDL
+
+
+@@ -37,7 +37,7 @@
+ # MANDIR to directory for man page.
+ # Usually it will be simpler to just set PREFIX.
+ #
+-PREFIX=/usr/local
++PREFIX?=/usr/local
+
+ # In theory it would be nice to put the info file and man page under
+ # /usr/local/share. However, it's not clear if this is widely
+@@ -59,7 +59,7 @@
+ # Set the location/filename of the system-wide configuration file. You
+ # may prefer to have this under /etc, for example.
+ #
+-RCFILE=$(PREFIX)/etc/zgv.conf
++RCFILE?=$(PREFIX)/etc/zgv.conf
+
+
+ # Normally `make install' will update your `dir' file (in INFODIR),
+@@ -91,7 +91,7 @@
+ # colours will be recognised, which will mean many XPMs won't be
+ # readable. This setting should be ok.
+ #
+-RGB_DB=/usr/X11R6/lib/X11/rgb.txt
++RGB_DB?=/usr/X11R6/lib/X11/rgb.txt
+
+ # Finally, an option for `make dvi' in the `doc' directory. You only need
+ # worry about what this is set to if you plan to make a printed manual.
+@@ -102,4 +102,4 @@
+ # edit this file when you do `make dvi', but that's only because
+ # doc/Makefile isn't as smart about that as it should be. :-))
+ #
+-USE_A4_DEF=-t @afourpaper
++USE_A4_DEF?=-t @afourpaper