[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#455430: Make build on kfreebsd-*



On Mon, Dec 10, 2007 at 01:51:30AM +0100, Frank Lichtenheld wrote:
> Package: sg3-utils
> Version: 1.24-1
> Severity: normal
> Tags: patch
> 
> Hi.
Hi!

> I noticed that sg3-utils doesn't build on kfreebsd-* even though FreeBSD
> seems to be supported by upstream. The attached patch fixes building
> on kfreebsd-*
> 

Thanks a lot for the patch. It looks correct to me, except that a build
depends on libcam-dev has to be added for kfreebsd-*. It is the library
used to access the SCSI bus.

Please find an updated patch below.


diff -u sg3-utils-1.24/debian/changelog sg3-utils-1.24/debian/changelog
--- sg3-utils-1.24/debian/changelog
+++ sg3-utils-1.24/debian/changelog
@@ -1,3 +1,10 @@
+sg3-utils (1.24-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Add build support for kfreebsd-*
+
+ -- Frank Lichtenheld <djpig@io.debian.net>  Sun, 09 Dec 2007 23:23:09 +0100
+
 sg3-utils (1.24-1) unstable; urgency=low
 
   * New upstream release
diff -u sg3-utils-1.24/debian/control sg3-utils-1.24/debian/control
--- sg3-utils-1.24/debian/control
+++ sg3-utils-1.24/debian/control
@@ -2,7 +2,7 @@
 Section: admin
 Priority: optional
 Maintainer: Eric Schwartz (Skif) <emschwar@debian.org>
-Build-Depends: debhelper (>> 4.0.0), chrpath, libtool
+Build-Depends: debhelper (>> 4.0.0), chrpath, libtool, libcam-dev [kfreebsd-i386 kfreebsd-amd64]
 Standards-Version: 3.7.2
 
 Package: sg3-utils
diff -u sg3-utils-1.24/debian/rules sg3-utils-1.24/debian/rules
--- sg3-utils-1.24/debian/rules
+++ sg3-utils-1.24/debian/rules
@@ -12,6 +12,13 @@
 # Debhelper compatibility level
 export DH_COMPAT=4
 
+DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
+
+MAKEFILE = Makefile
+ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
+	MAKEFILE = Makefile.freebsd
+endif
+
 configure: configure-stamp
 configure-stamp:
 	dh_testdir
@@ -23,7 +30,7 @@
 	dh_testdir
 
 	# Add here commands to compile the package.
-	PREFIX=/usr MANDIR=/usr/share/man $(MAKE) -e
+	PREFIX=/usr MANDIR=/usr/share/man $(MAKE) -f $(MAKEFILE) -e
 
 	touch build-stamp
 
@@ -32,7 +39,7 @@
 	dh_testroot
 
 	# Add here commands to clean up after the build process.
-	-$(MAKE) clean
+	$(MAKE) -f $(MAKEFILE) clean
 
 	rm -f build-stamp configure-stamp debian/substvars
 
@@ -46,9 +53,8 @@
 	dh_installdirs
 
 	# Add here commands to install the package into debian/tmp
-	$(MAKE) -e install DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr
+	$(MAKE) -f $(MAKEFILE) -e install DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr
 
-	find debian/tmp/usr/bin debian/tmp/usr/lib -type f -exec chrpath -d {} \;
 	dh_install --autodest --sourcedir=debian/tmp
 	cp scripts/scsi* scripts/sas* debian/sg3-utils/usr/bin
 
only in patch2:
unchanged:
--- sg3-utils-1.24.orig/Makefile.freebsd
+++ sg3-utils-1.24/Makefile.freebsd
@@ -1,10 +1,10 @@
 SHELL = /bin/sh
 
 PREFIX=/usr/local
-LIBDIR=$(DESTDIR)/$(PREFIX)/lib
-INSTDIR=$(DESTDIR)/$(PREFIX)/bin
-MANDIR=$(DESTDIR)/$(PREFIX)/man
-INCLUDEDIR=$(DESTDIR)/$(PREFIX)/include
+LIBDIR=$(DESTDIR)$(PREFIX)/lib
+INSTDIR=$(DESTDIR)$(PREFIX)/bin
+MANDIR=$(DESTDIR)$(PREFIX)/man
+INCLUDEDIR=$(DESTDIR)$(PREFIX)/include
 
 CC = gcc
 LD = gcc
@@ -74,7 +74,7 @@
 	$(LIBTOOL) $(LT_EXTRA) --mode=compile $(CC) -c sg_pt_freebsd.c
 
 libsgutils.la: sg_lib.lo sg_cmds_basic.lo sg_cmds_extra.lo sg_pt_freebsd.lo
-	$(LIBTOOL) $(LT_EXTRA) --mode=link $(LD) -o libsgutils.la sg_lib.lo \
+	$(LIBTOOL) $(LT_EXTRA) --mode=link $(LD) $(LDFLAGS) -o libsgutils.la sg_lib.lo \
 	sg_cmds_basic.lo sg_cmds_extra.lo sg_pt_freebsd.lo -rpath $(LIBDIR) \
 	-version-info $(LIB_VINFO)
 
only in patch2:
unchanged:
--- sg3-utils-1.24.orig/Makefile
+++ sg3-utils-1.24/Makefile
@@ -1,10 +1,10 @@
 SHELL = /bin/sh
 
 PREFIX=/usr/local
-LIBDIR=$(DESTDIR)/$(PREFIX)/lib
-INSTDIR=$(DESTDIR)/$(PREFIX)/bin
-MANDIR=$(DESTDIR)/$(PREFIX)/share/man
-INCLUDEDIR=$(DESTDIR)/$(PREFIX)/include
+LIBDIR=$(DESTDIR)$(PREFIX)/lib
+INSTDIR=$(DESTDIR)$(PREFIX)/bin
+MANDIR=$(DESTDIR)$(PREFIX)/share/man
+INCLUDEDIR=$(DESTDIR)$(PREFIX)/include
 
 CC = gcc
 LD = gcc

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net



Reply to: