mkreslib.pl revision dafcb997e390efa4423883dafd100c975c4095d6
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt#!/usr/bin/perl
a747113422afaa29ce72d2c5ba7f0b7ea9ec2054Evan Hunt#
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
a747113422afaa29ce72d2c5ba7f0b7ea9ec2054Evan Hunt# Copyright (C) 2000, 2001 Internet Software Consortium.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt#
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Permission to use, copy, modify, and distribute this software for any
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# purpose with or without fee is hereby granted, provided that the above
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# copyright notice and this permission notice appear in all copies.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt#
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# PERFORMANCE OF THIS SOFTWARE.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# $Id: mkreslib.pl,v 1.10 2004/03/05 05:14:16 marka Exp $
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Build a res_* library distribution from the BIND 8 source
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt#
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Usage:
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt#
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Export the BIND 8 source from CVS into a scratch directory,
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# chdir into the 'bind' directory, run this script.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Finally tar up the directory. For example:
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt#
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# cd $scratch
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# cvs export -r t5b-823 bind
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# cd bind
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# perl $bind9/util/mkreslib.pl
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# cd ..
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# mv bind libbind8-9.0.0b5
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# tar cf - libbind8-9.0.0b5 | gzip >libbind8-9.0.0b5.tar.gz
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt#
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Don't bother keeping contrib or doc around in the new tarball
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntsystem("rm -rf Makefile contrib doc");
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntsystem("mv src/* src/.??* .");
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntsystem("rmdir src");
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# We don't want bin/, conf/, tests/, or OLD/
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntsystem("rm -rf bin conf tests OLD");
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Move the old README away
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntsystem("mv README README.bind8");
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Make a new README
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntopen(README, ">README") || warn "README: $!";
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntprint README <<EOF;
ef421f66f47224a42073deaf087378c5d0c9952eEvan HuntThis is the resolver library from BIND 8, provided for legacy software
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntneeding access to these functions. Programmers of new software are encouraged
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntto use the new lightweight resolver library instead.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan HuntSee the README.bind8 file for the original README shipped with BIND 8.
ef421f66f47224a42073deaf087378c5d0c9952eEvan HuntEOF
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntclose(README);
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntsystem("mv CHANGES CHANGES.bind8");
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntsystem("mv INSTALL INSTALL.bind8");
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# The following files aren't useful here
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntsystem("rm -rf DNSSEC SUPPORT TODO");
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Massage the Makefile
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntsystem("mv Makefile Makefile.bind8");
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntopen(MAKEIN, "Makefile.bind8") || warn "Makefile.bind8: $!";
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntopen(MAKEOUT, ">Makefile") || warn "Makefile: $!";
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntwhile (<MAKEIN>) {
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt if (/^SUBDIRS= (.*)$/) {
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt $line = $1;
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt $line =~ s/bin//;
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt print MAKEOUT "SUBDIRS= $line";
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt next;
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt }
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt if (/^links:/) {
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt goto DONE;
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt }
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt print MAKEOUT;
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt}
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan HuntDONE:
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntprint MAKEOUT "FRC:\n";
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntclose(MAKEIN);
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntclose(MAKEOUT);
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt