
#1/bin/bash

cxdebconfig() {
tee <<ctrnol
Package: crossover
Version: $ver
Architecture: all
Maintainer: CrossOver Packager <info@codeweavers.com>
Installed-Size: 565484
Depends: libc6 (>= 2.23),
          libc6-i386 (>= 2.23),
          lib32z1,
          perl,
          python3,
          python3-gi, 
          python3-dbus,
          gir1.2-gtk-3.0,
          gir1.2-gdkpixbuf-2.0,
          gir1.2-pango-1.0,
          gir1.2-glib-2.0,
          gir1.2-vte-2.91,
          desktop-file-utils,
          libfreetype6:i386,
          libxext6:i386,
          libcapi20-3:i386,
          libcups2:i386,
          libdbus-1-3:i386,
          libfontconfig1:i386,
          libglu1-mesa:i386,
          libgphoto2-6:i386,
          libgphoto2-port12:i386,
          libgsm1:i386,
          libgssapi-krb5-2:i386,
          libkrb5-3:i386,
          libldap-2.4-2:i386,
          liblcms2-2:i386,
          libmpg123-0:i386,
          libncurses5:i386,
          libodbc1:i386,
          libopenal1:i386,
          ocl-icd-libopencl1:i386,
          libosmesa6:i386,
          libpcap0.8:i386,
          libsane1:i386,
          libstdc++6:i386,
          libtiff5:i386,
          libudev1:i386,
          libv4l-0:i386,
          libxcomposite1:i386,
          libxcursor1:i386,
          libxfixes3:i386,
          libxi6:i386,
          libxinerama1:i386,
          libxml2:i386,
          libxrandr2:i386,
          libxrender1:i386,
          libxslt1.1:i386,
          libxxf86vm1:i386,
          libgnutls28-dev:i386,
          libpng-dev:i386,
          libnss-mdns:i386,
          libvulkan1:i386,
          libpulse0:i386,
          libasound2:i386,
          libgstreamer1.0-0:i386,
          libgcc-s1:i386,
          libc6:i386,
          libx11-6:i386,
          libcapi20-3:amd64,
          libncurses5:amd64,
          libopenal1:amd64,
          libosmesa6:amd64,
          gstreamer1.0-plugins-bad:i386,
          gstreamer1.0-plugins-base:i386,
          gstreamer1.0-plugins-good:i386,
          gstreamer1.0-plugins-ugly:i386,
          gstreamer1.0-libav:i386,
          gstreamer1.0-plugins-bad:amd64,
          gstreamer1.0-plugins-ugly:amd64,
          gstreamer1.0-libav:amd64
Replaces: crossover-pro, crossover-pro-canonical-demo, crossover-pro-demo, crossover-standard, crossover-standard-canonical-demo, crossover-standard-demo, ia32-crossover, ia32-crossover-pro, ia32-crossover-pro-canonical-demo, ia32-crossover-pro-demo, ia32-crossover-standard, ia32-crossover-standard-canonical-demo, ia32-crossover-standard-demo
Provides: cxoffice20
Section: non-free/otherosfs
Priority: optional
Multi-Arch: foreign
Homepage: http://www.codeweavers.com
Description: Run Windows productivity and utility apps like Microsoft Office and games
  CrossOver Linux integrates with your desktop environment so you can use your
  Windows applications like any other native application. This includes starting
  them from the desktop and using them to open Windows files and email
  attachments. If an anti-virus scanner is available, CrossOver Linux will also
  automatically scan these to protect you
  Thanks to CrossTies, CrossOver Linux takes the guesswork out of installing
  applications referenced in its compatibility database. This makes it easy to
  install Windows productivity applications such as Microsoft Office and
  Quicken. CrossOver Linux also takes care of installing any native packages that
  may be required to run them
  This also applies to games such as Diablo III, Minecraft Dungeons and modern
  Direct3D 11 and 12 games when it's time to relax
ctrnol
}
for i in $(find . -name crossover*deb) ;do
ver=$(echo $i|sed -e 's/.*crossover_//g')
ver=$(echo $ver|sed -e 's/-[0-9].*deb/-9/g')
dir=$(dirname "$i")
dpkg-deb -R $i cx$$
cxdebconfig  >cx$$/DEBIAN/control
cp $0 cx$$/opt/cxoffice/
dpkg-deb -b cx$$ "$dir/crossover_$ver""_all.deb"
rm cx$$ -rf
done
