-unzip %{SOURCE1} '*_b64.txt' -d thawte/
-for I in thawte/{,*/}*.txt; do
- mv "$I" "`echo $I | sed -e 's|_b64.txt|.crt|' -e 's|/.*/|/|'`"
+%{__unzip} -qq %{SOURCE1} -d thawte
+# resolve file name clash
+mv 'thawte/Thawte Roots/Thawte Extended Validation/thawte Primary Root CA - G1 (EV)/thawte_Primary_Root_CA.pem' \
+ 'thawte/Thawte Roots/Thawte Extended Validation/thawte Primary Root CA - G1 (EV)/thawte_Primary_Root_CA_CC.pem'
+
+find thawte/ -name *.pem | while read f ; do
+ ff=$(echo $f | sed -e 's|[ ,]|_|g' -e 's|[()]|=|g')
+ fff="thawte/$(basename "$ff" .pem).crt"
+ tr -d '\r' < "$f" > "$fff"