Bug 185300 - ftp/vsftpd stage conversion broken
Summary: ftp/vsftpd stage conversion broken
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: Dirk Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-30 16:50 UTC by Nikolai Lifanov
Modified: 2013-12-31 09:49 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolai Lifanov 2013-12-30 16:50:00 UTC
	The ftp/vsftpd port uses @exec, @unexec logic, which breaks packaging.

@exec mkdir -p %D/share/vsftpd/empty
@unexec if diff -q %D/etc/vsftpd.conf %D/etc/vsftpd.conf.dist; then rm %D/etc/vsftpd.conf; fi
etc/vsftpd.conf.dist
@exec if [ ! -f %B/vsftpd.conf ]; then cp %B/vsftpd.conf.dist %B/vsftpd.conf; fi
@exec if [ ! -d /var/ftp ]; then mkdir /var/ftp ; fi
@unexec rmdir /var/ftp 2>/dev/null || true
@dirrm share/vsftpd/empty
@dirrm share/vsftpd

Fix: 

Create these directories in STAGEDIR in the Makefile instead.
How-To-Repeat: 	With pkgng enabled:

	make -C /usr/ports/ftp/vsftpd package
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-30 16:50:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dinoex

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Dirk Meyer freebsd_committer freebsd_triage 2013-12-30 20:11:41 UTC
State Changed
From-To: open->feedback


I can not reproduce your problem. 
The package builds fine under FreeBSD 9.2
Comment 3 Nikolai Lifanov 2013-12-30 20:24:59 UTC
The failure is specific to pkgng. Try WITH_PKGNG=yes in make.conf.
All other options are left as defaults.


Staging error:

====>> Checking for staging violations... done
====>> Error: Filesystem touched during stage (files must install to
${STAGEDIR}):
etc/master.passwd:
        size (1584, 1636)
etc/passwd:
        size (1470, 1517)
extra: var/log/userlog
extra: var/mail/ftp
build of /usr/ports/ftp/vsftpd ended at Mon Dec 30 15:18:42 EST 2013
build time: 00:00:10
====>> Cleaning up
92amd64-default-test: removed


Packaging error:

root@92amd64-default-test:/usr/ports/ftp/vsftpd # make package
===>  Building package for vsftpd-ssl-3.0.2
pkg-static: PACKAGESITE in pkg.conf is deprecated. Please create a
repository configuration file
pkg-static: lstat(/wrkdirs/usr/ports/ftp/vsftpd/work/stage/var/ftp/): No
such file or directory
pkg-static:
lstat(/wrkdirs/usr/ports/ftp/vsftpd/work/stage/usr/local/share/vsftpd/empty/):
No such file or directory
pkg-static:
lstat(/wrkdirs/usr/ports/ftp/vsftpd/work/stage/usr/local/share/vsftpd/):
No such file or directory
*** [do-package] Error code 1

Stop in /usr/ports/ftp/vsftpd.


Thanks!

- Nikolai Lifanov
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-12-31 07:41:09 UTC
Author: dinoex
Date: Tue Dec 31 07:41:01 2013
New Revision: 338258
URL: http://svnweb.freebsd.org/changeset/ports/338258

Log:
  - remove user ftp on deinstall
  - remove deinstall/install scripts
  
  - create /var/ftp in stage
  PR:		185300

Deleted:
  head/ftp/vsftpd/pkg-deinstall
  head/ftp/vsftpd/pkg-install
Modified:
  head/ftp/vsftpd/Makefile
  head/ftp/vsftpd/pkg-plist

Modified: head/ftp/vsftpd/Makefile
==============================================================================
--- head/ftp/vsftpd/Makefile	Tue Dec 31 07:27:02 2013	(r338257)
+++ head/ftp/vsftpd/Makefile	Tue Dec 31 07:41:01 2013	(r338258)
@@ -56,7 +56,7 @@ VSFTPD_NO_SSP=	-e "s|-fstack-protector -
 .endif
 
 do-configure:
-.if !defined(WITHOUT_SSL) && ${PORT_OPTIONS:MVSFTPD_SSL}
+.if ${PORT_OPTIONS:MVSFTPD_SSL} && !defined(WITHOUT_SSL)
 	${REINPLACE_CMD} -e \
 		"s|#undef VSF_BUILD_TCPWRAPPERS|#define VSF_BUILD_TCPWRAPPERS 1|" \
 		-e "s|#undef VSF_BUILD_SSL|#define VSF_BUILD_SSL 1|" \
@@ -86,14 +86,12 @@ do-configure:
 	@${ECHO_CMD} >>${WRKSRC}/vsftpd.conf "# listen=YES"
 	@${ECHO_CMD} >>${WRKSRC}/vsftpd.conf "# background=YES"
 
-pre-install:
-	${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/vsftpd ${STAGEDIR}${PREFIX}/libexec/
 	${INSTALL_DATA} ${WRKSRC}/vsftpd.conf ${STAGEDIR}${PREFIX}/etc/vsftpd.conf.dist
 	${INSTALL_MAN} ${WRKSRC}/vsftpd.conf.5 ${STAGEDIR}${MANPREFIX}/man/man5/
 	${INSTALL_MAN} ${WRKSRC}/vsftpd.8 ${STAGEDIR}${MANPREFIX}/man/man8/
+	${MKDIR} ${STAGEDIR}/var/ftp
 .if ${PORT_OPTIONS:MDOCS}
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} -m 644 ${DOCFILES:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}/

Modified: head/ftp/vsftpd/pkg-plist
==============================================================================
--- head/ftp/vsftpd/pkg-plist	Tue Dec 31 07:27:02 2013	(r338257)
+++ head/ftp/vsftpd/pkg-plist	Tue Dec 31 07:41:01 2013	(r338258)
@@ -1,12 +1,14 @@
 libexec/vsftpd
 man/man5/vsftpd.conf.5.gz
 man/man8/vsftpd.8.gz
-@exec mkdir -p %D/share/vsftpd/empty
+@exec if ! pw usershow ftp 2>/dev/null; then pw useradd ftp -g operator -u 14 -h - -d /var/ftp -s /nonexistent -c "Anonymous Ftp"; fi
+@unexec if pw usershow ftp | grep -q 14:5; then pw userdel ftp; fi
 @unexec if diff -q %D/etc/vsftpd.conf %D/etc/vsftpd.conf.dist; then rm %D/etc/vsftpd.conf; fi
 etc/vsftpd.conf.dist
 @exec if [ ! -f %B/vsftpd.conf ]; then cp %B/vsftpd.conf.dist %B/vsftpd.conf; fi
-@exec if [ ! -d /var/ftp ]; then mkdir /var/ftp ; fi
 @unexec rmdir /var/ftp 2>/dev/null || true
+@exec if [ ! -d /var/ftp ]; then mkdir /var/ftp ; fi
+@exec mkdir -p %D/share/vsftpd/empty
 @dirrm share/vsftpd/empty
 @dirrm share/vsftpd
 %%PORTDOCS%%%%DOCSDIR%%/AUDIT
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Dirk Meyer freebsd_committer freebsd_triage 2013-12-31 09:48:46 UTC
State Changed
From-To: feedback->closed


a fix has beenn committed, please test.