2 # © 2011 Cyril Brulebois <kibi@debian.org>
5 # Call this script from debian/rules, before dh_gencontrol is run,
6 # to get all needed variables computed in debian/$p.substvars for
7 # each package $p found through dh_listpackages.
9 # This script has support for udebs.
12 # Sanity check. All drivers build-depend on debhelper:
13 if ! which dh_listpackages
>/dev
/null
2>&1; then
14 echo "E: dh_listpackages not found, debhelper package missing?"
18 # Read the dependencies once:
19 INPUTDEP
=$
(cat /usr
/share
/xserver-xorg
/xinputdep
2>/dev
/null
)
20 VIDEODEP
=$
(cat /usr
/share
/xserver-xorg
/videodrvdep
2>/dev
/null
)
22 # Iterate on the packages:
23 for package
in $
(dh_listpackages
); do
26 # udebs depend on udebs, tweak the dependency on the server:
27 inputdep
=$
(echo "$INPUTDEP"|
sed 's/xserver-xorg-core/&-udeb/')
28 videodep
=$
(echo "$VIDEODEP"|
sed 's/xserver-xorg-core/&-udeb/')
31 # just copy the dependencies read previously:
36 # To avoid having "unused substitution variable" warnings from
37 # dpkg-gencontrol, only set variables which make sense:
40 # debug, devel, or meta package, no need for Depends/Provides.
45 echo "xinpdriver:Depends=$inputdep" >> debian
/$package.substvars
46 echo "xinpdriver:Provides=xorg-driver-input" >> debian
/$package.substvars
50 echo "xviddriver:Depends=$videodep" >> debian
/$package.substvars
51 echo "xviddriver:Provides=xorg-driver-video" >> debian
/$package.substvars