summaryrefslogtreecommitdiff
path: root/www/magento/files/pkg-install.in
blob: 1884a4f3e35cdbc8b2c15794eae68ab8778313ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

MAGENTODIR='%%MAGENTODIR%%'
var="${PKG_PREFIX}/${MAGENTODIR}/var"
WWWOWN="%%WWWOWN%%"
WWWGRP="%%WWWGRP%%"
medialist='media media/customer media/dhl media/downloadable media/xmlconnect'
medialist="${medialist} media/dhl/logo.jpg"
medialist="${medialist} media/downloadable/.htaccess"
medialist="${medialist} media/xmlconnect/custom/ok.gif"
medialist="${medialist} media/xmlconnect/original/ok.gif"
medialist="${medialist} media/xmlconnect/system/ok.gif"

if [ $2 = "POST-INSTALL" ]
then
	find ${var} -type d -exec chmod 777 {} +
	# var/cache should be world-writeable so that commandline tools like
	# magerun do not create /tmp/magento/var/cache.
	if [ -d ${var}/cache ]
	then
		find ${var}/cache -type f -exec chmod 666 {} +
	fi

	# Make no assumptions about what else is in the media directory, so
	# only install our files and directories with correct ownership.
	for entry in ${medialist}
	do
		chown ${WWWOWN}:${WWWGRP} ${PKG_PREFIX}/${MAGENTODIR}/${entry}
	done
fi