openbsd-ports/www/p5-Apache-Gallery/files
landry c566956ca3 Update to Apache::Gallery 1.0RC3 :
- remove a patch merged upstream
- simplify SUBST_CMD/INSTALL_DATA dance
- fix dependencies in README.chroot, which shows it wasn't tested since
  at least imlib2 1.3.0 update more than two years ago..

joint work with and ok simon@
2009-05-03 15:58:10 +00:00
..
README.chroot Update to Apache::Gallery 1.0RC3 : 2009-05-03 15:58:10 +00:00

# $OpenBSD: README.chroot,v 1.3 2009/05/03 15:58:10 landry Exp $

In order to make A::G operate in a chrooted environment, it is
necessary to copy all of the relevant libraries and perl modules
that it employs into /var/www.

First, create the basic directory structure:

$ cd /var/www
# mkdir -p tmp usr
# chown www:www tmp	(needs to be writeable for the www user)

$ cd /var/www/
# mkdir -p .${LOCALBASE}/lib

$ cd /var/www/usr
# mkdir -p libdata/perl5 libexec {.,X11R6}/lib

Next, the run-time link-editor:

$ cd /var/www/usr/libexec
# cp -p /usr/libexec/ld.so .

Next, the required shared libraries:

$ cd /var/www/usr/lib
# cp -p /usr/lib/lib{c,m,z,util,perl}.so* .

$ cd /var/www${LOCALBASE}/lib
# cp -p ${LOCALBASE}/lib/lib{jpeg,png,bz2,tiff,tiffxx,gif,Imlib2,ltdl,id3tag}.so* .
# mkdir -p imlib2/{loaders,filters}
# cp -pR ${LOCALBASE}/lib/imlib2/loaders/*.so imlib2/loaders
# cp -pR ${LOCALBASE}/lib/imlib2/filters/*.so imlib2/filters

$ cd /var/www/usr/X11R6/lib
# cp -p /usr/X11R6/lib/lib{Xext,freetype,X11,Xau,Xdmcp}.so.* .

Next, the Perl base:

$ cd /var/www/usr/libdata
# cp -pR /usr/libdata/perl5 .

Next, the A::G images and templates:

$ cd /var/www${LOCALBASE}
# mkdir -p share libdata/perl5/site_perl/`machine`-openbsd
# cp -pR ${LOCALBASE}/share/Apache-Gallery share

Next, the non-base Perl stuff:

$ cd /var/www${LOCALBASE}/libdata/perl5/site_perl/
# mkdir -p {,`machine`-openbsd/{,auto/}}Apache
# cp -p ${LOCALBASE}/libdata/perl5/site_perl/Apache/Gallery.pm Apache
# cp -pR ${LOCALBASE}/libdata/perl5/site_perl/`machine`-openbsd/Apache* \
	`machine`-openbsd
# cp -pR ${LOCALBASE}/libdata/perl5/site_perl/`machine`-openbsd/auto/Apache \
	`machine`-openbsd/auto
# cp -p ${LOCALBASE}/libdata/perl5/site_perl/`machine`-openbsd/mod_perl*.pm \
	`machine`-openbsd

# mkdir -p {,`machine`-openbsd/}{,auto/}Image
# cp -pR ${LOCALBASE}/libdata/perl5/site_perl/Image .
# cp -pR ${LOCALBASE}/libdata/perl5/site_perl/auto/Image/Size auto/Image
# cp -pR ${LOCALBASE}/libdata/perl5/site_perl/`machine`-openbsd/Image* \
	`machine`-openbsd
# cp -pR ${LOCALBASE}/libdata/perl5/site_perl/`machine`-openbsd/auto/Image \
	`machine`-openbsd/auto

# mkdir -p Text URI IO
# cp -pR ${LOCALBASE}/libdata/perl5/site_perl/Text/Template* Text
# cp -pR ${LOCALBASE}/libdata/perl5/site_perl/IO/String* String
# cp -pR ${LOCALBASE}/libdata/perl5/site_perl/URI* .


Setting up httpd
------------------------------
<VirtualHost *>
	ServerAdmin webmaster@host.some_domain.com
	DocumentRoot /var/www/htdocs
	ErrorLog    logs/gallery-error
	CustomLog   logs/gallery-access combined
	ServerName  gallery.site.tld
	Alias /icons/gallery/ "${LOCALBASE}/share/Apache-Gallery/icons/"
	Alias /gallery.css "${LOCALBASE}/share/Apache-Gallery/templates/new/gallery.css"
	# This is necessary.
	Options -Indexes
	PerlSetVar  GalleryCacheDir '/tmp/'
	PerlSetVar  GalleryTemplateDir '${LOCALBASE}/share/Apache-Gallery/templates/new/'
	PerlSetVar  GalleryInfo 'Picture Taken => DateTimeOriginal, Flash => Flash'
	PerlSetVar  GallerySizes '640 1024'
	PerlSetVar GalleryThumbnailSize '100x75'

	# Note that you will want to change this.
	PerlSetVar GalleryCopyrightImage '${LOCALBASE}/share/Apache-Gallery/icons/c.png'

	<Directory ${LOCALBASE}/share/Apache-Gallery>
		order allow,deny
		allow from all
	</Directory>

	<Location />
		SetHandler perl-script
		PerlHandler Apache::Gallery
	</Location>

</VirtualHost>