Only build libdrm-vivante and libkms

Change-Id: I94573144510eaf79d7b0aa09b133bb47672bcfd3
diff --git a/debian/changelog b/debian/changelog
index 6aedf2c..a13d327 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-libdrm (2.4.84+imx-0) unstable; urgency=medium
+libdrm-imx (2.4.84+imx-0) unstable; urgency=medium
 
   * Initial release
 
diff --git a/debian/control b/debian/control
index bd551da..e1b378b 100644
--- a/debian/control
+++ b/debian/control
@@ -1,54 +1,25 @@
-Source: libdrm
+Source: libdrm-imx
 Priority: optional
 Maintainer: AIY Projects <support-aiyprojects@google.com>
 Build-Depends:
  debhelper (>= 10),
  quilt,
- xsltproc,
- docbook-xsl,
- libx11-dev,
  pkg-config,
  xutils-dev (>= 1:7.6+2),
- libudev-dev [linux-any],
- libpciaccess-dev,
- valgrind [amd64 armhf i386 mips mipsel powerpc s390x],
- libbsd-dev [kfreebsd-any],
+ libdrm-dev (>= 2.4.74),
 Standards-Version: 4.0.0
 Section: libs
 
-Package: libdrm-dev
+Package: libdrm-imx-dev
 Section: libdevel
-Architecture: linux-any kfreebsd-any
+Architecture: arm64
 Depends:
- libdrm2 (= ${binary:Version}),
  libdrm-vivante (= ${binary:Version}) [arm64],
+ libdrm-libkms (= ${binary:Version}) [arm64],
+ libdrm-dev (>= 2.4.74),
  ${misc:Depends},
 Multi-Arch: same
-Description: Userspace interface to kernel DRM services -- development files
- This library implements the userspace interface to the kernel DRM
- services.  DRM stands for "Direct Rendering Manager", which is the
- kernelspace portion of the "Direct Rendering Infrastructure" (DRI).
- The DRI is currently used on Linux to provide hardware-accelerated
- OpenGL drivers.
- .
- This package provides the development environment for libdrm.
-
-Package: libdrm2
-Architecture: linux-any kfreebsd-any
-Depends:
- ${shlibs:Depends},
- ${misc:Depends},
-Multi-Arch: same
-Pre-Depends: ${misc:Pre-Depends}
-Description: Userspace interface to kernel DRM services -- runtime
- This library implements the userspace interface to the kernel DRM
- services.  DRM stands for "Direct Rendering Manager", which is the
- kernelspace portion of the "Direct Rendering Infrastructure" (DRI).
- The DRI is currently used on Linux to provide hardware-accelerated
- OpenGL drivers.
- .
- This package provides the runtime environment for libdrm.
-
+Description: imx specific libdrm development headers.
 
 Package: libdrm-vivante
 Architecture: arm64
@@ -57,9 +28,13 @@
  ${misc:Depends},
 Pre-Depends: ${misc:Pre-Depends}
 Multi-Arch: same
-Description: Userspace interface to etnaviv-specific kernel DRM services -- runtime
- This library implements the userspace interface to the kernel DRM
- services.  DRM stands for "Direct Rendering Manager", which is the
- kernelspace portion of the "Direct Rendering Infrastructure" (DRI).
- The DRI is currently used on Linux to provide hardware-accelerated
- OpenGL drivers.
+Description: Vivante libdrm extensions.
+
+Package: libdrm-libkms
+Architecture: arm64
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
+Description: libdrm libkms
diff --git a/debian/libdrm-dev.install b/debian/libdrm-imx-dev.install
similarity index 62%
rename from debian/libdrm-dev.install
rename to debian/libdrm-imx-dev.install
index 50b9af9..76f28fa 100644
--- a/debian/libdrm-dev.install
+++ b/debian/libdrm-imx-dev.install
@@ -2,5 +2,3 @@
 usr/lib/*/lib*.a
 usr/lib/*/lib*.so
 usr/lib/*/pkgconfig/*
-usr/share/man/man3/*
-usr/share/man/man7/*
diff --git a/debian/libdrm-libkms.install b/debian/libdrm-libkms.install
new file mode 100644
index 0000000..84efd1f
--- /dev/null
+++ b/debian/libdrm-libkms.install
@@ -0,0 +1 @@
+usr/lib/*/libkms.so.1*
diff --git a/debian/rules b/debian/rules
index 5fb48f1..e99797f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,49 +1,20 @@
 #!/usr/bin/make -f
 
-###
-### Configuration, decide what to build
-###
-
-# Some variables:
-DEB_HOST_ARCH     ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_ARCH_OS  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
-DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
-
-confflags = \
-	--enable-libkms \
-	--enable-vivante-experimental-api \
-	--disable-radeon \
-	--disable-amdgpu \
-	--disable-nouveau \
-	--disable-vmwgfx \
-	--disable-intel \
-	--disable-vc4 \
-	--disable-exynos-experimental-api \
-	--disable-omap-experimental-api \
-	--disable-freedreno \
-	--disable-tegra-experimental-api \
-	--disable-etnaviv-experimental-api \
-	$()
-
-
-###
-### Actual build
-###
-
 override_dh_auto_configure:
-	dh_auto_configure -- --enable-static=yes $(confflags)
-
-override_dh_auto_test:
-	echo "Skipping make check"
+	dh_auto_configure -- --enable-static=yes
 
 override_dh_install:
 	find debian/tmp -name '*.la' -delete
 	rm -rf debian/tmp/usr/share/libdrm
+	mkdir -p debian/tmp/usr/include/libdrm
+	cp include/drm/imx_drm.h debian/tmp/usr/include/libdrm
+	cp include/drm/drm_mode_imx.h debian/tmp/usr/include/libdrm
+	cp include/drm/drm_fourcc_imx.h debian/tmp/usr/include/libdrm
 	dh_install --fail-missing
 
 override_dh_makeshlibs:
-	dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.82)' -- -c4
-	dh_makeshlibs -plibdrm-vivante1 -V'libdrm-vivante1 (>= 2.4.80)' -- -c4
+	dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.74)' -- -c4
+	dh_makeshlibs -plibdrm-vivante -V'libdrm-vivante (>= 2.4.74)' -- -c4
 
 %:
 	dh $@ --with quilt --builddirectory=build/