1#
2# THESE PERMISSIONS ARE LARGELY IGNORED
3# CONTACT B&I IF YOU NEED TO CHANGE FINAL PERMISSIONS
4#
5# usertemplate makefile
6# 
7# RC builds must Respect the following target:
8#	install:
9#	installsrc:
10#	installhdrs:
11#	clean:
12#
13
14
15
16include $(MAKEFILEPATH)/pb_makefiles/platform.make 
17############################################
18# Variables
19#
20
21DESTINATION = "$(DSTROOT)$(SYSTEM_LIBRARY_DIR)/User Template"
22############################################
23
24install:
25
26	# Create the Destination
27	umask 0
28	mkdir -p $(DESTINATION)
29	chmod -R 700 $(DESTINATION)
30
31	# Install Files
32	ditto "$(SRCROOT)" $(DESTINATION)
33
34	# Correct Permissions
35	chown -R root:admin $(DESTINATION) # Set the Owner
36	chmod -R 755 $(DESTINATION) # Start with 755 
37	chmod 700 $(DESTINATION) # We need to set /Sytem/Library/User Template to 700
38
39	chmod 700 $(DESTINATION)"/English.lproj/Library" $(DESTINATION)"/Non_localized/Documents" $(DESTINATION)"/English.lproj/Library/Favorites" $(DESTINATION)"/English.lproj/Movies" $(DESTINATION)"/English.lproj/Music" $(DESTINATION)"/English.lproj/Pictures" $(DESTINATION)"/Non_localized/Library" $(DESTINATION)"/Non_localized/Library/Preferences" $(DESTINATION)"/English.lproj/Desktop" $(DESTINATION)"/Non_localized/Library/PreferencePanes" $(DESTINATION)"/Non_localized/Downloads" $(DESTINATION)"/Non_localized/Library/Logs" $(DESTINATION)"/Non_localized/Library/Caches"  $(DESTINATION)"/Non_localized/Library/Spelling" $(DESTINATION)"/Non_localized/Library/Colors" $(DESTINATION)"/Non_localized/Library/Services"
40
41	chmod -R 700 $(DESTINATION)"/English.lproj/Library/Preferences" $(DESTINATION)"/English.lproj/Library/Compositions" $(DESTINATION)"/English.lproj/Library/Keyboard Layouts" $(DESTINATION)"/English.lproj/Library/Input Methods" # Set Preferences to 700
42	
43	chmod 733 $(DESTINATION)"/English.lproj/Public/Drop Box" # Drop Box gets 733
44
45	chmod 600 $(DESTINATION)"/Non_localized/Library/Preferences/com.apple.scheduler.plist" $(DESTINATION)"/Non_localized/Library/Preferences/com.apple.screensaver.plist" $(DESTINATION)"/Non_localized/Library/Preferences/.GlobalPreferences.plist" $(DESTINATION)"/English.lproj/Library/Preferences/.GlobalPreferences.plist" $(DESTINATION)"/English.lproj/Library/Preferences/com.apple.symbolichotkeys.plist" $(DESTINATION)"/English.lproj/Library/Favorites/.localized"
46
47	chmod 644 $(DESTINATION)"/English.lproj/Library/FontCollections/Fixed Width.collection" $(DESTINATION)"/English.lproj/Library/FontCollections/Traditional.collection" $(DESTINATION)"/English.lproj/Library/FontCollections/Fun.collection" $(DESTINATION)"/English.lproj/Library/FontCollections/Modern.collection" $(DESTINATION)"/English.lproj/Library/FontCollections/PDF.collection" $(DESTINATION)"/English.lproj/Library/FontCollections/Web.collection" $(DESTINATION)"/English.lproj/.CFUserTextEncoding" $(DESTINATION)"/English.lproj/Public/.localized" $(DESTINATION)"/English.lproj/Public/Drop Box/.localized" $(DESTINATION)"/English.lproj/Library/.localized" $(DESTINATION)"/English.lproj/Desktop/.localized" $(DESTINATION)"/English.lproj/Movies/.localized" $(DESTINATION)"/English.lproj/Music/.localized" $(DESTINATION)"/English.lproj/Pictures/.localized" $(DESTINATION)"/English.lproj/Library/Compositions/.localized" $(DESTINATION)"/English.lproj/Library/Input Methods/.localized" $(DESTINATION)"/Non_localized/Documents/.localized" $(DESTINATION)"/Non_localized/Downloads/.localized"
48#$(DESTINATION)"/English.lproj/Documents/.localized" $(DESTINATION)"/English.lproj/Downloads/.localized" $(DESTINATION)"/English.lproj/Sites/.localized" 
49
50	#chmod 666 $(DESTINATION)"/English.lproj/Sites/images/gradient.jpg" 
51	#--03/10/11 Commented out due to <rdar://problem/9078413> remove Sites folder from default user template
52
53	#chmod 666 $(DESTINATION)"/English.lproj/Sites/index.html" $(DESTINATION)"/Non_localized/Sites/images/gradient.jpg"
54	#--03/10/11 Commented out due to <rdar://problem/9078413> remove Sites folder from default user template
55	
56	
57	chmod 700 $(DESTINATION) # We need to set /System/Library/User Template to 700
58	chown root:admin $(DESTINATION) # Set the Owner
59	echo "##################################"
60	ls -ald $(DESTINATION)
61	echo "##################################"
62
63	# Make the ~/Library folder hidden in Finder (<rdar://problem/7889093> ~/Library should be hidden in the Finder)
64	/usr/bin/SetFile -a "V" $(DESTINATION)"/Non_localized/Library"
65
66	rm $(DSTROOT)$(SYSTEM_LIBRARY_DIR)/User\ Template/makefile*
67
68installsrc:
69	ditto . $(SRCROOT)
70	rm -f $(SRCROOT)/CVSVersionInfo.txt
71	find $(SRCROOT) -name '.tmpfile' -a -exec rm -f '{}' \;
72	find $(SRCROOT) -name '.nfs*' -o -name '.svn' -a -exec echo '{}' \; -a -exec rm -rf '{}' \; -prune
73	# chown -R root:wheel $(SRCROOT)
74
75clean::
76
77installhdrs::
78