Bug 133412 - install trouble of security/openssh-portable with OPENSSH_OVERWRITE_BASE=1
Summary: install trouble of security/openssh-portable with OPENSSH_OVERWRITE_BASE=1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Munechika Sumikawa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-06 06:50 UTC by TsurutaniNaoki
Modified: 2009-04-22 07:10 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (481 bytes, patch)
2009-04-06 06:50 UTC, TsurutaniNaoki
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TsurutaniNaoki 2009-04-06 06:50:01 UTC
	installing security/openssh-portable from ports with "OPENSSH_OVERWRITE_BASE=1"
	makes error:
	===> Installing rc.d startup script(s)
	install: /usr/local/etc/rc.d/openssh: No such file or directory
	*** Error code 71
	
	Stop in /usr/ports/security/openssh-portable.
	*** Error code 1
	
	Stop in /usr/ports/security/openssh-portable.
	
	this is the first port i installed after installation of the OS.

Fix: openssh does not know about the path of startup script.
	here is a patch to security/openssh-portable:
How-To-Repeat: 	install security/openssh-portable with the above mentioned way.
Comment 1 Munechika Sumikawa freebsd_committer freebsd_triage 2009-04-10 11:00:20 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sumikawa

I'll handle this.
Comment 2 TsurutaniNaoki 2009-04-11 03:05:23 UTC
here is a new patch.
treatment of the "empty" directory is strange, especially when is exists.
there is no need to consider ${PREFIX} without WITH_OVERWRITE_BASE.
 ${LOCALBASE} can be changed by user, but ${PREFIX} is not. 

--- Makefile.orig	2009-03-25 02:41:44.000000000 +0900
+++ Makefile	2009-04-11 10:50:49.000000000 +0900
@@ -177,11 +177,14 @@
 PLIST_SUB+=		NOTBASE="@comment "
 PLIST_SUB+=		BASE=""
 PLIST_SUB+=		BASEPREFIX="${PREFIX}"
+PLIST_SUB+=		ERASEEMPTY="@comment "
 .else
 .if exists(/var/empty)
 EMPTYDIR=		/var/empty
+PLIST_SUB+=		ERASEEMPTY="@comment "
 .else
 EMPTYDIR=		${PREFIX}/empty
+PLIST_SUB+=		ERASEEMPTY=""
 .endif
 ETCSSH=			${PREFIX}/etc/ssh
 USE_RC_SUBR=		openssh
@@ -204,13 +207,8 @@
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|-ldes|-lcrypto|g' ${WRKSRC}/configure
-.if defined(WITH_OVERWRITE_BASE)
 	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${LOCALBASE}|' \
 		-e 's|%%RC_SCRIPT_NAME%%|${RC_SCRIPT_NAME}|' ${WRKSRC}/sshd.8
-.else
-	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \
-		-e 's|%%RC_SCRIPT_NAME%%|${RC_SCRIPT_NAME}|' ${WRKSRC}/sshd.8
-.endif
 	@${REINPLACE_CMD} -E -e 's|SSH_VERSION|TMP_SSH_VERSION|' \
 		-e 's|.*SSH_RELEASE.*||' ${WRKSRC}/version.h
 	@${ECHO_CMD} '#define FREEBSD_PORT_VERSION	" FreeBSD-${PKGNAME}"' >> \
@@ -225,11 +223,7 @@
 .endif
 
 pre-su-install:
-.if defined(WITH_OVERWRITE_BASE)
 	@${MKDIR} ${EMPTYDIR}
-.else
-	@${MKDIR} ${PREFIX}/empty
-.endif
 	if ! pw groupshow sshd; then pw groupadd sshd -g 22; fi
 	if ! pw usershow sshd; then pw useradd sshd -g sshd -u 22 \
 		-h - -d ${EMPTYDIR} -s /nonexistent -c "sshd privilege separation"; fi
@@ -249,6 +243,7 @@
 .if defined(WITH_OVERWRITE_BASE)
 	@${ECHO_CMD} "===> Installing rc.d startup script(s)"
 	@${ECHO_CMD} "@cwd ${LOCALBASE}" >> ${TMPPLIST}
+	@${MKDIR} ${LOCALBASE}/etc/rc.d
 	@${INSTALL_SCRIPT} ${WRKDIR}/openssh ${LOCALBASE}/etc/rc.d/${RC_SCRIPT_NAME}
 	@${ECHO_CMD} "etc/rc.d/${RC_SCRIPT_NAME}" >> ${TMPPLIST}
 	@${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
--- pkg-plist.orig	2006-10-06 04:30:58.000000000 +0900
+++ pkg-plist	2009-04-11 10:49:38.000000000 +0900
@@ -23,8 +23,7 @@
 share/Ssh.bin
 libexec/sftp-server
 libexec/ssh-keysign
-%%NOTBASE%%@exec mkdir -p %D/empty
-%%NOTBASE%%@dirrm empty
-%%BASE%%@exec if [ ! -d %%EMPTYDIR%% ]; then mkdir -p %%EMPTYDIR%% ; fi
+@exec if [ ! -d %%EMPTYDIR%% ]; then mkdir -p %%EMPTYDIR%% ; fi
+%%ERASEEMPTY%%@dirrm empty
 @exec if ! pw groupshow sshd 2>/dev/null; then pw groupadd sshd -g 22; fi
 @exec if ! pw usershow sshd 2>/dev/null; then pw useradd sshd -g sshd -u 22 -h - -d %%
EMPTYDIR%% -s /nonexistent -c "sshd privilege separation"; fi
Comment 3 dfilter service freebsd_committer freebsd_triage 2009-04-22 07:01:50 UTC
sumikawa    2009-04-22 06:01:40 UTC

  FreeBSD ports repository

  Modified files:
    security/openssh-portable Makefile pkg-plist 
  Log:
  Fix several problems with OPENSSH_OVERWRITE_BASE=1.
  - Empty dir handling
  - rc.d installation
  - prefix modification in manuals
  
  From:           Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
  PR:             ports/133412
  
  Revision  Changes    Path
  1.133     +4 -9      ports/security/openssh-portable/Makefile
  1.16      +2 -3      ports/security/openssh-portable/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Munechika Sumikawa freebsd_committer freebsd_triage 2009-04-22 07:02:00 UTC
State Changed
From-To: open->closed

Commited, thanks.