-
Notifications
You must be signed in to change notification settings - Fork 3
/
luggage.make
621 lines (491 loc) · 20.5 KB
/
luggage.make
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
#
# Copyright 2009 Joe Block <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
STAMP:=`date +%Y%m%d`
YY:=`date +%Y`
MM:=`date +%m`
DD:=`date +%d`
BUILD_DATE=`date -u "+%Y-%m-%dT%H:%M:%SZ"`
# mai plist haz a flavor
PLIST_FLAVOR=plist
PACKAGE_PLIST=.package.plist
PACKAGE_TARGET_OS=10.4
PLIST_TEMPLATE=prototype.plist
TITLE=CHANGE_ME
REVERSE_DOMAIN=com.replaceme
PACKAGE_ID=${REVERSE_DOMAIN}.${TITLE}
# Set PACKAGE_VERSION in your Makefile if you don't want version set to
# today's date
PACKAGE_VERSION=${STAMP}
PACKAGE_MAJOR_VERSION=${YY}
PACKAGE_MINOR_VERSION=${MM}${DD}
# Set PACKAGE_NAME in your Makefile if you don't want it to be TITLE-PACKAGEVERSION.
PACKAGE_NAME=${TITLE}-${PACKAGE_VERSION}
PACKAGE_FILE=${PACKAGE_NAME}.pkg
DMG_NAME=${PACKAGE_NAME}.dmg
ZIP_NAME=${PACKAGE_FILE}.zip
# Only use Apple tools for file manipulation, or deal with a world of pain
# when your resource forks get munched. This is particularly important on
# 10.6 since it stores compressed binaries in the resource fork.
TAR=/usr/bin/tar
CP=/bin/cp
INSTALL=/usr/bin/install
DITTO=/usr/bin/ditto
PACKAGEMAKER=/Developer/usr/bin/packagemaker
# Must be on an HFS+ filesystem. Yes, I know some network servers will do
# their best to preserve the resource forks, but it isn't worth the aggravation
# to fight with them.
LUGGAGE_TMP=/tmp/the_luggage
SCRATCH_D=${LUGGAGE_TMP}/${PACKAGE_NAME}
SCRIPT_D=${SCRATCH_D}/scripts
RESOURCE_D=${SCRATCH_D}/resources
WORK_D=${SCRATCH_D}/root
PAYLOAD_D=${SCRATCH_D}/payload
# packagemaker parameters
#
# packagemaker will helpfully apply the permissions it finds on the system
# if one of the files in the payload exists on the disk, rather than the ones
# you've carefully set up in the package root, so I turn that crap off with
# --no-recommend. You can disable this by overriding PM_EXTRA_ARGS in your
# package's Makefile.
PM_EXTRA_ARGS=--verbose --no-recommend
# Override if you want to require a restart after installing your package.
PM_RESTART=None
PAYLOAD=
# hdiutil parameters
#
# hdiutil will create a compressed disk image with the UDZO and UDBZ formats,
# or a bland, uncompressed, read-only image with UDRO. Wouldn't you rather
# trade a little processing time for some disk savings now that you can make
# packages and images with reckless abandon?
#
# The UDZO format is selected as the default here for compatibility, but you
# can override it to achieve higher compression. If you want to switch away
# from UDZO, it is probably best to override DMG_FORMAT in your makefile.
#
# Format notes:
# The UDRO format is an uncompressed, read-only disk image that is compatible
# with Mac OS X 10.0 and later.
# The UDZO format is gzip-based, defaults to gzip level 1, and is compatible
# with Mac OS X 10.2 and later.
# The UDBZ format is bzip2-based and is compatible with Mac OS X 10.4 and later.
DMG_FORMAT_CODE=UDZO
ZLIB_LEVEL=9
DMG_FORMAT_OPTION=-imagekey zlib-level=${ZLIB_LEVEL}
DMG_FORMAT=${DMG_FORMAT_CODE} ${DMG_FORMAT_OPTION}
# Set .PHONY declarations so things don't break if someone has files in
# their workdir with the same names as our special stanzas
.PHONY: clean
.PHONY: debug
.PHONY: dmg
.PHONY: grind_package
.PHONY: local_pkg
.PHONY: package_root
.PHONY: payload_d
.PHONY: pkg
.PHONY: scratchdir
.PHONY: superclean
# Convenience variables
USER_TEMPLATE=${WORK_D}/System/Library/User\ Template
USER_TEMPLATE_PREFERENCES=${USER_TEMPLATE}/English.lproj/Library/Preferences
USER_TEMPLATE_PICTURES=${USER_TEMPLATE}/English.lproj/Pictures
# target stanzas
help:
@-echo
@-echo "make clean - clean up work files."
@-echo "make dmg - roll a pkg, then stuff it into a dmg file."
@-echo "make zip - roll a pkg, then stuff it into a zip file."
@-echo "make pkg - roll a pkg."
@-echo
# set up some work directories
payload_d:
@sudo mkdir -p ${PAYLOAD_D}
package_root:
@sudo mkdir -p ${WORK_D}
# packagemaker chokes if the pkg doesn't contain any payload, making script-only
# packages fail to build mysteriously if you don't remember to include something
# in it, so we're including the /usr/local directory, since it's harmless.
scriptdir: l_usr_local
@sudo mkdir -p ${SCRIPT_D}
resourcedir:
@sudo mkdir -p ${RESOURCE_D}
scratchdir:
@sudo mkdir -p ${SCRATCH_D}
# user targets
clean:
@sudo rm -fr ${SCRATCH_D} .luggage.pkg.plist ${PACKAGE_PLIST}
superclean:
@sudo rm -fr ${LUGGAGE_TMP}
dmg: scratchdir compile_package
@echo "Wrapping ${PACKAGE_NAME}..."
@sudo hdiutil create -volname ${PACKAGE_NAME} \
-srcfolder ${PAYLOAD_D} \
-uid 99 -gid 99 \
-ov \
-format ${DMG_FORMAT} \
${DMG_NAME}
zip: scratchdir compile_package
@echo "Zipping ${PACKAGE_NAME}..."
@${DITTO} -c -k \
--noqtn --noacl \
--sequesterRsrc \
${PAYLOAD_D} \
${ZIP_NAME}
modify_packageroot:
@echo "If you need to override permissions or ownerships, override modify_packageroot in your Makefile"
prep_pkg:
@make clean
@make payload
@make compile_package
pkg: prep_pkg
@make local_pkg
pkgls: prep_pkg
@echo
@echo
lsbom -p fmUG ${PAYLOAD_D}/${PACKAGE_FILE}/Contents/Archive.bom
#
payload: payload_d package_root scratchdir scriptdir resourcedir
make ${PAYLOAD}
@-echo
compile_package: payload .luggage.pkg.plist
@make modify_packageroot
@-sudo rm -fr ${PAYLOAD_D}/${PACKAGE_FILE}
@echo "Creating ${PAYLOAD_D}/${PACKAGE_FILE}"
sudo ${PACKAGEMAKER} --root ${WORK_D} \
--id ${PACKAGE_ID} \
--filter DS_Store \
--target ${PACKAGE_TARGET_OS} \
--title ${TITLE} \
--info ${SCRATCH_D}/luggage.pkg.plist \
--scripts ${SCRIPT_D} \
--resources ${RESOURCE_D} \
--version ${PACKAGE_VERSION} \
${PM_EXTRA_ARGS} --out ${PAYLOAD_D}/${PACKAGE_FILE}
${PACKAGE_PLIST}: /usr/local/share/luggage/prototype.plist
# override this stanza if you have a different plist you want to use as
# a custom local template.
@cat /usr/local/share/luggage/prototype.plist > ${PACKAGE_PLIST}
.luggage.pkg.plist: ${PACKAGE_PLIST}
@cat ${PACKAGE_PLIST} | \
sed "s/{DD}/${DD}/g" | \
sed "s/{MM}/${MM}/g" | \
sed "s/{YY}/${YY}/g" | \
sed "s/{PACKAGE_MAJOR_VERSION}/${PACKAGE_MAJOR_VERSION}/g" | \
sed "s/{PACKAGE_MINOR_VERSION}/${PACKAGE_MINOR_VERSION}/g" | \
sed "s/{BUILD_DATE}/${BUILD_DATE}/g" | \
sed "s/{PACKAGE_ID}/${PACKAGE_ID}/g" | \
sed "s/{PACKAGE_VERSION}/${PACKAGE_VERSION}/g" | \
sed "s/{PM_RESTART}/${PM_RESTART}/g" | \
sed "s/{PLIST_FLAVOR}/${PLIST_FLAVOR}/g" \
> .luggage.pkg.plist
@sudo ${CP} .luggage.pkg.plist ${SCRATCH_D}/luggage.pkg.plist
@rm .luggage.pkg.plist ${PACKAGE_PLIST}
local_pkg:
@${CP} -R ${PAYLOAD_D}/${PACKAGE_FILE} .
# Target directory rules
l_root: package_root
@sudo mkdir -p ${WORK_D}
@sudo chmod 755 ${WORK_D}
@sudo chown root:admin ${WORK_D}
l_etc: l_root
@sudo mkdir -p ${WORK_D}/etc
@sudo chown -R root:wheel ${WORK_D}/etc
@sudo chmod -R 755 ${WORK_D}/etc
l_etc_hooks: l_etc
@sudo mkdir -p ${WORK_D}/etc/hooks
@sudo chown -R root:wheel ${WORK_D}/etc/hooks
@sudo chmod -R 755 ${WORK_D}/etc/hooks
l_etc_openldap: l_etc
@sudo mkdir -p ${WORK_D}/etc/openldap
@sudo chmod 755 ${WORK_D}/etc/openldap
@sudo chown root:wheel ${WORK_D}/etc/openldap
l_usr: l_root
@sudo mkdir -p ${WORK_D}/usr
@sudo chown -R root:wheel ${WORK_D}/usr
@sudo chmod -R 755 ${WORK_D}/usr
l_usr_bin: l_usr
@sudo mkdir -p ${WORK_D}/usr/bin
@sudo chown -R root:wheel ${WORK_D}/usr/bin
@sudo chmod -R 755 ${WORK_D}/usr/bin
l_usr_lib: l_usr
@sudo mkdir -p ${WORK_D}/usr/lib
@sudo chown -R root:wheel ${WORK_D}/usr/lib
@sudo chmod -R 755 ${WORK_D}/usr/lib
l_usr_local: l_usr
@sudo mkdir -p ${WORK_D}/usr/local
@sudo chown -R root:wheel ${WORK_D}/usr/local
@sudo chmod -R 755 ${WORK_D}/usr/local
l_usr_local_bin: l_usr_local
@sudo mkdir -p ${WORK_D}/usr/local/bin
@sudo chown -R root:wheel ${WORK_D}/usr/local/bin
@sudo chmod -R 755 ${WORK_D}/usr/local/bin
l_usr_local_lib: l_usr_local
@sudo mkdir -p ${WORK_D}/usr/local/lib
@sudo chown -R root:wheel ${WORK_D}/usr/local/lib
@sudo chmod -R 755 ${WORK_D}/usr/local/lib
l_usr_local_man: l_usr_local
@sudo mkdir -p ${WORK_D}/usr/local/man
@sudo chown -R root:wheel ${WORK_D}/usr/local/man
@sudo chmod -R 755 ${WORK_D}/usr/local/man
l_usr_local_sbin: l_usr_local
@sudo mkdir -p ${WORK_D}/usr/local/sbin
@sudo chown -R root:wheel ${WORK_D}/usr/local/sbin
@sudo chmod -R 755 ${WORK_D}/usr/local/sbin
l_usr_local_share: l_usr_local
@sudo mkdir -p ${WORK_D}/usr/local/share
@sudo chown -R root:wheel ${WORK_D}/usr/local/share
@sudo chmod -R 755 ${WORK_D}/usr/local/share
l_usr_man: l_usr_share
@sudo mkdir -p ${WORK_D}/usr/share/man
@sudo chown -R root:wheel ${WORK_D}/usr/share/man
@sudo chmod -R 0755 ${WORK_D}/usr/share/man
l_usr_man_man1: l_usr_man
@sudo mkdir -p ${WORK_D}/usr/share/man/man1
@sudo chown -R root:wheel ${WORK_D}/usr/share/man/man1
@sudo chmod -R 0755 ${WORK_D}/usr/share/man/man1
l_usr_man_man2: l_usr_man
@sudo mkdir -p ${WORK_D}/usr/share/man/man2
@sudo chown -R root:wheel ${WORK_D}/usr/share/man/man2
@sudo chmod -R 0755 ${WORK_D}/usr/share/man/man2
l_usr_man_man3: l_usr_man
@sudo mkdir -p ${WORK_D}/usr/share/man/man3
@sudo chown -R root:wheel ${WORK_D}/usr/share/man/man3
@sudo chmod -R 0755 ${WORK_D}/usr/share/man/man3
l_usr_man_man4: l_usr_man
@sudo mkdir -p ${WORK_D}/usr/share/man/man4
@sudo chown -R root:wheel ${WORK_D}/usr/share/man/man4
@sudo chmod -R 0755 ${WORK_D}/usr/share/man/man4
l_usr_man_man5: l_usr_man
@sudo mkdir -p ${WORK_D}/usr/share/man/man5
@sudo chown -R root:wheel ${WORK_D}/usr/share/man/man5
@sudo chmod -R 0755 ${WORK_D}/usr/share/man/man5
l_usr_man_man6: l_usr_man
@sudo mkdir -p ${WORK_D}/usr/share/man/man6
@sudo chown -R root:wheel ${WORK_D}/usr/share/man/man6
@sudo chmod -R 0755 ${WORK_D}/usr/share/man/man6
l_usr_man_man7: l_usr_man
@sudo mkdir -p ${WORK_D}/usr/share/man/man7
@sudo chown -R root:wheel ${WORK_D}/usr/share/man/man7
@sudo chmod -R 0755 ${WORK_D}/usr/share/man/man7
l_usr_man_man8: l_usr_man
@sudo mkdir -p ${WORK_D}/usr/share/man/man8
@sudo chown -R root:wheel ${WORK_D}/usr/share/man/man8
@sudo chmod -R 0755 ${WORK_D}/usr/share/man/man8
l_usr_sbin: l_usr
@sudo mkdir -p ${WORK_D}/usr/sbin
@sudo chown -R root:wheel ${WORK_D}/usr/sbin
@sudo chmod -R 755 ${WORK_D}/usr/sbin
l_usr_share: l_usr
@sudo mkdir -p ${WORK_D}/usr/share
@sudo chown -R root:wheel ${WORK_D}/usr/share
@sudo chmod -R 755 ${WORK_D}/usr/share
l_var: l_root
@sudo mkdir -p ${WORK_D}/var
@sudo chown -R root:wheel ${WORK_D}/var
@sudo chmod -R 755 ${WORK_D}/var
l_var_db: l_var
@sudo mkdir -p ${WORK_D}/var/db
@sudo chown -R root:wheel ${WORK_D}/var/db
@sudo chmod -R 755 ${WORK_D}/var/db
l_var_root: l_var
@sudo mkdir -p ${WORK_D}/var/root
@sudo chown -R root:wheel ${WORK_D}/var/root
@sudo chmod -R 750 ${WORK_D}/var/root
l_Applications: l_root
@sudo mkdir -p ${WORK_D}/Applications
@sudo chown root:admin ${WORK_D}/Applications
@sudo chmod 775 ${WORK_D}/Applications
l_Applications_Utilities: l_root
@sudo mkdir -p ${WORK_D}/Applications/Utilities
@sudo chown root:admin ${WORK_D}/Applications/Utilities
@sudo chmod 755 ${WORK_D}/Applications/Utilities
l_Library: l_root
@sudo mkdir -p ${WORK_D}/Library
@sudo chown root:admin ${WORK_D}/Library
@sudo chmod 1775 ${WORK_D}/Library
l_Library_Application_Support: l_Library
@sudo mkdir -p ${WORK_D}/Library/Application\ Support
@sudo chown root:admin ${WORK_D}/Library/Application\ Support
@sudo chmod 775 ${WORK_D}/Library/Application\ Support
l_Library_Application_Support_Adobe: l_Library
@sudo mkdir -p ${WORK_D}/Library/Application\ Support/Adobe
@sudo chown root:admin ${WORK_D}/Library/Application\ Support/Adobe
@sudo chmod 775 ${WORK_D}/Library/Application\ Support/Adobe
l_Library_Desktop_Pictures: l_Library
@sudo mkdir -p ${WORK_D}/Library/Desktop\ Pictures
@sudo chown root:admin ${WORK_D}/Library/Desktop\ Pictures
@sudo chmod 775 ${WORK_D}/Library/Desktop\ Pictures
l_Library_Fonts: l_Library
@sudo mkdir -p ${WORK_D}/Library/Fonts
@sudo chown root:admin ${WORK_D}/Library/Fonts
@sudo chmod 775 ${WORK_D}/Library/Fonts
l_Library_LaunchAgents: l_Library
@sudo mkdir -p ${WORK_D}/Library/LaunchAgents
@sudo chown root:wheel ${WORK_D}/Library/LaunchAgents
@sudo chmod 755 ${WORK_D}/Library/LaunchAgents
l_Library_LaunchDaemons: l_Library
@sudo mkdir -p ${WORK_D}/Library/LaunchDaemons
@sudo chown root:wheel ${WORK_D}/Library/LaunchDaemons
@sudo chmod 755 ${WORK_D}/Library/LaunchDaemons
l_Library_Preferences: l_Library
@sudo mkdir -p ${WORK_D}/Library/Preferences
@sudo chown root:admin ${WORK_D}/Library/Preferences
@sudo chmod 775 ${WORK_D}/Library/Preferences
l_Library_Preferences_DirectoryService: l_Library_Preferences
@sudo mkdir -p ${WORK_D}/Library/Preferences/DirectoryService
@sudo chown root:admin ${WORK_D}/Library/Preferences/DirectoryService
@sudo chmod 775 ${WORK_D}/Library/Preferences/DirectoryService
l_Library_Printers: l_Library
@sudo mkdir -p ${WORK_D}/Library/Printers
@sudo chown root:admin ${WORK_D}/Library/Printers
@sudo chmod 775 ${WORK_D}/Library/Printers
l_Library_Printers_PPDs: l_Library_Printers
@sudo mkdir -p ${WORK_D}/Library/Printers/PPDs/Contents/Resources
@sudo chown root:admin ${WORK_D}/Library/Printers/PPDs
@sudo chmod 775 ${WORK_D}/Library/Printers/PPDs
l_PPDs: l_Library_Printers_PPDs
l_Library_Receipts: l_Library
@sudo mkdir -p ${WORK_D}/Library/Receipts
@sudo chown root:admin ${WORK_D}/Library/Receipts
@sudo chmod 775 ${WORK_D}/Library/Receipts
l_Library_User_Pictures: l_Library
@sudo mkdir -p ${WORK_D}/Library/User\ Pictures
@sudo chown root:admin ${WORK_D}/Library/User\ Pictures
@sudo chmod 775 ${WORK_D}/Library/User\ Pictures
l_Library_CorpSupport: l_Library
@sudo mkdir -p ${WORK_D}/Library/CorpSupport
@sudo chown root:admin ${WORK_D}/Library/CorpSupport
@sudo chmod 775 ${WORK_D}/Library/CorpSupport
l_Library_Python: l_Library
@sudo mkdir -p ${WORK_D}/Library/Python
@sudo chown root:admin ${WORK_D}/Library/Python
@sudo chmod 775 ${WORK_D}/Library/Python
l_Library_Python_26: l_Library_Python
@sudo mkdir -p ${WORK_D}/Library/Python/2.6
@sudo chown root:admin ${WORK_D}/Library/Python/2.6
@sudo chmod 775 ${WORK_D}/Library/Python/2.6
l_Library_Python_26_site_packages: l_Library_Python_26
@sudo mkdir -p ${WORK_D}/Library/Python/2.6/site-packages
@sudo chown root:admin ${WORK_D}/Library/Python/2.6/site-packages
@sudo chmod 775 ${WORK_D}/Library/Python/2.6/site-packages
l_Library_Ruby: l_Library
@sudo mkdir -p ${WORK_D}/Library/Ruby
@sudo chown root:admin ${WORK_D}/Library/Ruby
@sudo chmod 775 ${WORK_D}/Library/Ruby
l_Library_Ruby_Site: l_Library_Ruby
@sudo mkdir -p ${WORK_D}/Library/Ruby/Site
@sudo chown root:admin ${WORK_D}/Library/Ruby/Site
@sudo chmod 775 ${WORK_D}/Library/Ruby/Site
l_Library_Ruby_Site_1_8: l_Library_Ruby_Site
@sudo mkdir -p ${WORK_D}/Library/Ruby/Site/1.8
@sudo chown root:admin ${WORK_D}/Library/Ruby/Site/1.8
@sudo chmod 775 ${WORK_D}/Library/Ruby/Site/1.8
l_System: l_root
@sudo mkdir -p ${WORK_D}/System
@sudo chown -R root:wheel ${WORK_D}/System
@sudo chmod -R 755 ${WORK_D}/System
l_System_Library: l_System
@sudo mkdir -p ${WORK_D}/System/Library
@sudo chown -R root:wheel ${WORK_D}/System/Library
@sudo chmod -R 755 ${WORK_D}/System/Library
l_System_Library_User_Template: l_System_Library
@sudo mkdir -p ${WORK_D}/System/Library/User\ Template/English.lproj
@sudo chown -R root:wheel ${WORK_D}/System/Library/User\ Template/English.lproj
@sudo chmod 700 ${WORK_D}/System/Library/User\ Template
@sudo chmod -R 755 ${WORK_D}/System/Library/User\ Template/English.lproj
l_System_Library_User_Template_Library: l_System_Library_User_Template
@sudo mkdir -p ${WORK_D}/System/Library/User\ Template/English.lproj/Library
@sudo chown root:wheel ${WORK_D}/System/Library/User\ Template/English.lproj/Library
@sudo chmod 700 ${WORK_D}/System/Library/User\ Template/English.lproj/Library
l_System_Library_User_Template_Pictures: l_System_Library_User_Template
@sudo mkdir -p ${WORK_D}/System/Library/User\ Template/English.lproj/Pictures
@sudo chown root:wheel ${WORK_D}/System/Library/User\ Template/English.lproj/Pictures
@sudo chmod 700 ${WORK_D}/System/Library/User\ Template/English.lproj/Pictures
l_System_Library_User_Template_Preferences: l_System_Library_User_Template_Library
@sudo mkdir -p ${USER_TEMPLATE_PREFERENCES}
@sudo chown root:wheel ${USER_TEMPLATE_PREFERENCES}
@sudo chmod -R 700 ${USER_TEMPLATE_PREFERENCES}
# file packaging rules
pack-directory-service-preference-%: % l_Library_Preferences_DirectoryService
sudo install -m 600 -o root -g admin $< ${WORK_D}/Library/Preferences/DirectoryService
pack-site-python-%: % l_Library_Python_26_site_packages
@sudo ${INSTALL} -m 644 -g admin -o root $< ${WORK_D}/Library/Python/2.6/site-packages
pack-siteruby-%: % l_Library_Ruby_Site_1_8
@sudo ${INSTALL} -m 644 -g wheel -o root $< ${WORK_D}/Library/Ruby/Site/1.8
pack-Library-Fonts-%: % l_Library_Fonts
@sudo ${INSTALL} -m 664 -g admin -o root $< ${WORK_D}/Library/Fonts
pack-Library-LaunchAgents-%: % l_Library_LaunchAgents
@sudo ${INSTALL} -m 644 -g wheel -o root $< ${WORK_D}/Library/LaunchAgents
pack-Library-LaunchDaemons-%: % l_Library_LaunchDaemons
@sudo ${INSTALL} -m 644 -g wheel -o root $< ${WORK_D}/Library/LaunchDaemons
pack-Library-Preferences-%: % l_Library_Preferences
@sudo ${INSTALL} -m 644 -g admin -o root $< ${WORK_D}/Library/Preferences
pack-ppd-%: % l_PPDs
@sudo ${INSTALL} -m 664 -g admin -o root $< ${WORK_D}/Library/Printers/PPDs/Contents/Resources
pack-script-%: % scriptdir
@sudo ${INSTALL} -m 755 $< ${SCRIPT_D}
pack-resource-%: % resourcedir
@sudo ${INSTALL} -m 755 $< ${RESOURCE_D}
pack-user-template-plist-%: % l_System_Library_User_Template_Preferences
@sudo ${INSTALL} -m 644 $< ${USER_TEMPLATE_PREFERENCES}
pack-user-picture-%: % l_Library_Desktop_Pictures
@sudo ${INSTALL} -m 644 $< ${WORK_D}/Library/Desktop\ Pictures
# posixy file stanzas
pack-etc-%: % l_etc
@sudo ${INSTALL} -m 644 -g wheel -o root $< ${WORK_D}/etc
pack-usr-bin-%: % l_usr_bin
@sudo ${INSTALL} -m 755 -g wheel -o root $< ${WORK_D}/usr/bin
pack-usr-sbin-%: % l_usr_sbin
@sudo ${INSTALL} -m 755 -g wheel -o root $< ${WORK_D}/usr/sbin
pack-usr-local-bin-%: % l_usr_local_bin
@sudo ${INSTALL} -m 755 -g wheel -o root $< ${WORK_D}/usr/local/bin
pack-usr-local-sbin-%: % l_usr_local_sbin
@sudo ${INSTALL} -m 755 -g wheel -o root $< ${WORK_D}/usr/local/sbin
pack-man-%: l_usr_man
@sudo ${INSTALL} -m 0644 -g wheel -o root $< ${WORK_D}/usr/share/man
pack-man1-%: l_usr_man_man1
@sudo ${INSTALL} -m 0644 -g wheel -o root $< ${WORK_D}/usr/share/man/man8
pack-man2-%: l_usr_man_man2
@sudo ${INSTALL} -m 0644 -g wheel -o root $< ${WORK_D}/usr/share/man/man8
pack-man3-%: l_usr_man_man3
@sudo ${INSTALL} -m 0644 -g wheel -o root $< ${WORK_D}/usr/share/man/man8
pack-man4-%: l_usr_man_man4
@sudo ${INSTALL} -m 0644 -g wheel -o root $< ${WORK_D}/usr/share/man/man8
pack-man5-%: l_usr_man_man5
@sudo ${INSTALL} -m 0644 -g wheel -o root $< ${WORK_D}/usr/share/man/man8
pack-man6-%: l_usr_man_man6
@sudo ${INSTALL} -m 0644 -g wheel -o root $< ${WORK_D}/usr/share/man/man8
pack-man7-%: l_usr_man_man7
@sudo ${INSTALL} -m 0644 -g wheel -o root $< ${WORK_D}/usr/share/man/man8
pack-man8-%: l_usr_man_man8
@sudo ${INSTALL} -m 0644 -g wheel -o root $< ${WORK_D}/usr/share/man/man8
pack-hookscript-%: % l_etc_hooks
@sudo ${INSTALL} -m 755 $< ${WORK_D}/etc/hooks
# Applications and Utilities
#
# We use ${TAR} because it respects resource forks. This is still
# critical - just when I thought I'd seen the last of the damn things, Apple
# decided to stash compressed binaries in them in 10.6.
unbz2-applications-%: %.tar.bz2 l_Applications
@sudo ${TAR} xjf $< -C ${WORK_D}/Applications
@sudo chown -R root:admin ${WORK_D}/Applications/$(shell echo $< | sed s/\.tar\.bz2//g)
unbz2-utilities-%: %.tar.bz2 l_Applications_Utilities
@sudo ${TAR} xjf $< -C ${WORK_D}/Applications/Utilities
@sudo chown -R root:admin ${WORK_D}/Applications/Utilities/$(shell echo $< | sed s/\.tar\.bz2//g)
ungz-applications-%: %.tar.gz l_Applications
@sudo ${TAR} xzf $< -C ${WORK_D}/Applications
@sudo chown -R root:admin ${WORK_D}/Applications/$(shell echo $< | sed s/\.tar\.gz//g)
ungz-utilities-%: %.tar.gz l_Applications_Utilities
@sudo ${TAR} xzf $< -C ${WORK_D}/Applications/Utilities
@sudo chown -R root:admin ${WORK_D}/Applications/Utilities/$(shell echo $< | sed s/\.tar\.gz//g)