fixed: Bug #3947 - Conflicts when using yum localinstall on Fedora 20

This commit is contained in:
Nick Bolton 2014-03-20 16:09:13 +00:00
parent 3e84372a14
commit 63286c4f9a
2 changed files with 96 additions and 12 deletions

View File

@ -893,8 +893,7 @@ class InternalCommands:
elif type == 'rpm':
if sys.platform == 'linux2':
self.dist_run('cpack -G RPM', unixTarget)
moveExt = 'rpm'
self.distRpm()
else:
package_unsupported = True
@ -931,6 +930,42 @@ class InternalCommands:
("Package type, '%s' is not supported for platform, '%s'")
% (type, sys.platform))
def distRpm(self):
rpmDir = self.getGenerator().buildDir + '/rpm'
if os.path.exists(rpmDir):
shutil.rmtree(rpmDir)
os.makedirs(rpmDir)
templateFile = open(self.cmake_dir + '/synergy.spec.in')
template = templateFile.read()
template = template.replace('${in:version}', self.getVersionFromCmake())
specPath = rpmDir + '/synergy.spec'
specFile = open(specPath, 'w')
specFile.write(template)
specFile.close()
version = self.getVersionFromCmake()
target = '../../bin/synergy-%s-%s.rpm' % (
version, self.getLinuxPlatform())
try:
self.try_chdir(rpmDir)
cmd = 'rpmbuild -bb --define "_topdir `pwd`" synergy.spec'
print "RPM command: " + cmd
err = os.system(cmd)
if err != 0:
raise Exception('Package failed: ' + str(err))
self.unixMove('RPMS/*/*.rpm', target)
finally:
self.restore_chdir()
def distSrc(self):
version = self.getVersionFromCmake()
name = (self.project + '-' + version + '-Source')
@ -1099,7 +1134,20 @@ class InternalCommands:
ftp.run(srcDir + src, dest)
print 'Done'
def getLinuxPlatform(self):
# os_bits should be loaded with '32bit' or '64bit'
import platform
(os_bits, other) = platform.architecture()
# get platform based on current platform
if os_bits == '32bit':
return 'Linux-i686'
elif os_bits == '64bit':
return 'Linux-x86_64'
else:
raise Exception("unknown os bits: " + os_bits)
def dist_name(self, type):
ext = None
platform = None
@ -1110,16 +1158,8 @@ class InternalCommands:
elif type == 'rpm' or type == 'deb':
# os_bits should be loaded with '32bit' or '64bit'
import platform
(os_bits, other) = platform.architecture()
# get platform based on current platform
ext = type
if os_bits == '32bit':
platform = 'Linux-i686'
elif os_bits == '64bit':
platform = 'Linux-x86_64'
platform = self.getLinuxPlatform()
elif type == 'win':

44
res/synergy.spec.in Normal file
View File

@ -0,0 +1,44 @@
# -*- rpm-spec -*-
Summary: Synergy
Name: synergy
Release: 1
License: GPLv2
Group: Applications/Accessories
URL: http://synergy-foss.org/
Source: http://synergy-foss.org/download/
Vendor: The Synergy Project
Packager: Nick Bolton <nick@synergy-foss.org>
Version: ${in:version}
%description
Synergy is free and open source software for sharing one mouse and keyboard
between multiple computers. Works on Windows, Mac OS X, Linux, Android and
Apple iOS.
%prep
source=%{_topdir}/../..
mkdir -p %{buildroot}/%{_datarootdir}/applications
mkdir -p %{buildroot}/%{_datarootdir}/icons
mkdir -p %{buildroot}/%{_bindir}
cp $source/bin/synergy %{buildroot}%{_bindir}
cp $source/bin/synergyc %{buildroot}%{_bindir}
cp $source/bin/synergys %{buildroot}%{_bindir}
cp $source/bin/synergyd %{buildroot}%{_bindir}
cp $source/bin/syntool %{buildroot}%{_bindir}
cp $source/res/synergy.desktop %{buildroot}%{_datarootdir}/applications
cp $source/res/synergy.ico %{buildroot}%{_datarootdir}/icons
%files
%{_bindir}/synergy
%{_bindir}/synergyc
%{_bindir}/synergys
%{_bindir}/synergyd
%{_bindir}/syntool
%{_datarootdir}/applications/synergy.desktop
%{_datarootdir}/icons/synergy.ico
%changelog
* Thu Mar 20 2014 Nick Bolton <nick@synergy-foss.org>
- Initial version of the package