Finish the support for slave ports:

- allow slave ports to override CATEGORIES
- slave ports install in different directories, depending on PKGNAMEPREFIX
- new variable INSTDIR, abbreviation for the aformentioned directory
  where the program is installed

- new variable CMD_SUFFIX, to be set by the slave ports, is appended
  to the name of our wrapper script that wraps Adobe's wrapper
  script, so that different slave ports will have different copies
  of this script (if CMD_SUFFIX is foo, the user runs acroread7-foo
  to start the program).
This commit is contained in:
Trevor Johnson 2005-10-07 09:48:27 +00:00
parent d0bb4728ae
commit 52e0d357f1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=144458
2 changed files with 15 additions and 12 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= acroread7
PORTVERSION= 7.0.1
CATEGORIES= print linux
CATEGORIES?= print linux
MASTER_SITES= \
http://download.adobe.com/pub/adobe/reader/unix/7x/7.0/${ADOBE_LANG}/ \
ftp://ftp.adobe.com/pub/adobe/reader/unix/7x/7.0/${ADOBE_LANG}/
@ -25,32 +25,35 @@ RUN_DEPENDS= ${LINUXBASE}/usr/lib/libgtk-x11-2.0.so.0:${PORTSDIR}/x11-toolkits/l
RESTRICTED= "Must fill out redistribution form at http://www.adobe.com/products/acrobat/distribute.html"
ADOBE_LANG?= enu
INSTDIR= lib/${PKGNAMEPREFIX}acroread
NO_FILTER_SHLIBS= yes
ONLY_FOR_ARCHS= amd64 i386
PLIST= ${WRKDIR}/plist
SUB_FILES= acroread7
SUB_LIST+= INSTDIR=${INSTDIR}
do-build:
@kldstat -v | ${GREP} -E 'linux(aout|elf)' >/dev/null ||\
{ ${ECHO_MSG} "Linux ABI compatibility must be enabled to install ${PORTNAME}-${PORTVERSION}"; \
exit 1; }
@${RM} -rf ${WRKSRC}
${MKDIR} ${WRKSRC}/lib/acroread
@${ECHO} bin/acroread7 > ${PLIST}
cd ${WRKSRC}/lib/acroread; \
${MKDIR} ${WRKSRC}/${INSTDIR}
@${ECHO} bin/acroread7${CMD_SUFFIX} > ${PLIST}
cd ${WRKSRC}/${INSTDIR}; \
rpm2cpio < ${DISTDIR}/${DIST_SUBDIR}/${DISTNAME} | ${CPIO} -id
cd ${WRKSRC}; \
${FIND} lib/acroread -type l -o -type f >> ${PLIST}; \
${FIND} -d lib/acroread -type d \
${FIND} ${INSTDIR} -type l -o -type f >> ${PLIST}; \
${FIND} -d ${INSTDIR} -type d \
| ${SED} -e 's:^:@dirrm :' >> ${PLIST}
do-install:
@cd ${WRKSRC} && ${FIND} lib/acroread | ${CPIO} -dlmp ${LOCALBASE}
@${FIND} ${LOCALBASE}/lib/acroread -type d -exec ${CHMOD} 755 \{\} \;
@${INSTALL_SCRIPT} ${WRKDIR}/acroread7 ${PREFIX}/bin/
@cd ${WRKSRC} && ${FIND} ${INSTDIR} | ${CPIO} -dlmp ${LOCALBASE}
@${FIND} ${LOCALBASE}/${INSTDIR} -type d -exec ${CHMOD} 755 \{\} \;
@${INSTALL_SCRIPT} ${WRKDIR}/acroread7 \
${PREFIX}/bin/acroread7${CMD_SUFFIX}
@${ECHO_MSG} "Be sure to read the license agreement in"
@${ECHO_MSG} "${PREFIX}/acroread/usr/local/Adobe/Acrobat7.0/Reader/Legal/${ADOBE_LANG:U}/license_${ADOBE_LANG:U}_uc.txt"
@${ECHO_MSG} "${PREFIX}/${INSTDIR}/usr/local/Adobe/Acrobat7.0/Reader/Legal/${ADOBE_LANG:U}/license_${ADOBE_LANG:U}_uc.txt"
# disable the PPKLite plugin as it requires an LDAP share lib
${CHMOD} 0 ${PREFIX}/lib/acroread/usr/local/Adobe/Acrobat7.0/Reader/intellinux/plug_ins/PPKLite.api
${CHMOD} 0 ${PREFIX}/${INSTDIR}/usr/local/Adobe/Acrobat7.0/Reader/intellinux/plug_ins/PPKLite.api
.include <bsd.port.mk>

View file

@ -1,3 +1,3 @@
#!/bin/sh
UNAME_s=Linux; export UNAME_s
exec %%PREFIX%%/lib/acroread/usr/local/Adobe/Acrobat7.0/bin/acroread "$@"
exec %%PREFIX%%/%%INSTDIR%%/usr/local/Adobe/Acrobat7.0/bin/acroread "$@"