+# mask out the LSB service
+ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/mongod.service
+cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/mongod@.service
+
+touch $RPM_BUILD_ROOT%{_var}/log/mongodb/mongod.log
+
+# for some reason these are installed twice, remove unwanted copies
+for f in $RPM_BUILD_ROOT%{_includedir}/mongo/*; do
+ rm -r "$RPM_BUILD_ROOT%{_includedir}/$(basename $f)" || :
+done
+
+%ifarch %{x8664}
+chmod -R a+rX $RPM_BUILD_ROOT/usr/lib
+%{__rm} -r $RPM_BUILD_ROOT/usr/lib
+%endif