raveit65 0d51183
#!/bin/sh
raveit65 0d51183
raveit65 0d51183
# Regenerate faience-icon-theme tarball without copyrighted trademarks
raveit65 0d51183
raveit65 0d51183
name=faience-icon-theme_0.5
raveit65 0d51183
theme_name=Faience
raveit65 0d51183
raveit65 0d51183
# unpack the zip archive
raveit65 0d51183
unzip $name -d $name
raveit65 0d51183
raveit65 0d51183
# unpack the icon tarballs
raveit65 0d51183
cd $name
raveit65 0d51183
tar -xzf $theme_name.tar.gz
raveit65 0d51183
tar -xzf $theme_name-Azur.tar.gz
raveit65 0d51183
tar -xzf $theme_name-Claire.tar.gz
raveit65 0d51183
tar -xzf $theme_name-Ocre.tar.gz
raveit65 0d51183
raveit65 0d51183
# remove nonfree and unneeded icons
raveit65 0d51183
find $theme_name*/ -name '*flash*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*amazon*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*gmail*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*chromium*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*dropbox*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*evernote*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*facebook*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*firefox*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*google*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*twitter*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*gtwitter*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*launchpad*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*mandriva*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*mendeley*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*thunderbird*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*nixnote*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*ppa*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*rpmdrake*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*skype*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*softwarecenter*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*steam*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*susehelpcenter*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*twitux*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*ubuntu*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*wunderlist*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*Wunderlist*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*yahoo*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*start-here-archlinux-symbolic*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*start-here-debian-symbolic*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*start-here-frugalware-symbolic*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*start-here-gentoo-symbolic*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*start-here-linux-mint-symbolic*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*start-here-opensuse-symbolic*' -exec rm -rf {} ';'
raveit65 0d51183
find $theme_name*/ -name '*start-here-slackware-symbolic*' -exec rm -rf {} ';'
raveit65 0d51183
raveit65 0d51183
# Delete dead icon symlinks
raveit65 0d51183
find -L . -type l -exec rm {} \;
raveit65 0d51183
raveit65 0d51183
# remove faenza-icon-theme dep
raveit65 0d51183
sed -i "s/Inherits=Faenza,gnome,hicolor/Inherits=gnome,hicolor/" $theme_name/index.theme
raveit65 0d51183
raveit65 0d51183
# remove old icon tarballs
raveit65 0d51183
rm -f $theme_name.tar.gz
raveit65 0d51183
rm -f $theme_name-Azur.tar.gz
raveit65 0d51183
rm -f $theme_name-Claire.tar.gz
raveit65 0d51183
rm -f $theme_name-Ocre.tar.gz
raveit65 0d51183
raveit65 0d51183
# create new icon tarballs
raveit65 0d51183
tar -czf $theme_name.tar.gz $theme_name/
raveit65 0d51183
tar -czf $theme_name-Azur.tar.gz $theme_name-Azur/
raveit65 0d51183
tar -czf $theme_name-Claire.tar.gz $theme_name-Claire/
raveit65 0d51183
tar -czf $theme_name-Ocre.tar.gz $theme_name-Ocre/
raveit65 0d51183
raveit65 0d51183
# remove extracted icon dirs
raveit65 0d51183
rm -rf $theme_name
raveit65 0d51183
rm -rf $theme_name-Azur
raveit65 0d51183
rm -rf $theme_name-Claire
raveit65 0d51183
rm -rf $theme_name-Ocre
raveit65 0d51183
raveit65 0d51183
# create the tarball and clean directory
raveit65 0d51183
cd ..
raveit65 0d51183
tar -cf - $name/ | xz -9 -c - > $name.tar.xz 
raveit65 0d51183
rm -rf $name
raveit65 0d51183
raveit65 0d51183
echo "tarball created"
raveit65 0d51183
exit