root/trunk/libffado/deb/SConscript

Revision 2815, 4.9 kB (checked in by jwoithe, 3 years ago)

deb/: add "qt5-ukui-platformtheme" as a recommendation.

Some have found the ukui dark theme to be a good match for ffado-mixer,
so add it as a recommendation in the dev SConscript. This was suggested by
Pander on the ffado-devel mailing list. This file isn't used to produce
official Debian packages, but acts as a starting point for developers who
would like to create their own packages.

Line 
1 #
2 # Copyright (C) 2007-2008 Arnold Krille
3 # Copyright (C) 2007-2008 Pieter Palmers
4 #
5 # This file is part of FFADO
6 # FFADO = Free FireWire (pro-)audio drivers for Linux
7 #
8 # FFADO is based upon FreeBoB.
9 #
10 # This program is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 2 of the License, or
13 # (at your option) version 3 of the License.
14 #
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 #
23
24 # from: http://www.qandr.org/quentin/writings/debscons.html
25 import os
26
27 Import('env') # exported by parent SConstruct
28
29 # Here's the core info for the package
30
31 DEBNAME = "libffado0"
32 if env['REVISION']:
33     DEBVERSION = "%s-%s" % (env['VERSION'], env['REVISION'])
34 else:
35     DEBVERSION = env['VERSION']
36
37 DEBMAINT = "Pieter Palmers [pieter.palmers@ffado.org]"
38 DEBARCH = "i386"
39 DEBDEPENDS = "libraw1394-8 (>= 1.3.0), libiec61883-0 (>= 1.1.0), libavc1394-0 (>= 0.5.3), dbus (>= 1.1.0)" # what are we dependent on?
40 DEBRECOMMENDS = "qt5-ukui-platformtheme (>= 1.0.0)"
41 DEBDESC = "FFADO: FireWire audio for Linux (Development build SVN r%s)" % env['REVISION']
42
43 DEBFILES = [
44     # Now we specify the files to be included in the .deb
45     # Where they should go, and where they should be copied from.
46     # If you have a lot of files, you may wish to generate this
47     # list in some other way.
48     ("usr/lib/libffado.so",             "#src/libffado.so"),
49     ("usr/lib/pkgconfig/libffado.pc",             "#/libffado.pc"),
50     ("usr/include/libffado/ffado.h",             "#libffado/ffado.h"),
51     ("usr/bin/ffado-dbus-server", "#support/dbus/ffado-dbus-server"),
52 ]
53
54 DEBFILES.append(("usr/share/libffado/ffado_driver_genericavc.txt",  "#src/genericavc/ffado_driver_genericavc.txt"))
55
56
57 if env['ENABLE_BEBOB']:
58     DEBFILES.append(("usr/share/libffado/ffado_driver_bebob.txt",  "#src/bebob/ffado_driver_bebob.txt"))
59     DEBFILES.append(("usr/bin/ffado-bridgeco-downloader", "#support/firmware/ffado-bridgeco-downloader"))
60     #DEBFILES.append(("usr/share/libffado/fw410.xml", "#src/bebob/maudio/fw410.xml"))
61     #DEBFILES.append(("usr/share/libffado//fwap.xml","#src/bebob/maudio/fwap.xml"))
62     #DEBFILES.append(("usr/share/libffado//refdesign.xml","#src/bebob/maudio/refdesign.xml"))
63 if env['ENABLE_FIREWORKS']:
64     DEBFILES.append(("usr/share/libffado/ffado_driver_fireworks.txt",  "#src/fireworks/ffado_driver_fireworks.txt"))
65     DEBFILES.append(("usr/bin/ffado-fireworks-downloader", "#support/firmware/ffado-fireworks-downloader"))
66 if env['ENABLE_MOTU']:
67     pass
68 if env['ENABLE_DICE']:
69     pass
70 if env['ENABLE_METRIC_HALO']:
71     pass
72 if env['ENABLE_RME']:
73     pass
74 if env['ENABLE_BOUNCE']:
75     pass
76
77
78
79 # This is the debian package we're going to create
80 debpkg = '#%s_%s_%s.deb' % (DEBNAME, DEBVERSION, DEBARCH)
81
82 # and we want it to be built when we build 'debian'
83 env.Alias("debian", debpkg)
84
85 DEBCONTROLFILE = os.path.join(DEBNAME, "DEBIAN/control")
86
87 # This copies the necessary files into place into place.
88 # Fortunately, SCons creates the necessary directories for us.
89 for f in DEBFILES:
90     # We put things in a directory named after the package
91     dest = os.path.join(DEBNAME, f[0])
92     # The .deb package will depend on this file
93     env.Depends(debpkg, dest)
94     # Copy from the the source tree.
95     env.Command(dest, f[1], Copy('$TARGET','$SOURCE'))
96     # The control file also depends on each source because we'd like
97     # to know the total installed size of the package
98     env.Depends(DEBCONTROLFILE, dest)
99
100 # Now to create the control file:
101
102 CONTROL_TEMPLATE = """
103 Package: %s
104 Priority: extra
105 Section: misc
106 Installed-Size: %s
107 Maintainer: %s
108 Architecture: %s
109 Version: %s
110 Depends: %s
111 Recommends: %s
112 Description: %s
113
114 """
115 env.Depends(debpkg,DEBCONTROLFILE )
116
117 # The control file should be updated when the SVN version changes
118 env.Depends(DEBCONTROLFILE, env.Value(env['REVISION']))
119
120 # This function creates the control file from the template and info
121 # specified above, and works out the final size of the package.
122 def make_control(target=None, source=None, env=None):
123     installed_size = 0
124     for i in DEBFILES:
125         installed_size += os.stat(str(env.File(i[1])))[6]
126     control_info = CONTROL_TEMPLATE % (
127         DEBNAME, installed_size, DEBMAINT, DEBARCH, DEBVERSION,
128         DEBDEPENDS, DEBRECOMMENDS, DEBDESC)
129     with open(str(target[0]), 'w') as f:
130         f.write(control_info)
131
132 # We can generate the control file by calling make_control
133 env.Command(DEBCONTROLFILE, None, make_control)
134
135 # And we can generate the .deb file by calling dpkg-deb
136 env.Command(debpkg, DEBCONTROLFILE,
137             "dpkg-deb -b %s %s" % ("deb/%s" % DEBNAME, "$TARGET"))
Note: See TracBrowser for help on using the browser.