Stop using chown in stage part-- upstream's Makefile is keen to ensure ownership

too early.
This commit is contained in:
Chris Rees 2014-01-01 20:46:35 +00:00
parent 8efc63188b
commit 139f9402a1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=338394
3 changed files with 47 additions and 18 deletions

View file

@ -40,7 +40,6 @@ RUN_DEPENDS+= \
# Ignore alpha/beta versions # Ignore alpha/beta versions
PORTSCOUT= limit:^[0-9]+(\.[0-9]+)*$$ PORTSCOUT= limit:^[0-9]+(\.[0-9]+)*$$
NEED_ROOT= yes
USERS= sympa USERS= sympa
GROUPS= sympa GROUPS= sympa
# Shebang is corrected by configure script # Shebang is corrected by configure script
@ -128,9 +127,24 @@ post-patch:
-e 's|^\( *bouncedir=\).*$$|\1${DATADIR}/bounce|' \ -e 's|^\( *bouncedir=\).*$$|\1${DATADIR}/bounce|' \
-e 's|^\( *execcgidir=\).*$$|\1${PREFIX}/libexec/${PORTNAME}|' \ -e 's|^\( *execcgidir=\).*$$|\1${PREFIX}/libexec/${PORTNAME}|' \
${WRKSRC}/configure ${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|\(--target.*sympa.conf\)|\1.sample|' \ ${REINPLACE_CMD} -e 's|\(--target.*sympa.conf\)|\1.sample|' \
-e 's|/bin/true$$|:|' \
${WRKSRC}/Makefile.in ${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's#\$$(DESTDIR)\$$(sampledir)#${STAGEDIR}\$$(sampledir)#g' \ @${REINPLACE_CMD} -e 's#\$$(DESTDIR)\$$(sampledir)#${STAGEDIR}\$$(sampledir)#g' \
${WRKSRC}/doc/sample/Makefile.in ${WRKSRC}/doc/sample/Makefile.in
pre-install:
${MKDIR} ${STAGEDIR}${ETCDIR}
post-install:
for dir in $$(sort ${WRKSRC}/createddirs); do \
${MKDIR} -m755 ${STAGEDIR}$$dir; \
${TOUCH} ${STAGEDIR}$$dir/.keep; \
${ECHO_CMD} "@exec chown ${USERS}:${GROUPS} $${dir#${PREFIX}/}" >> ${TMPPLIST}; \
${ECHO_CMD} "$${dir#${PREFIX}/}/.keep" >> ${TMPPLIST}; \
done; \
for dir in $$(sort -r ${WRKSRC}/createddirs); do \
${ECHO_CMD} "@unexec rmdir $$dir" >> ${TMPPLIST}; \
done
.include <bsd.port.mk> .include <bsd.port.mk>

View file

@ -0,0 +1,31 @@
Avoid chown before install, to avoid using root.
createddirs is read in Makefile and processed there
--- Makefile.in.orig 2013-02-05 14:57:30.000000000 +0000
+++ Makefile.in 2014-01-01 20:07:50.489335639 +0000
@@ -631,12 +631,9 @@
$(spooldir)/moderation $(spooldir)/expire $(spooldir)/auth \
$(spooldir)/outgoing $(spooldir)/tmp $(spooldir)/task \
$(bouncedir) $(arcdir) $(piddir) $(staticdir) $(sysconfdir); do \
- if [ ! -d $(DESTDIR)$$dir ] ; then \
- echo "Creating $(DESTDIR)$$dir"; \
- install -d -m 755 $(DESTDIR)$$dir; \
- fi; \
- chown $(USER) $(DESTDIR)$$dir || /bin/true; \
- chgrp $(GROUP) $(DESTDIR)$$dir || /bin/true; \
+ echo "$${dir}" >> createddirs; \
+ \
+ \
done
installconfig: installdir
@@ -668,8 +665,6 @@
echo "# automatically created file" >> data_structure.version; \
echo "# you should not modify it" >> data_structure.version; \
echo $(VERSION) >> data_structure.version; \
- chown $(USER) data_structure.version || /bin/true; \
- chgrp $(GROUP) data_structure.version || /bin/true; \
fi
nextstep:

View file

@ -561,8 +561,6 @@ man/man8/sympa.8.gz
%%NLS%%@dirrmtry share/locale/ca %%NLS%%@dirrmtry share/locale/ca
%%NLS%%@dirrmtry share/locale/bg/LC_MESSAGES %%NLS%%@dirrmtry share/locale/bg/LC_MESSAGES
%%NLS%%@dirrmtry share/locale/bg %%NLS%%@dirrmtry share/locale/bg
@dirrm %%DATADIR%%/list_data
@dirrmtry %%ETCDIR%%
@dirrm %%EXAMPLESDIR%%/web_tt2 @dirrm %%EXAMPLESDIR%%/web_tt2
@dirrm %%EXAMPLESDIR%%/scenari @dirrm %%EXAMPLESDIR%%/scenari
@dirrm %%EXAMPLESDIR%%/sample/test/web_tt2 @dirrm %%EXAMPLESDIR%%/sample/test/web_tt2
@ -588,17 +586,3 @@ man/man8/sympa.8.gz
@dirrm libexec/sympa/Marc @dirrm libexec/sympa/Marc
@dirrm libexec/sympa/HTML @dirrm libexec/sympa/HTML
@dirrm libexec/sympa @dirrm libexec/sympa
@dirrm %%DATADIR%%/arc
@dirrm %%DATADIR%%/bounce
@dirrm %%DATADIR%%/icons
@dirrm %%DATADIR%%
@cwd /var
@dirrm spool/sympa/tmp
@dirrm spool/sympa/task
@dirrm spool/sympa/outgoing
@dirrm spool/sympa/msg
@dirrm spool/sympa/moderation
@dirrm spool/sympa/expire
@dirrm spool/sympa/digest
@dirrm spool/sympa/auth
@dirrm spool/sympa