5 echo "Usage: $0 [icon theme directory]"
9 THEME_NAME
=`echo "$1" | sed -e 's,/$,,'`
10 THEME_COMMENT
="$THEME_NAME Icon Theme"
12 OUTPUT
=$
(echo "output/$1" |
sed 's/ //')
25 echo "Creating icon theme in '$OUTPUT'"
27 echo "Copying build files.."
33 echo "Creating index.theme"
35 echo -e "[Icon Theme]\nName=$THEME_NAME\nComment=$THEME_COMMENT\n" > index.theme
36 echo -n "Directories=" >> index.theme
38 DIRS
=`find * -type d | grep -v git | grep -v scalable | grep "/" | sort -r`
42 echo -n "$foo," >> index.theme
47 size
=`echo $foo | sed 's/\x.*//'`
50 echo -en "\n\n[$foo]\nSize=$size\nContext=`basename $foo`\nType=$type\n$maxsize" >> index.theme
54 echo "Creating Makefiles"
56 SIZES
=$
(find * -maxdepth 0 -type d
-not -name 'scalable' -printf '%f ')
58 MAKEFILES
='Makefile\n'
61 subdirs
=$
(find $dir/* -maxdepth 0 -type d
-printf '%f ')
62 echo "SUBDIRS=$subdirs" > $dir/Makefile.am
63 MAKEFILES
="$MAKEFILES\n$dir/Makefile"
64 for context
in $subdirs
67 MAKEFILES
="$MAKEFILES\n$dir/$context/Makefile"
68 files
=`echo $dir/$context/*.{svg,icon,png}|sed "s/$dir\/$context\///g"| sed 's/\*\.\(icon\|png\|svg\)//g'`
69 echo "themedir = \$(datadir)/icons/$THEME_NAME/$dir/$context" > $dir/$context/Makefile.am
70 echo "theme_DATA = $files" >> $dir/$context/Makefile.am
71 echo "EXTRA_DIST = \$(theme_DATA)" >> $dir/$context/Makefile.am
72 echo "install-data-local: install-themeDATA" >> $dir/$context/Makefile.am
73 echo " (cd \"\$(DESTDIR)\$(themedir)\" && \$(ICONMAP) -c $context )" >> $dir/$context/Makefile.am
74 echo "MAINTAINERCLEANFILES = Makefile.in" >> $dir/$context/Makefile.am
78 echo "Updating configure.ac"
79 M
=`echo "$MAKEFILES" | sed 's/\//\\\\\//g'`
80 sed -i -e "s/MAKEFILES/$M/" configure.ac
82 echo "Updating Makefile.am"
83 sed -i -e "s/REAL_SUB_DIRS/$SIZES/" Makefile.am
84 sed -i -e "s/THEME_NAME/$THEME_NAME/" Makefile.am