More build fixes.
authorCarl Hetherington <cth@carlh.net>
Sun, 10 May 2015 14:38:46 +0000 (15:38 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 10 May 2015 14:38:46 +0000 (15:38 +0100)
cscript

diff --git a/cscript b/cscript
index 5a74e8038f4f71f1358a82dfa579de1a8e8b46e3..a6ebfcd5952c5177cc41f011a588f38e0f79ead4 100644 (file)
--- a/cscript
+++ b/cscript
@@ -144,6 +144,66 @@ def make_control(debian_version, bits, filename, debug):
         print >>f,'  This package contains the debugging symbols for dcpomatic.'
         print >>f,''
 
+def make_spec(filename, version, target):
+    """Make a .spec file for a RPM build"""
+    f = open(filename, 'w')
+    print >>f,'Summary:A program that generates Digital Cinema Packages (DCPs) from video and audio files'
+    print >>f,'Name:dcpomatic'
+    print >>f,'Version:%s' % version
+    print >>f,'Release:1%{?dist}'
+    print >>f,'License:GPL'
+    print >>f,'Group:Applications/Multimedia'
+    print >>f,'URL:http://dcpomatic.com/'
+    print >>f,'Requires: ImageMagick-c++, glibmm24, libzip'
+    print >>f,''
+    print >>f,'%description'
+    print >>f,'DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio '
+    print >>f,'files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant '
+    print >>f,'digital projectors.'
+    print >>f,''
+    print >>f,'%files'
+    print >>f,'%{_bindir}/dcpomatic2'
+    print >>f,'%{_bindir}/dcpomatic2_batch'
+    print >>f,'%{_bindir}/dcpomatic2_cli'
+    print >>f,'%{_bindir}/dcpomatic2_create'
+    print >>f,'%{_bindir}/dcpomatic2_kdm'
+    print >>f,'%{_bindir}/dcpomatic2_server'
+    print >>f,'%{_bindir}/dcpomatic2_server_cli'
+    print >>f,'%{_datadir}/applications/dcpomatic2.desktop'
+    print >>f,'%{_datadir}/applications/dcpomatic2_batch.desktop'
+    print >>f,'%{_datadir}/applications/dcpomatic2_server.desktop'
+    print >>f,'%{_datadir}/dcpomatic/taskbar_icon.png'
+    for r in ['128x128', '22x22', '32x32', '48x48', '64x64']:
+        print >>f,'%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2.png' % r
+    for l in ['de_DE', 'es_ES', 'fr_FR', 'it_IT', 'sv_SE', 'nl_NL', 'ru_RU']:
+        print >>f,'%%{_datadir}/locale/%s/LC_MESSAGES/dcpomatic2.mo' % l
+        print >>f,'%%{_datadir}/locale/%s/LC_MESSAGES/libdcpomatic2-wx.mo' % l
+        print >>f,'%%{_datadir}/locale/%s/LC_MESSAGES/libdcpomatic2.mo' % l
+    print >>f,''
+    print >>f,'%prep'
+    print >>f,'rm -rf $RPM_BUILD_DIR/dcpomatic-%s' % version
+    print >>f,'tar xjf $RPM_SOURCE_DIR/dcpomatic-%s.tar.bz2' % version
+    print >>f,'%build'
+    print >>f,'cd dcpomatic-%s' % version
+    print >>f,'export PKG_CONFIG_PATH=%s/lib/pkgconfig:/usr/local/lib/pkgconfig' % target.directory
+    print >>f,'CXXFLAGS="-I%s/include" LDFLAGS="-L%s/lib" ./waf configure --prefix=%%{buildroot}/usr --install-prefix=/usr %s' % (target.directory, target.directory, configure_options(target))
+    print >>f,'./waf'
+    print >>f,'%install'
+    print >>f,'cd dcpomatic-%s' % version
+    print >>f,'./waf install'
+    print >>f,''
+    print >>f,'%post'
+    print >>f,'/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :'
+    print >>f,''
+    print >>f,'%postun'
+    print >>f,'if [ $1 -eq 0 ] ; then'
+    print >>f,'    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null'
+    print >>f,'    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :'
+    print >>f,'fi'
+    print >>f,''
+    print >>f,'%posttrans'
+    print >>f,'/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :'
+
 def dependencies(target):
     return (('ffmpeg-cdist', 'f69bb08'),
             ('libdcp', '8e7f9e4'),
@@ -260,8 +320,15 @@ def package_debian(target, cpu, version):
     target.set('CDIST_LINKFLAGS', target.get('LINKFLAGS'))
     target.set('CDIST_CXXFLAGS', target.get('CXXFLAGS'))
     target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH'))
-    if target.version == 'unstable':
-        target.set('CDIST_EXTRA_CONFIGURE', '--debian-unstable')
+
+    target.set('CDIST_CONFIGURE', '"' + configure_options(target) + '"')
+    if target.debug:
+        target.set('CDIST_DEBUG_PACKAGE', '--dbg-package=dcpomatic-dbg')
+    if target.version == '15.04':
+        target.set('CDIST_LOCALE_PREFIX', '/usr/share/locale')
+    else:
+        target.set('CDIST_LOCALE_PREFIX', '/usr/local/share/locale')
+
     target.command('dpkg-buildpackage -uc -us')
     
     debs = []
@@ -284,6 +351,7 @@ def package_centos(target, cpu, version):
         "%s/SOURCES/dcpomatic-%s.tar.bz2" % (topdir, version)
         )
 
+    make_spec('build/platform/linux/dcpomatic2.spec', version, target)
     target.command('rpmbuild --define \'_topdir %s\' -bb build/platform/linux/dcpomatic2.spec' % topdir)
     rpms = []