- Enable staging

- Update USES
- Use new options framework
- Always stage documentation
- Strip installed binaries
This commit is contained in:
Ganael LAPLANCHE 2013-12-06 12:25:48 +00:00
parent 5f1525f56c
commit ef55533242
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=335740
4 changed files with 61 additions and 46 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= vlock
PORTVERSION= 2.2.3
PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= http://cthulhu.c3d2.de/~toidinamai/vlock/archive/
@ -11,76 +12,52 @@ COMMENT= Locks a terminal
LICENSE= GPLv2
USE_GMAKE= yes
HAS_CONFIGURE= yes
CONFIGURE_ARGS= --enable-plugins --enable-pam \
--prefix=${PREFIX} \
--mandir=${MANPREFIX}/man \
--with-modules="${VLOCKMODULES}" \
--with-scripts="${VLOCKSCRIPTS}" \
VLOCK_GROUP="${VLOCKGRP}" \
VLOCK_MODE="0750" \
VLOCK_GROUP="nobody" \
EXTRA_CFLAGS="-I${LOCALBASE}/include" \
EXTRA_LDFLAGS="-L${LOCALBASE}/lib"
USES= gmake
USE_CSTD= gnu99
OPTIONS_DEFINE= ROOTPWD VLOCKSCRIPTS CACASAVER
OPTIONS_DEFAULT= ROOTPWD
OPTIONS_SUB= yes
ROOTPWD_DESC= Enable unlock using root password
ROOTPWD_CONFIGURE_ENABLE= root-password
VLOCKSCRIPTS_DESC= Install sample hook scripts
CACASAVER_DESC= Enable libcaca screensaver
MANLANG= ""
MAN1= vlock.1
MAN5= vlock-plugins.5
MAN8= vlock-main.8
CACASAVER_BUILD_DEPENDS= ${LOCALBASE}/lib/libcaca.a:${PORTSDIR}/graphics/libcaca
# Default scripts/modules
VLOCKSCRIPTS=
VLOCKMODULES= all.so new.so
NO_STAGE= yes
# Vlock group = vlock:*:129:
VLOCKGRP= vlock
VLOCKGID= 129
# Vlock special group
VLOCK_GRP= vlock
GROUPS= ${VLOCK_GRP}
PLIST_SUB+= VLOCK_GRP=${VLOCK_GRP} \
SHAREMODE=${SHAREMODE} \
SHAREGRP=${SHAREGRP}
PORTDOCS= ChangeLog PLUGINS README README.X11 SECURITY TODO
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MROOTPWD}
CONFIGURE_ARGS+= --enable-root-password
.else
CONFIGURE_ARGS+= --disable-root-password
.endif
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MVLOCKSCRIPTS}
VLOCKSCRIPTS+= amarok.sh example_script.sh mplayer.sh
PLIST_SUB+= PL_VLOCKSCRIPTS=""
.else
PLIST_SUB+= PL_VLOCKSCRIPTS="@comment "
.endif
.if ${PORT_OPTIONS:MCACASAVER}
BUILD_DEPENDS+= ${LOCALBASE}/lib/libcaca.a:${PORTSDIR}/graphics/libcaca
VLOCKMODULES+= caca.so
PLIST_SUB+= PL_CACASAVER=""
.else
PLIST_SUB+= PL_CACASAVER="@comment "
.endif
post-patch:
@${REINPLACE_CMD} -e 's|-lncurses|-lm|' ${WRKSRC}/modules/Makefile
pre-install:
if ! pw groupshow ${VLOCKGRP}; then pw groupadd ${VLOCKGRP} -g ${VLOCKGID}; fi
post-install:
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
.for doc in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
.endfor
.endif
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -0,0 +1,11 @@
--- Makefile.orig 2013-11-20 17:41:38.000000000 +0100
+++ Makefile 2013-11-20 17:43:12.000000000 +0100
@@ -59,7 +59,7 @@
$(MKDIR_P) -m 755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 755 -o root -g $(ROOT_GROUP) vlock $(DESTDIR)$(BINDIR)/vlock
$(MKDIR_P) -m 755 $(DESTDIR)$(PREFIX)/sbin
- $(INSTALL) -m 4711 -o root -g $(ROOT_GROUP) vlock-main $(DESTDIR)$(SBINDIR)/vlock-main
+ $(INSTALL) -s -m 4711 -o root -g $(ROOT_GROUP) vlock-main $(DESTDIR)$(SBINDIR)/vlock-main
.PHONY: install-plugins
install-plugins: install-modules install-scripts

View File

@ -0,0 +1,20 @@
--- modules/Makefile.orig 2013-11-20 17:39:23.000000000 +0100
+++ modules/Makefile 2013-11-20 17:40:03.000000000 +0100
@@ -15,7 +15,7 @@
#special build rules
-caca.so : override LDLIBS += -lcaca -lncurses
+caca.so : override LDLIBS += -lcaca -lm
all.o: all.c ../src/console_switch.h
@@ -37,7 +37,7 @@
.PHONY: install-%.so
install-%.so: %.so
$(MKDIR_P) -m 755 $(DESTDIR)$(MODULEDIR)
- $(INSTALL) -m $(MODULE_MODE) -o root -g $(MODULE_GROUP) $< $(DESTDIR)$(MODULEDIR)/$<
+ $(INSTALL) -s -m $(MODULE_MODE) -o root -g $(MODULE_GROUP) $< $(DESTDIR)$(MODULEDIR)/$<
.PHONY: clean
clean:

View File

@ -1,12 +1,19 @@
bin/vlock
sbin/vlock-main
man/man1/vlock.1.gz
man/man5/vlock-plugins.5.gz
man/man8/vlock-main.8.gz
%%VLOCKSCRIPTS%%lib/vlock/scripts/amarok
%%VLOCKSCRIPTS%%lib/vlock/scripts/example_script
%%VLOCKSCRIPTS%%lib/vlock/scripts/mplayer
%%VLOCKSCRIPTS%%@dirrm lib/vlock/scripts
lib/vlock/modules/all.so
%%CACASAVER%%lib/vlock/modules/caca.so
@mode 4711
sbin/vlock-main
@mode 0750
@group %%VLOCK_GRP%%
lib/vlock/modules/new.so
%%PL_CACASAVER%%lib/vlock/modules/caca.so
@mode %%SHAREMODE%%
@group %%SHAREGRP%%
@dirrm lib/vlock/modules
%%PL_VLOCKSCRIPTS%%lib/vlock/scripts/amarok
%%PL_VLOCKSCRIPTS%%lib/vlock/scripts/example_script
%%PL_VLOCKSCRIPTS%%lib/vlock/scripts/mplayer
%%PL_VLOCKSCRIPTS%%@dirrm lib/vlock/scripts
@dirrm lib/vlock
@exec if ! pw groupshow vlock 2>/dev/null; then pw groupadd vlock -g 129; fi