--- /dev/null
+Name: audiomanager
+License: Mozilla Public License 2.0
+Group: System/Daemons
+Summary: AudioManager
+Version: 0.0.@VERSION@
+Release: 0
+Source: %{name}-@VERSION@.tar.gz
+@DECLARE_PATCHES@
+#BuildRequires: pkgconfig(automotive-dlt)
+BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(dbus-1)
+BuildRequires: cmake
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description
+Automotive AudioManager
+
+%package devel
+License: Mozilla Public License 2.0
+Summary: Automotive AudioManager Development Package
+Group: System/Development
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Files needed for developing against the Automotive AudioManager
+
+%prep
+%setup -q -n %{name}-@VERSION@
+@APPLY_PATCHES@
+
+%build
+mkdir build
+cd build
+
+case %{_arch} in
+ *64) libdir=lib64;;
+ *) libdir=lib;;
+esac
+
+cmake -DWITH_TESTS=OFF -DUSE_BUILD_LIBS=OFF -DWITH_DLT=OFF -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=$libdir ..
+make %{?jobs:-j %jobs}
+
+%install
+rm -rf "$RPM_BUILD_ROOT"
+cd build
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}/AudioManager
+%{_libdir}/audioManager/command/*.so.*
+%{_libdir}/audioManager/control/*.so.*
+%{_libdir}/audioManager/routing/*.so.*
+%{_libdir}/audioManager/command/*.so
+%{_libdir}/audioManager/control/*.so
+%{_libdir}/audioManager/routing/*.so
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/*.h
+%{_includedir}/command/*.h
+%{_includedir}/control/*.h
+%{_includedir}/routing/*.h
+%{_includedir}/shared/*.h
+%{_libdir}/pkgconfig/*.pc