1##
2# Makefile for uucp
3## 
4
5# Project info
6Project           = uucp
7UserType          = Developer
8ToolType          = Commands
9GnuNoChown=YES
10GnuAfterInstall     = post-install install-plist
11Extra_Configure_Flags= --with-newconfigdir=/usr/share/uucp --with-user=_uucp
12
13# It's a GNU Source project
14include $(MAKEFILEPATH)/CoreOS/ReleaseControl/GNUSource.make
15
16DIRS=$(DSTROOT)/usr/share/uucp $(DSTROOT)/private/var/log/uucp $(DSTROOT)/private/var/spool/uucp
17
18post-install:
19	$(MKDIR) $(DIRS)
20	$(INSTALL_FILE) $(SRCROOT)/configs/passwd  $(DSTROOT)/usr/share/uucp
21	$(INSTALL_FILE) $(SRCROOT)/configs/port    $(DSTROOT)/usr/share/uucp
22	$(INSTALL_FILE) $(SRCROOT)/configs/sys     $(DSTROOT)/usr/share/uucp
23	$(CHOWN) _uucp $(DIRS)
24
25OSV     = $(DSTROOT)/usr/local/OpenSourceVersions
26OSL     = $(DSTROOT)/usr/local/OpenSourceLicenses
27
28install-plist:
29	$(MKDIR) $(DSTROOT)/System/Library/LaunchDaemons
30	$(INSTALL_FILE) $(SRCROOT)/com.apple.uucp.plist $(DSTROOT)/System/Library/LaunchDaemons
31	$(MKDIR) $(OSV)
32	$(INSTALL_FILE) $(SRCROOT)/uucp.plist $(OSV)/uucp.plist
33	$(MKDIR) $(OSL)
34	$(INSTALL_FILE) $(Sources)/COPYING $(OSL)/uucp.txt
35	# there isn't a configuure option to not setuid a bunch of stuff, so we let it do that and then we "fix it"
36	chmod -R ug-s $(DSTROOT)/usr/*bin
37
38
39# Automatic Extract & Patch
40AEP            = YES
41AEP_Project    = $(Project)
42AEP_Version    = 1.07
43AEP_ProjVers   = $(AEP_Project)-$(AEP_Version)
44AEP_Filename   = $(AEP_ProjVers).tar.gz
45AEP_ExtractDir = $(AEP_ProjVers)
46AEP_Patches    = PR-3996371-conf.diff \
47	         PR-4883535.patch \
48		 PR-4383204.patch \
49		 PR-4905054.manpages.patch
50
51AEP_SubDir     = uucp
52AEP_TarDir     := $(shell pwd)
53
54ifeq ($(suffix $(AEP_Filename)),.bz2)
55AEP_ExtractOption = j
56else
57AEP_ExtractOption = z
58endif
59
60
61# Extract the source.
62install_source::
63ifeq ($(AEP),YES)
64	$(TAR) -C $(SRCROOT) -$(AEP_ExtractOption)xf $(AEP_TarDir)/$(AEP_Filename)
65	-$(RMDIR) $(SRCROOT)/$(Project)
66	$(MV) $(SRCROOT)/$(AEP_ExtractDir) $(SRCROOT)/$(Project)
67	ls $(SRCROOT)/$(Project)
68	for patchfile in $(AEP_Patches); do \
69	    cd $(SRCROOT)/$(Project) && patch -p0 < $(AEP_TarDir)/patches/$$patchfile; \
70	done
71	for newfile in $(shell find $(AEP_TarDir)/new -maxdepth 1 -type f); do \
72	    echo copying $$newfile; \
73	    cp -v $$newfile $(SRCROOT)/$(Project)/; \
74	done
75endif
76
77install::
78	chgrp -R wheel $(DSTROOT)
79	rm $(DSTROOT)/usr/share/info/dir
80