#
#	Makefile to install the system-startup code for SecurityServer
#

# wouldn't it be nice if PBX actually $#@?@! defined those?
# Note: CORE_SERVICES_DIR should be absolute path in target environment (don't prefix with DSTROOT)
SYSTEM_LIBRARY_DIR=$(DSTROOT)/System/Library
SYSTEM_CORE_SERVICES_DIR=/System/Library/CoreServices
AUTHORIZATION_LOCATION=$(DSTROOT)/private/etc
AUTHORIZATION_PLIST=$(AUTHORIZATION_LOCATION)/authorization

DST=$(SYSTEM_LIBRARY_DIR)/StartupItems/SecurityServer
SRC=$(SRCROOT)/SecurityServer


#
# The other phases do nothing
#
build:	
	@echo null build.

debug:
	@echo null debug.

profile:
	@echo null profile.

#
# Install
#
install:
	mkdir -p $(DST)/Resources/English.lproj
	cp $(SRC)/StartupItems/StartupParameters.plist $(DST)
	sed -e "s:@@@:$(SYSTEM_CORE_SERVICES_DIR):g" $(SRC)/StartupItems/SecurityServer >$(DST)/SecurityServer
	cp $(SRC)/StartupItems/Localizable.strings $(DST)/Resources/English.lproj/Localizable.strings
	chown -R root.wheel $(DST)
	chmod 755 $(DST)/SecurityServer
	chmod 644 $(DST)/StartupParameters.plist
	chmod 644 $(DST)/Resources/English.lproj/Localizable.strings
	chmod 4711 $(DSTROOT)/$(SYSTEM_CORE_SERVICES_DIR)/AuthorizationTrampoline
	mkdir -p $(AUTHORIZATION_LOCATION)
	cp $(SRC)/Authorization/authorization.plist $(AUTHORIZATION_PLIST)
	chown root.admin $(AUTHORIZATION_PLIST)
	chmod 640 $(AUTHORIZATION_PLIST)

installhdrs:
	@echo null installhdrs.

installsrc:
	@echo null installsrc.

clean:
	@echo null clean.
