Extreme Newbie Help With Modifying Bacula Port to Get 1.36.0

Drew Tomlinson drew at mykitchentable.net
Tue Nov 2 14:30:12 PST 2004


On 11/2/2004 12:39 PM Frank Laszlo wrote:

> Drew Tomlinson wrote:
>
>> I've never created or modified a port so I'm a complete newbie.  I'm 
>> using bacula 1.34.6 which is the current version in the ports tree.  
>> However my HP DLT30 (DLT2000) tape drive isn't working properly with 
>> the software.  I posted to the bacula list and have been directed to 
>> upgrade to the current version of 1.36.0.
>>
>> So I thought, why don't I learn about ports?  After all, it shouldn't 
>> be to hard to modify a Makefile to get a newer version and then I 
>> could share my updates with the port maintainer.  I've picked through 
>> the Porters Handbook and bsd.port.mk and found that I needed to 
>> change "PORTVERSION=" from "1.34.6" to "1.36.0".  Then I found that I 
>> had to run "make makesum" to create the distinfo file.
>>
>> Now when I run "portupgrade -f bacula", it fails during patching 
>> (output follows).  I suspect that the line numbers have changed and I 
>> need to create a new diff (something I've never done before).  I 
>> suspect I need to make a copy of the appropriate file in the source 
>> code, make these changes to it, and then run diff with the 
>> appropriate switches.  However I have no idea what file I might be 
>> looking for.  Can anyone nudge me in the right direction?  Am I close?
>>
>> Thanks,
>>
>> Drew
>>
>> blacklamb# portupgrade -f bacula
>> --->  Upgrading 'bacula-1.34.6_2' to 'bacula-1.36.0_2' (sysutils/bacula)
>> --->  Building '/usr/ports/sysutils/bacula' with make flags: 
>> WITH_MYSQL=yes
>> ===>  Cleaning for mysql-client-3.23.58_3
>> ===>  Cleaning for libtool-1.5.10
>> ===>  Cleaning for bacula-1.36.0_2
>> =======> ATTENTION <=======
>> ######################################################
>> ===> Please read the file
>> ===>     /usr/local/share/doc/bacula/ReleaseNotes
>> ===> for the upgrade procedure!
>> ===> IF YOU IGNORE THIS you may !! LOSE DATA !!
>> ######################################################
>> ===> Note that there is a pthreads problem, which leads to the loss 
>> of 500kB
>> ===> of data at the end of an tape. This is corrected in newer 
>> versions of FreeBSD
>> ===> READ 
>> /var/tmp/usr/ports/sysutils/bacula/work/bacula-1.36.0/platforms/freebsd/pthreads-fix.txt 
>>
>>
>> You may use the following build options (or make config):
>>
>>  WITH_CLIENT_ONLY=yes  if you only want the file daemon.
>>  WITH_WXCONSOLE=yes    if you only want a wxGTK based GUI console.
>>  WITH_GNOMECONSOLE=yes if you only want a GNOME based GUI console.
>>  WITH_MTX=yes          if you want to use mtx instead of chio for 
>> autochanger control.
>>
>> ===> Using mysql as the bacula database.
>>
>> ===>  Found saved configuration for bacula-1.32f4
>> ===>  Extracting for bacula-1.36.0_2
>> >> Checksum OK for bacula-1.36.0.tar.gz.
>> ===>  Patching for bacula-1.36.0_2
>> ===>  Applying FreeBSD patches for bacula-1.36.0_2
>> 1 out of 1 hunks failed--saving rejects to scripts/Makefile.in.rej
>> >> Patch patch-scripts-Makefile.in failed to apply cleanly.
>> >> Patch(es) patch-autoconf-Make.common.in applied cleanly.
>> *** Error code 1
>
>
> Take a look in the files/ directory, it contains the applicable 
> patches. it will also tell you where to find the files that are being 
> patched. Sometimes you just need to regenerate the patches based on 
> the old ones, only thing that gets changed is line numbers. But in 
> some cases the patches no longer work, or there are new issues than 
> need to be addressed within the patch files. Heres a quick lesson on 
> creating patches.
>
> 1) cp FileName FileName.orig
> 2) vi FileName (make changes)
> 3) diff -U3 Filename.orig FileName >> patch-FileName
> 4) test the patches to be sure they work.
>
> Hope this helps.
>
> Regards,
>    Frank Laszlo 

Thanks for your reply.  In the bacula source, I found src/Makefile.in 
and in the ports tree I found bacula/files/patch-scripts-Makefile.in.  I 
looked at the contents of patch-scripts-Makefile.in and then searched 
the web to learn how to read it so I'd know what changes to make in the 
original Makefile.in.  The diff man page say the example you gave me 
produces a "unified output format" file with 3 lines of context.  The 
examples I've found on the web for this format look like this:

(from http://www.network-theory.co.uk/docs/diff/diff_23.html)
--- lao2002-02-21 23:30:39.942229878 -0800
+++ tzu2002-02-21 23:30:50.442260588 -0800
@@ -1,7 +1,6 @@
-The Way that can be told of is not the eternal Way;
-The name that can be named is not the eternal name.
 The Nameless is the origin of Heaven and Earth;
-The Named is the mother of all things.
+The named is the mother of all things.
+
 Therefore let there always be non-being,
   so we may see their subtlety,
 And let there always be being,

 From my understanding, this is one "hunk".  The next "hunk" would start 
with another line beginning with "@@".  However the 
patch-scripts-Makefile.in the bacula 1.34.6 port tree looks like this:

---BEGIN---
*** scripts/Makefile.in.orig    Wed Mar 31 00:54:17 2004
--- scripts/Makefile.in Thu Apr  8 19:56:21 2004
***************
*** 32,46 ****
        $(MKDIR) $(DESTDIR)$(scriptdir)

  install: installdirs
!       $(INSTALL_SCRIPT) startmysql $(DESTDIR)$(scriptdir)/startmysql
!       $(INSTALL_SCRIPT) stopmysql $(DESTDIR)$(scriptdir)/stopmysql
!       $(INSTALL_SCRIPT) bconsole $(DESTDIR)$(scriptdir)/bconsole
!       $(INSTALL_SCRIPT) gconsole $(DESTDIR)$(scriptdir)/gconsole
!       $(INSTALL_SCRIPT) bacula $(DESTDIR)$(scriptdir)/bacula
!       $(INSTALL_SCRIPT) fd $(DESTDIR)$(scriptdir)/fd
!       $(INSTALL_SCRIPT) mtx-changer $(DESTDIR)$(scriptdir)/mtx-changer
!       $(INSTALL_DATA)   btraceback.gdb 
$(DESTDIR)$(scriptdir)/btraceback.gdb
!       $(INSTALL_SCRIPT) btraceback $(DESTDIR)$(sbindir)/btraceback

  uninstall:
        (cd $(DESTDIR)$(scriptdir); $(RMF) startmysql)
--- 32,46 ----
        $(MKDIR) $(DESTDIR)$(scriptdir)

  install: installdirs
! #     $(INSTALL_SCRIPT) startmysql $(DESTDIR)$(scriptdir)/startmysql
! #     $(INSTALL_SCRIPT) stopmysql $(DESTDIR)$(scriptdir)/stopmysql
! #     $(INSTALL_SCRIPT) bconsole $(DESTDIR)$(scriptdir)/bconsole
! #     $(INSTALL_SCRIPT) gconsole $(DESTDIR)$(scriptdir)/gconsole
!       $(INSTALL_SCRIPT) bacula 
$(DESTDIR)$(sysconfdir)/rc.d/bacula.sh.sample
!       $(INSTALL_SCRIPT) mtx-changer $(DESTDIR)$(scriptdir)/mtx-changer
! #     $(INSTALL_DATA)   btraceback.gdb 
$(DESTDIR)$(scriptdir)/btraceback.gdb
! #     $(INSTALL_SCRIPT) btraceback $(DESTDIR)$(sbindir)/btraceback

  uninstall:
        (cd $(DESTDIR)$(scriptdir); $(RMF) startmysql)
---END---

How do I interpret this file and edit src/Makefile.in that came with the 
bacula 1.36.0 source?  I can see similar sections like "install:" and 
"uninstall:".  Here's the contents of src/Makefile.in:

---BEGIN---
#
# Version $Id: Makefile.in,v 1.11 2004/05/28 15:45:56 kerns Exp $
#
@MCOMMON@

srcdir =        .
VPATH =         .
.PATH:          .

# one up
basedir = ..
# top dir
topdir = ..
# this dir relative to top dir
thisdir = src


first_rule: all
dummy:


.SUFFIXES:      .c .o
.PHONY:
.DONTCARE:

# inference rules
.c.o:
        $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I. -I$(basedir) 
-I$(srcdir) $(DINCLUDE) $(CFLAGS) $<

.cc.o:
        $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I. -I$(basedir) 
-I$(srcdir) $(DINCLUDE) $(CFLAGS) $<
#-------------------------------------------------------------------------
all: Makefile


Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
        cd $(topdir) \
          && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) 
./config.status


clean:
        @$(RMF) core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
        @$(RMF) AUTHORS ChangeLog Makefile.am NEWS README acconfig.h 
autogen.sh
        @$(RMF) configure.in stamp.h stamp-h.in
        @$(RMF) -r po
        (cd gnome-console; $(MAKE) clean)
        (cd gnome2-console; $(MAKE) clean)

realclean: clean
        @$(RMF) tags

distclean: realclean
        if test $(srcdir) = .; then $(MAKE) realclean; fi
        @(cd $(srcdir); $(RMF) Makefile)
        @$(RMF) config.h host.h
        @$(RMF) -r CVS

devclean: realclean
        if test $(srcdir) = .; then $(MAKE) realclean; fi
        @(cd $(srcdir); $(RMF) Makefile)
        @$(RMF) config.h host.h

install:


uninstall:


depend:
---END---

I'd be happy to read if only I knew what to read.  :)

Thanks for your help!

Drew

-- 
Visit The Alchemist's Warehouse
Magic Tricks, DVDs, Videos, Books, & More!

http://www.alchemistswarehouse.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2801 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20041102/093ff616/smime.bin


More information about the freebsd-ports mailing list