Rakefile.local
author Mahlon E. Smith <mahlon@martini.nu>
Sat, 28 Feb 2009 04:54:46 +0000
branchmahlon-misc
changeset 12 5fd07a9e7e7b
parent 10 b1426511fb64
permissions -rw-r--r--
* Added jail header dependencies for mkmf Makefile. * Renamed header file (bsdjail -> jail) * Fixed copyright * Initial commit of primary functionality * Attach to a running jail * Create a new jail * List and instantiate existing jails * Fetch information about existing jails * Still needs... * Attach "in a block" fleshed out * Documentation and better comments * Tests (of some kind, this will be tough) * Update for not-yet-MFC'ed multiple IP jail patch in FBSD 7.2-STABLE
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
     1
#!rake
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
     2
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     3
#!rake
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     4
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     5
# C extension constants
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
     6
EXT_MAKEFILE  = EXTDIR + 'Makefile'
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
     7
EXT_SOURCES   = FileList[ EXTDIR + '*.c' ]
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
     8
EXT_SO        = EXTDIR + "bsdjail.#{CONFIG['DLEXT']}"
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     9
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    10
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    11
#####################################################################
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    12
###	T A S K S
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    13
#####################################################################
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    14
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    15
# Make both the default task and the spec task depend on building the extension
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    16
task :local => :build
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    17
task :spec => :build
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    18
namespace :spec do
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    19
	task :doc   => [ :build ]
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    20
	task :quiet => [ :build ]
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    21
	task :html  => [ :build ]
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    22
	task :text  => [ :build ]
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    23
end
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    24
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    25
desc "Make the Makefile for the C extension"
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    26
file EXT_MAKEFILE.to_s => EXT_SOURCES do
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    27
	log "Configuring bsdjail C extension"
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    28
	in_subdirectory( EXTDIR ) do
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    29
		ruby 'extconf.rb'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    30
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    31
end
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    32
CLOBBER.include( EXTDIR + 'mkmf.log', EXT_SO )
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    33
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    34
desc "Build the C extension"
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    35
task :build => [ EXT_MAKEFILE.to_s, *EXT_SOURCES ] do
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    36
	in_subdirectory( EXTDIR ) do
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    37
		sh 'make'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    38
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    39
end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    40
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    41
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    42
desc "Rebuild the C extension"
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    43
task :rebuild => [ :clean, :build ]
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    44
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    45
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    46
task :clean do
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    47
	if EXT_MAKEFILE.exist?
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    48
		in_subdirectory( EXTDIR ) do
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    49
			sh 'make clean'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    50
		end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    51
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    52
end	
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    53
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    54
task :clobber do
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    55
	if EXT_MAKEFILE.exist?
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    56
		in_subdirectory( EXTDIR ) do
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    57
			sh 'make distclean'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    58
		end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    59
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    60
end	
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents: 0
diff changeset
    61
CLOBBER.include( EXT_MAKEFILE )
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    62