Tuesday, June 14, 2005

Updates: Fink Stuff

I'm up to 23 fink packages. I know that's nothing compared to some other maintainers, but I'm still pleased with myself for it.

I've decided that just editing my packages from inside the CVS tree is too error-prone, especially in terms of keeping packages for several differing trees in sync.

Simply keeping a sandbox around with a master copy of the .info and using 'install' or similar to copy the master copy into the appropriate distributions would squish changes from upstream. That would be bad. I settled on using emacs' ediff-mode to handle this.

And as long as I'm automating this process, it would be nice to automate generation of ssl and non-ssl versions for packages that need this. To do this I settled on using a little bit of perl-fu to change the name of the package appropriately, and then a bit of magic with the Variants system to handle the rest.

Here's a snippet of the Makefile (insert tabs where needed) I'm using:

SSL=perl -pi~ -e 's/(Package: (?!%N)[^%\n]+)(%type_pkg.+)?/\1-ssl\2/'

#Fink unstable for 10.3
F103u-lib=/sw/fink/10.3/unstable/main/finkinfo/libs/
F103u-crypto=/sw/fink/10.3/unstable/crypto/finkinfo/

define merge
diff -q $(1) `basename $(1)` || ( touch $(1) && mv $(1) orig && emacs --eval "(ediff-merge-files \"orig\" \"`basename $(1)`\" nil \"$(1)\" )" && rm orig )
endef

define check
fink -v validate $(1) | grep "looks good"
endef

############
# libnasl3 #
############
libnasl3:
$(call merge,$(F103u-lib)libnasl3.info)
$(call merge,$(F103u-lib)libnasl3.patch)
cp libnasl3.info libnasl3-ssl.info
cp libnasl3.patch libnasl3-ssl.patch
$(SSL) libnasl3-ssl.info
$(call merge,$(F103u-crypto)libnasl3-ssl.info)
$(call merge,$(F103u-crypto)libnasl3-ssl.patch)
rm libnasl3-ssl.*
libnasl3-ci:
$(call check,$(F103u-lib)libnasl3.info) && $(call check,$(F103u-crypto)libnasl3-ssl.info) && cd /sw/fink && cvs ci 10.3/unstable/main/finkinfo/libs/libnasl3.info 10.3/unstable/main/finkinfo/libs/libnasl3.patch 10.3/unstable/crypto/finkinfo/libnasl3-ssl.info 10.3/unstable/crypto/finkinfo/libnasl3-ssl.patch


So far I'm quite pleased with it. But we'll see how it turns out as I use it for more things.

No comments: