Subject: opera and Linux in pkgsrc
To: None <pkgsrc-users@NetBSD.org, jdolecek@NetBSD.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: pkgsrc-users
Date: 03/10/2006 20:53:53
I had updated opera twice over the past year so I could install opera for 
Linux. I did it once with an RPM and later with a tarball. (Both were used 
on a Linux system using the package built on a different Linux/pkgsrc 
build system.)

I don't have chance to check this. But this is in my pkgsrc. (I have the 
diff and PLIST.Linux below.)

Can anyone clean this up? Or verify this?


Index: www/opera/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/opera/Makefile,v
retrieving revision 1.54
diff -b -u -r1.54 Makefile
--- www/opera/Makefile	21 Feb 2006 10:31:22 -0000	1.54
+++ www/opera/Makefile	11 Mar 2006 04:50:14 -0000
@@ -14,7 +14,7 @@
 HOMEPAGE=		http://www.opera.com/
 COMMENT=		Small, fast and customizable WWW client
 
-ONLY_FOR_PLATFORM=	NetBSD-*-i386 SunOS-*-sparc FreeBSD-*-i386 DragonFly-*-i386
+ONLY_FOR_PLATFORM=	NetBSD-*-i386 SunOS-*-sparc FreeBSD-*-i386 DragonFly-*-i386 Linux-*-*
 
 LICENSE=		opera-850-license
 
@@ -33,7 +33,19 @@
 _OPERA_OPSYS?=		${OPSYS}
 _OPERA_MACHINE_ARCH?=	${MACHINE_ARCH}
 
-.if (${_OPERA_OPSYS} == NetBSD) || (${_OPERA_OPSYS} == DragonFly)
+.if (${_OPERA_OPSYS} == Linux)
+# should use RPM -- same download for NetBSD
+EXTRACT_SUFX=		.tar.bz2
+OPERA_ARCH=		.i386
+OPERA_DIR=		linux/${OPERA_PKG_VERSION_DIR}/final/${OPERA_LANG}/${OPERA_ARCH:S/.//}
+OPERA_DIST_VERSION=	${OPERA_PKG_VERSION:C/beta.*//:C/u.*//}-${OPERA_VER_DATE}.1-static-qt
+#OPERA_DIST_VERSION=	${OPERA_PKG_VERSION:C/beta.*//:C/u.*//}-${OPERA_VER_DATE}.6-shared-qt
+
+WRKSRC=			${WRKDIR}/opera-${OPERA_DIST_VERSION}${OPERA_ARCH}-${OPERA_LANG}
+
+OWN_DIRS=		${PREFIX}/share/opera/plugins
+
+.elif (${_OPERA_OPSYS} == NetBSD) || (${_OPERA_OPSYS} == DragonFly)
 DEPENDS+=		suse_x11>=7.3:../../emulators/${SUSE_DIR_PREFIX}_x11
 
 # we need the DIST_SUBDIR=. because of the inclusion of suse's Makefile.common
@@ -92,7 +104,7 @@
 
 .endif
 
-INSTALLATION_DIRS=	bin man/man1
+INSTALLATION_DIRS=	bin ${PKGMANDIR}/man1
 
 do-build:
 .if (${_OPERA_OPSYS} == NetBSD) || (${_OPERA_OPSYS} == DragonFly)
@@ -113,21 +125,21 @@
 .  if defined(MANCOMPRESSED) && !empty(MANCOMPRESSED:M[yY][eE][sS])
 	${GZIP_CMD} ${EMULDIR}/usr/share/man/man1/opera.1
 	${LN} -fs ../../${EMULSUBDIR}/usr/share/man/man1/opera.1.gz \
-		${PREFIX}/man/man1
+		${PREFIX}/${PKGMANDIR}/man1
 .  else
 	${LN} -fs ../../${EMULSUBDIR}/usr/share/man/man1/opera \
-		${PREFIX}/man/man1
+		${PREFIX}/${PKGMANDIR}/man1
 .  endif
 .endif
 
-.if (((${_OPERA_OPSYS} == SunOS) && (${_OPERA_MACHINE_ARCH} == sparc)) || (${_OPERA_OPSYS} == FreeBSD))
+.if (((${_OPERA_OPSYS} == SunOS) && (${_OPERA_MACHINE_ARCH} == sparc)) || (${_OPERA_OPSYS} == FreeBSD) || (${_OPERA_OPSYS} == Linux))
 do-install:
 	@cd ${WRKSRC} && ${ECHO} "n" | ./install.sh --prefix=${PREFIX}
 	@${ECHO} "=> You can ignore any previous lines about opera6rc"
 	@${ECHO}
 
 post-install:
-	@${INSTALL_MAN} ${WRKSRC}/man/opera.1 ${PREFIX}/man/man1
+	@${INSTALL_MAN} ${WRKSRC}/man/opera.1 ${PREFIX}/${PKGMANDIR}/man1
 .endif
 
 # regenerate distinfo for all ports supported by this package
@@ -136,6 +148,8 @@
 	  ${ECHO} ''; \
 	_OPERA_OPSYS=NetBSD ${MAKE} distinfo 1>&2; \
 		${GREP} opera distinfo; \
+	_OPERA_OPSYS=Linux ${MAKE} distinfo 1>&2; \
+		${GREP} opera distinfo; \
 	_OPERA_OPSYS=FreeBSD ${MAKE} distinfo 1>&2; \
 		${GREP} opera distinfo; \
 	_OPERA_OPSYS=SunOS _OPERA_MACHINE_ARCH=sparc make distinfo 1>&2; \



And my PLIST.Linux is here:

@comment $NetBSD$
bin/opera
lib/opera/${PKGVERSION}-20051114.1/missingsyms.so
lib/opera/${PKGVERSION}-20051114.1/opera
lib/opera/${PKGVERSION}-20051114.1/spellcheck.so
lib/opera/${PKGVERSION}-20051114.1/works
lib/opera/plugins/libnpp.so
lib/opera/plugins/operamotifwrapper-1
lib/opera/plugins/operamotifwrapper-2
lib/opera/plugins/operamotifwrapper-3
lib/opera/plugins/operaplugincleaner
man/man1/opera.1
share/doc/opera/LICENSE
share/gnome/apps/Internet/opera.desktop
share/gnome/pixmaps/opera.xpm
share/icons/opera.xpm
share/opera/chartables.bin
share/opera/config/opera6rc
share/opera/config/opera6rc.fixed
share/opera/html40_entities.dtd
share/opera/images/blank.gif
share/opera/images/drive.gif
share/opera/images/file.gif
share/opera/images/folder.gif
share/opera/images/link.gif
share/opera/images/opera.xpm
share/opera/images/opera_16x16.png
share/opera/images/opera_22x22.png
share/opera/images/opera_32x32.png
share/opera/images/opera_48x48.png
share/opera/images/operabanner.png
share/opera/ini/dialog.ini
share/opera/ini/fastforward.ini
share/opera/ini/filehandler.ini
share/opera/ini/pluginpath.ini
share/opera/ini/spellcheck.ini
share/opera/ini/standard_keyboard.ini
share/opera/ini/standard_menu.ini
share/opera/ini/standard_mouse.ini
share/opera/ini/standard_toolbar.ini
share/opera/ini/unix_keyboard.ini
share/opera/java/opera.jar
share/opera/java/opera.policy
share/opera/jsconsole.html
share/opera/lngcode.txt
share/opera/locale/en/default.adr
share/opera/locale/en/license.txt
share/opera/locale/en/lngcode.txt
share/opera/locale/en/search.ini
share/opera/locale/english.lng
share/opera/opera6.adr
share/opera/search.ini
share/opera/skin/standard_skin.zip
share/opera/skin/windows_skin.zip
share/opera/styles/OPF.css
share/opera/styles/about.css
share/opera/styles/cache.css
share/opera/styles/certinfo.css
share/opera/styles/csr.css
share/opera/styles/dir.css
share/opera/styles/drives.css
share/opera/styles/email.css
share/opera/styles/history.css
share/opera/styles/im.css
share/opera/styles/info.css
share/opera/styles/mime.css
share/opera/styles/mimehead.css
share/opera/styles/opf.css
share/opera/styles/plugins.css
share/opera/styles/user/accessibility.css
share/opera/styles/user/contrastbw.css
share/opera/styles/user/contrastwb.css
share/opera/styles/user/debugwithoutline.css
share/opera/styles/user/disabletables.css
share/opera/styles/user/hidecertainsizes.css
share/opera/styles/user/hidenonlinkimages.css
share/opera/styles/user/imageandlinkonly.css
share/opera/styles/user/nostalgia.css
share/opera/styles/user/showstructure.css
share/opera/styles/user/textonly.css
share/opera/styles/user/userstyle.ini
share/opera/styles/wml.css
share/opera/svg-mo.dat
share/opera/svg-mobd.dat
share/opera/svg-sa.dat
share/opera/svg-sabd.dat
share/opera/svg-se.dat
share/opera/svg-sebd.dat
share/pixmaps/opera.xpm
@comment @dirrm share/pixmaps
@dirrm share/opera/styles/user
@dirrm share/opera/styles
@dirrm share/opera/skin
@dirrm share/opera/locale/en
@dirrm share/opera/locale
@dirrm share/opera/java
@dirrm share/opera/ini
@dirrm share/opera/images
@dirrm share/opera/config
@dirrm share/opera
@comment @dirrm share/icons
@comment @dirrm share/gnome/pixmaps
@comment @dirrm share/gnome/apps/Internet
@dirrm share/doc/opera
@dirrm lib/opera/plugins
@dirrm lib/opera/${PKGVERSION}-20051114.1
@dirrm lib/opera