-find '(' -name '*.php' -o -name '*.html' -o -name '*.txt' ')' -print0 | xargs -0 %{__sed} -i -e 's,\r$,,'
-%{__sed} -i -e 's,\r$,,' README LICENSE
+ %{__php} -n -l $f
+done
+
+%if %{with tests}
+cd test
+%{__php} $(which phpunit) .
+cd -
+%endif
+
+rm -rf phpdoc
+phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer \
+ --directory . --ignore test/,examples/,extras/,test_script/,language/,phpdoc/ --sourcecode
+
+# copy images, phpdoc is likely buggy not doing itself
+sdir=%{php_pear_dir}/data/PhpDocumentor/phpDocumentor/Converters/HTML/frames/templates/earthli/templates/media/images
+install -d phpdoc/media/images
+cp -p $sdir/Constant.png phpdoc/media/images
+cp -p $sdir/Variable.png phpdoc/media/images