How to fix 'file / from install conflicts with...' errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm testing my RPM on newer versions of Fedora and I now get errors like:

file / from install of ... conflicts with file from package filesystem...

Googling returns lots of people complaining about similar issues with
other RPMs, but I haven't been able to find anything that helps me with
_my_ package, and what I'm doing wrong.

My package lives under /var/www/html so installing my RPM
now
complains about /, /var, /var/www, /var/www/html

My spec file is attached.
Any help would be appreciated.

Fulko

Summary:	NetWatch - Network Management System
Name:		NetWatch

	# The following two lines extracts the version and build numbers from the 'build.dat' file
	# The build number is auto-incremented whenever the makefile is invoked
	# NOTE: You have to manually update the version number.

Version:	%(perl -ne 'm/(\d*)\.(\d*)-(\d*)/; print "$1.$2";' build.dat)
Release:	%(perl -ne 'm/(\d*)\.(\d*)-(\d*)/; print "$3";' build.dat)

#Source:	%{name}-%{version}.tar.gz
License:	Commercial
Group:		Applications/Internet

BuildRoot:		%{_builddir}/%{name}-root
BuildArch:		noarch
Provides:		perl(IniFile), perl(Blob), perl(DevNull), perl(PidFile), perl(SimpleFamily), perl(SimpleFamily2), perl(SimulatorHosts), perl(SimulatorOidCachepm)
Requires:		chkconfig, coreutils, initscripts, bash, grep
Requires:		mysql-server, vsftpd
Requires(post):	httpd
#AutoReqProv:	no
	
	#	WARNING WARNING WARNING
	#
	# Note:
	#	1/ Perl source files must be marked as executable in order to be scanned for 'autoreq' detection
	#	2/ 'use' and 'require' statements must not be in evals, as per:
	#		The following 'requires' are needed to capture all those modules that are specified inside 'eval' statements.
	#		They may have been placed inside 'eval' statements because that file may need to be executed on systems
	#		without that particular functionality, but we do want them detected/auto-included/installed on RPM installed systems.

Requires:		perl(GraphViz), perl(IO::Interface), perl(Chart::Lines)

	# The following 'requires' statement is currently needed to avoid having mrtg incorrectly resolve the dependency
	# on RHEL 5 systems (mrtg says it provides it, but the files are not where Perl can find them!)
	#
	#Requires:		perl-SNMP_Session
	#
	# But it doesn't remove the auto-found dependency entries (that still causes 'mrtg' to be haulled in)
	# until I can get mrtg for RHEL in the 'epel' repository brought up to date!
	#
	# The alternative is to tell people (for now who use RHEL) to use:
	#		yum install -nogpgcheck perl-SNMP_Session NetWatch...

%description
The 'NetWatch' network management system.

%prep
#tar cvf ${Source} /var/www/html/nia

%build
# compiling the package

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/var/www/html/nia
chown -R apache:apache $RPM_BUILD_ROOT/var/www/html/nia
find /var/www/html/nia/ -maxdepth 1 -type f -exec cp -p --parents {} $RPM_BUILD_ROOT \;		# from the top level... copy only the files
cp -r -p --parents /var/www/html/nia/docs			$RPM_BUILD_ROOT							# then all the sub-directories and their contents
cp -r -p --parents /var/www/html/nia/help			$RPM_BUILD_ROOT
cp -r -p --parents /var/www/html/nia/icons			$RPM_BUILD_ROOT
cp -r -p --parents /var/www/html/nia/mibs			$RPM_BUILD_ROOT
cp -r -p --parents /var/www/html/nia/mibs_other		$RPM_BUILD_ROOT
cp -r -p --parents /var/www/html/nia/scripts		$RPM_BUILD_ROOT
cp -r -p --parents /var/www/html/nia/support		$RPM_BUILD_ROOT
cp -r -p --parents /var/www/html/nia/test			$RPM_BUILD_ROOT
	#
	#	Make NetWatch's temporary directory
	#
mkdir -p $RPM_BUILD_ROOT/var/www/html/nia/tmp
	#
	#	remove un-finished stuff
	#
rm ${RPM_BUILD_ROOT}/var/www/html/nia/scripts/SimulatorHosts.pm* ${RPM_BUILD_ROOT}/var/www/html/nia/scripts/snmp_simulator*	

%post
#chown apache:apache /var/www/html/nia
#chown root:root	/var/www/html/nia/scripts/adjust_vsftpd_helper.pl	/var/www/html/nia/scripts/create
#chmod 04555		/var/www/html/nia/scripts/adjust_vsftpd_helper.pl	/var/www/html/nia/scripts/create
cp /var/www/html/nia/support/netwatch /etc/rc.d/init.d/
/sbin/chkconfig --add netwatch;
/sbin/chkconfig httpd on
/sbin/chkconfig mysqld on
/sbin/chkconfig netwatch on

	# test to see if we can connect to the default mysql server (with the user's tool and an empty command)...
	# if it fails to connect, then its not running and we need to start it (mysqld)
	# (but we don't want to use the 'restart' because that could incur a glitch to whomever may be using it at the time)

mysql -e '' 2>/dev/null; [ $? -ne 0 ] && service mysqld start

if test -f /etc/httpd/conf/httpd.conf; then
	if ! grep "^[[:space:]]*Include[[:space:]]*/var/www/html/nia/support/httpd-netwatch.conf" /etc/httpd/conf/httpd.conf > /dev/null; then
		echo "Include /var/www/html/nia/support/httpd-netwatch.conf" >> /etc/httpd/conf/httpd.conf
		/etc/rc.d/init.d/httpd restart
	fi
fi

if test -f /etc/sudoers; then
	if ! egrep "^%apache[[:space:]]+ALL=\(ALL\)[[:space:]]+NOPASSWD:[[:space:]]+/var/www/html/nia/scripts/adjust_vsftpd_helper.pl[[:space:]]*,[[:space:]]*/var/www/html/nia/scripts/create[[:space:]]*,[[:space:]]*/etc/init.d/netwatch" /etc/sudoers > /dev/null; then
		echo "%apache ALL=(ALL) NOPASSWD: /var/www/html/nia/scripts/adjust_vsftpd_helper.pl, /var/www/html/nia/scripts/create, /etc/init.d/netwatch" >> /etc/sudoers
	fi
	if egrep "^[[:space:]]*#*[[:space:]]*Defaults[[:space:]]+requiretty" /etc/sudoers > /dev/null; then
	TEMPFILE=`mktemp /etc/sudoers.tmp.XXXXXX`
		egrep -v "Defaults[[:space:]]+requiretty" /etc/sudoers > $TEMPFILE
		echo "#Defaults requiretty" >> $TEMPFILE
		mv $TEMPFILE /etc/sudoers
	fi
	chmod 440 /etc/sudoers
fi

if [ -x /usr/sbin/selinuxenabled ] && selinuxenabled ]; then								# if it exists and can be run
	getsebool httpd_can_network_connect httpd_enable_cgi 2>/dev/null | grep "\-\-> off";	# httpd_can_network_connect:	we need to enable this
	if [ "$?" -eq 0 ]; then																	# httpd_enable_cgi:				this should already be 
		setsebool -P httpd_can_network_connect=1 httpd_enable_cgi=1							# if we found either off... then turn them on
	fi;
fi
if semanage fcontext -a -t httpd_sys_script_exec_t "/var/www/html/nia/scripts/.*" 2>/dev/null; then
	restorecon -v /var/www/html/nia/scripts/* 2>/dev/null
fi
if semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/nia/docs/mibs" 2>/dev/null; then
	restorecon -v /var/www/html/nia/docs/mibs 2>/dev/null
fi
if semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/nia/docs/mibs(/.*)?" 2>/dev/null; then
	restorecon -v -r /var/www/html/nia/docs/mibs 2>/dev/null
fi
if semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/nia/mibs" 2>/dev/null; then
	restorecon -v /var/www/html/nia/mibs 2>/dev/null
fi
if semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/nia/mibs(/.*)?" 2>/dev/null; then
	restorecon -v -r /var/www/html/nia/mibs 2>/dev/null
fi
if semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/nia/tmp" 2>/dev/null; then
	restorecon -v /var/www/html/nia/tmp 2>/dev/null
fi
if semanage fcontext -a -t httpd_sys_content_t "/var/cache/fontconfig/.*" 2>/dev/null; then		# needed for RHEL 5.6 & GraphViz access to the fonts for APPMON element managers
	restorecon -v /var/cache/fontconfig/* 2>/dev/null
fi

%preun
if [ $1 = 0 ]; then
	/sbin/service netwatch stop > /dev/null 2>&1
	/sbin/chkconfig --del netwatch
	rm /etc/rc.d/init.d/netwatch
	rm /var/www/html/nia/tmp/NetWatch_access_rights >/dev/null 2>&1

	if test -f /etc/httpd/conf/httpd.conf; then
		if egrep "^[[:space:]]*Include[[:space:]]*/var/www/html/nia/support/httpd-netwatch.conf" /etc/httpd/conf/httpd.conf > /dev/null; then
			TEMPFILE=`mktemp /etc/httpd/conf/httpd.conf.tmp.XXXXXX`
			egrep -v "^[[:space:]]*Include[[:space:]]*/var/www/html/nia/support/httpd-netwatch.conf" /etc/httpd/conf/httpd.conf > $TEMPFILE
			mv $TEMPFILE /etc/httpd/conf/httpd.conf
			chmod 664 /etc/httpd/conf/httpd.conf
			/etc/rc.d/init.d/httpd restart
		fi
	fi
	if test -f /etc/sudoers; then
		if egrep "^%apache[[:space:]]+ALL=\(ALL\)[[:space:]]+NOPASSWD:[[:space:]]+/var/www/html/nia/scripts/adjust_vsftpd_helper.pl[[:space:]]*,[[:space:]]*/var/www/html/nia/scripts/create[[:space:]]*,[[:space:]]*/etc/init.d/netwatch" /etc/sudoers > /dev/null; then
			TEMPFILE=`mktemp /etc/sudoers.tmp.XXXXXX`
			egrep -v "^%apache[[:space:]]+ALL=\(ALL\)[[:space:]]+NOPASSWD:[[:space:]]+/var/www/html/nia/scripts/adjust_vsftpd_helper.pl, /var/www/html/nia/scripts/create, /etc/init.d/netwatch" /etc/sudoers > $TEMPFILE
			mv $TEMPFILE /etc/sudoers
			chmod 440 /etc/sudoers
		fi
	fi
fi

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, apache, apache)
/
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux