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 "Inherits=hicolor" >> index.theme
37 echo -n "Directories=" >> index.theme
39 DIRS
=`find * -type d | grep -v git | grep -v scalable | grep "/"`
44 echo -n "$foo," >> index.theme
49 size
=`echo $foo | cut -b -5`
50 if [ "$size" = 48x48
] ; then
51 echo -en "\n\n[$foo]\nSize=`echo $size | sed 's/\x.*//'`\nContext=`basename $foo`\nType=Scalable" >> index.theme
53 echo -en "\n\n[$foo]\nSize=`echo $size | sed 's/\x.*//'`\nContext=`basename $foo`\nType=Fixed" >> index.theme
57 echo "Creating Makefiles"
59 SIZES
=$
(find * -maxdepth 0 -type d
-not -name 'scalable' -printf '%f ')
61 MAKEFILES
='Makefile\n'
64 subdirs
=$
(find $dir/* -maxdepth 0 -type d
-printf '%f ')
65 echo "SUBDIRS=$subdirs" > $dir/Makefile.am
66 MAKEFILES
="$MAKEFILES\n$dir/Makefile"
67 for context
in $subdirs
70 MAKEFILES
="$MAKEFILES\n$dir/$context/Makefile"
71 files
=`echo $dir/$context/*.png|sed "s/$dir\/$context\///g"`
72 echo "themedir = \$(datadir)/icons/$THEME_NAME/$dir/$context" > $dir/$context/Makefile.am
73 echo "theme_DATA = $files" >> $dir/$context/Makefile.am
74 echo "EXTRA_DIST = \$(theme_DATA)" >> $dir/$context/Makefile.am
75 echo "install-data-local: install-themeDATA" >> $dir/$context/Makefile.am
76 echo " (cd \"\$(DESTDIR)\$(themedir)\" && \$(abs_top_srcdir)/icon-name-mapping -x \$(abs_top_srcdir)/legacy-icon-mapping.xml -c $context )" >> $dir/$context/Makefile.am
77 echo "MAINTAINERCLEANFILES = Makefile.in" >> $dir/$context/Makefile.am
81 echo "Updating configure.ac"
82 M
=`echo "$MAKEFILES" | sed 's/\//\\\\\//g'`
83 sed -i -e "s/MAKEFILES/$M/" configure.ac
85 echo "Updating Makefile.am"
86 sed -i -e "s/REAL_SUB_DIRS/$SIZES/" Makefile.am
87 sed -i -e "s/THEME_NAME/$THEME_NAME/" Makefile.am