Fixes for kdm theme and default wallpapers
[opensuse:art.git] / 12.2 / Makefile
1 NAME=lightrays
2 VERSION=12.2
3 VERSION_NO_DOT=`echo ${VERSION} | sed 's:\.::g'`
4
5 all: info openSUSE.tar.gz
6
7 info:
8         echo "Make sure to have inkscape and GraphicsMagick installed"
9
10 openSUSE.tar.gz: openSUSE.d
11         tar cvfz openSUSE.tar.gz openSUSE
12 #       rm -r openSUSE
13
14 openSUSE.d: gfxboot.d bootsplash.d kdelibs.d yast.d wallpaper.d ksplashx.d ksplash-qml.d kdm.d gnome.d susegreeter.d xfce.d gimp.d
15         cp Makefile LICENSE openSUSE
16
17 gfxboot.d: defaults
18         rm -rf openSUSE/gfxboot
19         inkscape -w 800 -e tmp.png gfxboot/startup.svg
20         mkdir -p openSUSE/gfxboot/data-boot/
21         gm convert -quality 100 -interlace None -colorspace YCbCr -sampling-factor 2x2 tmp.png openSUSE/gfxboot/data-boot/back.jpg
22         inkscape -w 800 -e tmp.png gfxboot/install.svg
23         mkdir -p openSUSE/gfxboot/data-install
24         gm convert -quality 100 -interlace None -colorspace YCbCr -sampling-factor 2x2 tmp.png openSUSE/gfxboot/data-install/back.jpg
25         inkscape -w 800 -e tmp.png gfxboot/welcome.svg
26         gm convert -quality 100 -interlace None -colorspace YCbCr -sampling-factor 2x2 tmp.png openSUSE/gfxboot/data-install/welcome.jpg
27         rm tmp.png
28
29 bootsplash.d:
30         mkdir -p openSUSE
31         rm -rf openSUSE/bootsplash
32         cd boot ;\
33         ./bootsplash.php
34         cp -a boot/bootsplash/openSUSE openSUSE/bootsplash
35
36 kdelibs.d: defaults
37         rm -rf openSUSE/kdelibs
38         mkdir -p openSUSE/kdelibs
39         cp kdelibs/body-background.jpg kdelibs/css.diff openSUSE/kdelibs
40
41 yast.d:
42         rm -rf openSUSE/yast_wizard
43         mkdir -p openSUSE
44         cp -a yast openSUSE/yast_wizard
45         rm -f openSUSE/yast_wizard/*.svg
46
47 wallpaper.d: defaults
48         rm -rf openSUSE/wallpapers
49         mkdir -p openSUSE/wallpapers
50         cp wallpapers/default-1600x1200.jpg.desktop openSUSE/wallpapers
51         cp wallpapers/default-1920x1200.jpg.desktop openSUSE/wallpapers
52         cp wallpapers/default-1920x1080.jpg.desktop openSUSE/wallpapers
53         mkdir -p openSUSE/wallpapers/openSUSEdefault/contents/images
54         sed "s:@VERSION@:${VERSION}:g;s:@VERSION_NO_DOT@:${VERSION_NO_DOT}:g" wallpapers/openSUSE-1600x1200.jpg.desktop.in > openSUSE/wallpapers/openSUSE${VERSION_NO_DOT}-1600x1200.jpg.desktop
55         sed "s:@VERSION@:${VERSION}:g;s:@VERSION_NO_DOT@:${VERSION_NO_DOT}:g" wallpapers/openSUSE-1920x1200.jpg.desktop.in > openSUSE/wallpapers/openSUSE${VERSION_NO_DOT}-1920x1200.jpg.desktop
56         sed "s:@VERSION@:${VERSION}:g;s:@VERSION_NO_DOT@:${VERSION_NO_DOT}:g" wallpapers/openSUSE-1920x1080.jpg.desktop.in > openSUSE/wallpapers/openSUSE${VERSION_NO_DOT}-1920x1080.jpg.desktop
57         ln -s openSUSE${VERSION_NO_DOT}-1600x1200.jpg openSUSE/wallpapers/default-1600x1200.jpg
58         ln -s openSUSE${VERSION_NO_DOT}-1920x1200.jpg openSUSE/wallpapers/default-1920x1200.jpg
59         ln -s openSUSE${VERSION_NO_DOT}-1920x1080.jpg openSUSE/wallpapers/default-1920x1080.jpg
60         cp default-1280x1024.jpg openSUSE/wallpapers/openSUSEdefault/contents/images/1280x1024.jpg
61         cp default-1600x1200.jpg openSUSE/wallpapers/openSUSEdefault/contents/images/1600x1200.jpg
62         cp default-1920x1080.jpg openSUSE/wallpapers/openSUSEdefault/contents/images/1920x1080.jpg
63         cp default-1920x1200.jpg openSUSE/wallpapers/openSUSEdefault/contents/images/1920x1200.jpg
64         ln -s openSUSEdefault/contents/images/1920x1080.jpg openSUSE/wallpapers/openSUSE${VERSION_NO_DOT}-1920x1080.jpg
65         ln -s openSUSEdefault/contents/images/1920x1200.jpg openSUSE/wallpapers/openSUSE${VERSION_NO_DOT}-1920x1200.jpg
66         ln -s openSUSEdefault/contents/images/1600x1200.jpg openSUSE/wallpapers/openSUSE${VERSION_NO_DOT}-1600x1200.jpg
67         convert -quality 90 -geometry 400x250 default-1920x1200.jpg openSUSE/wallpapers/openSUSEdefault/screenshot.jpg
68         cp -p kde-workspace/metadata.desktop openSUSE/wallpapers/openSUSEdefault/metadata.desktop
69
70 # When changing the commands below, also update the commands in gnome_dynamic
71 defaults:
72         inkscape -e default-1280x1024.png -w 1280 background-54.svg
73         convert -quality 100 -geometry 1280x1024 default-1280x1024.png default-1280x1024.jpg
74         
75         inkscape -e default-1600x1200.png -w 1600 background-43.svg
76         convert -quality 100 -geometry 1600x1200 default-1600x1200.png default-1600x1200.jpg
77         
78         inkscape -e default-1920x1080.png -w 1920 background-169.svg
79         convert -quality 100 -geometry 1920x1080 default-1920x1080.png default-1920x1080.jpg
80         
81         inkscape -e default-1920x1200.png -w 1920 background-1610.svg
82         convert -quality 100 -geometry 1920x1200 default-1920x1200.png default-1920x1200.jpg
83         rm default-1920x1200.png default-1920x1080.png default-1600x1200.png default-1280x1024.png
84
85 ksplashx.d: 
86         rm -rf openSUSE/ksplashx
87         mkdir -p openSUSE/ksplashx
88         sed "s:@VERSION@:${VERSION}:g" ksplashx/Theme.rc.in > openSUSE/ksplashx/Theme.rc
89         cp -a ksplashx/1920x1200 openSUSE/ksplashx/
90         inkscape -w 260 --export-id=Geeko -C -j -e openSUSE/ksplashx/1920x1200/opensuse-logo.png logo.svg
91         convert -geometry 300x250 default-1920x1200.jpg openSUSE/ksplashx/Preview.png
92
93 #This is called openSUSE
94 kdm.d: defaults
95         rm -rf openSUSE/kdm
96         mkdir -p openSUSE/kdm/themes
97         cp -a kdm openSUSE/kdm/themes/openSUSE
98         #Keep the source but don't package it
99         rm openSUSE/kdm/themes/openSUSE/panel.svgz
100         mv openSUSE/kdm/themes/openSUSE/pics openSUSE/kdm/
101
102 ksplash-qml.d: 
103         rm -rf openSUSE/ksplash-qml
104         mkdir -p openSUSE/ksplash-qml
105         sed "s:@VERSION@:${VERSION}:g" ksplash-qml/Theme.rc.in > openSUSE/ksplash-qml/Theme.rc
106         cp ksplash-qml/main.qml openSUSE/ksplash-qml/main.qml
107         cp ksplash-qml/Preview.png openSUSE/ksplash-qml/Preview.png
108         cp -a ksplash-qml/images openSUSE/ksplash-qml/
109
110 # Create images used for the dynamic wallpaper; note that we do the same as in the 'defaults' target
111 gnome_dynamic: defaults
112         rm -rf gnome/dynamic
113         mkdir -p gnome/dynamic
114         for file in morning night; do \
115                 inkscape -z -e gnome/$${file}-1280x1024.png -w 1280 gnome/$${file}54.svg ; \
116                 convert -quality 100 -geometry 1280x1024 gnome/$${file}-1280x1024.png gnome/dynamic/$${file}-1280x1024.jpg ; \
117                 inkscape -z -e gnome/$${file}-1600x1200.png -w 1600 gnome/$${file}43.svg ; \
118                 convert -quality 100 -geometry 1600x1200 gnome/$${file}-1600x1200.png gnome/dynamic/$${file}-1600x1200.jpg ; \
119                 inkscape -z -e gnome/$${file}-1920x1080.png -w 1920 -h 1080 gnome/$${file}169.svg ; \
120                 convert -quality 100 -geometry 1920x1080 gnome/$${file}-1920x1080.png gnome/dynamic/$${file}-1920x1080.jpg ; \
121                 inkscape -z -e gnome/$${file}-1920x1200.png -w 1920 -h 1200 gnome/$${file}1610.svg ; \
122                 convert -quality 100 -geometry 1920x1200 gnome/$${file}-1920x1200.png gnome/dynamic/$${file}-1920x1200.jpg ; \
123                 rm gnome/$${file}-1280x1024.png gnome/$${file}-1600x1200.png gnome/$${file}-1920x1200.png gnome/$${file}-1920x1080.png ; \
124         done
125         cp default-1280x1024.jpg gnome/dynamic/day-1280x1024.jpg
126         cp default-1600x1200.jpg gnome/dynamic/day-1600x1200.jpg
127         cp default-1920x1080.jpg gnome/dynamic/day-1920x1080.jpg
128         cp default-1920x1200.jpg gnome/dynamic/day-1920x1200.jpg
129         sed "s:@PATH_TO_IMAGES@:/usr/share/backgrounds/${NAME}:g" gnome/dynamic-wallpaper.xml.in > gnome/dynamic/${NAME}.xml
130         sed "s:@PATH_TO_IMAGES@:`pwd`/gnome/dynamic:g" gnome/dynamic-wallpaper.xml.in > gnome/dynamic-wallpaper-localtest.xml
131         sed "s:@PATH_TO_IMAGES@:`pwd`/gnome/dynamic:g;s:7200:6:g;s:14400:12:g;s:18000:15:g;s:25200:21:g" gnome/dynamic-wallpaper.xml.in > gnome/dynamic-wallpaper-localtest-fast.xml
132
133 gnome.d: gnome_dynamic
134         rm -rf openSUSE/gnome
135         mkdir -p openSUSE/gnome
136         sed "s:@VERSION@:${VERSION}:g;s:@GNOME_STATIC_DYNAMIC@:static:g" gnome/wallpaper-branding-openSUSE.xml.in > openSUSE/gnome/wallpaper-branding-openSUSE.xml
137         cp gnome/openSUSE-default-static.xml openSUSE/gnome/openSUSE-default-static.xml
138         sed "s:@VERSION@:${VERSION}:g;s:@GNOME_STATIC_DYNAMIC@:dynamic:g" gnome/wallpaper-branding-openSUSE.xml.in > openSUSE/gnome/dynamic-wallpaper-branding-openSUSE.xml
139         cp -a gnome/dynamic/ openSUSE/gnome/${NAME}
140
141 susegreeter.d:
142         rm -rf openSUSE/SUSEgreeter
143         mkdir -p openSUSE/SUSEgreeter
144         inkscape -w 800 -e openSUSE/SUSEgreeter/background.png kde-workspace/SUSEgreeter/background.svg
145
146 xfce.d:
147         rm -rf openSUSE/xfce
148         mkdir -p openSUSE/xfce
149         inkscape -w 350 -e openSUSE/xfce/splash.png xfce/splash.svg
150         cp xfce/COPYING openSUSE/xfce/COPYING
151
152 gimp.d:
153         rm -rf openSUSE/gimp
154         mkdir -p openSUSE/gimp
155         inkscape -w 300 -e openSUSE/gimp/splash.png gimp/splash.svg
156
157 install: # do not add requires here, this runs from generated openSUSE
158         mkdir -p ${DESTDIR}/etc/bootsplash/themes/openSUSE
159         cp -a bootsplash/* ${DESTDIR}/etc/bootsplash/themes/openSUSE/
160         cp LICENSE ${DESTDIR}/etc/bootsplash/themes/openSUSE/LICENSE
161
162         install -D -m 644 kdelibs/body-background.jpg ${DESTDIR}/usr/share/kde4/apps/kdeui/about/body-background.jpg
163
164         install -d ${DESTDIR}/usr/share/wallpapers
165         cp -a wallpapers/* ${DESTDIR}/usr/share/wallpapers
166
167         ## Install xml files used by GNOME to find default wallpaper
168         # Here's the setup we use:
169         #  - /usr/share/wallpapers/openSUSE-default.xml is the default background
170         #  - /usr/share/wallpapers/openSUSE-default.xml is a symlink (via
171         #    update-alternatives) to either:
172         #    a) /usr/share/wallpapers/openSUSE-default-static.xml (from
173         #        wallpaper-branding-openSUSE)
174         #    b) /usr/share/wallpapers/openSUSE-default-dynamic.xml (from
175         #        dynamic-wallpaper-branding-openSUSE)
176         #  - /usr/share/wallpapers/openSUSE-default-dynamic.xml is a symlink to the
177         #    dynamic background (since this XML file moves from a version to another)
178         #
179         # Static wallpaper
180         install -D -m 0644 gnome/wallpaper-branding-openSUSE.xml ${DESTDIR}/usr/share/gnome-background-properties/wallpaper-branding-openSUSE.xml
181         install -m 0644 gnome/openSUSE-default-static.xml ${DESTDIR}/usr/share/wallpapers/openSUSE-default-static.xml
182         # Dynamic wallpaper
183         install -d ${DESTDIR}/usr/share/backgrounds
184         if test -z "${NAME}"; then \
185             echo "Error in Makefile: NAME variable is unset." ;\
186             false ;\
187         fi
188         cp -a gnome/${NAME}/ ${DESTDIR}/usr/share/backgrounds/${NAME}
189         install -D -m 0644 gnome/dynamic-wallpaper-branding-openSUSE.xml ${DESTDIR}/usr/share/gnome-background-properties/dynamic-wallpaper-branding-openSUSE.xml
190         ln -s /usr/share/backgrounds/${NAME}/${NAME}.xml ${DESTDIR}/usr/share/wallpapers/openSUSE-default-dynamic.xml
191         ## End xml files used by GNOME
192
193         mkdir -p ${DESTDIR}/usr/share/kde4/apps/SUSEgreeter
194         cp -p SUSEgreeter/* ${DESTDIR}/usr/share/kde4/apps/SUSEgreeter
195
196         install -d ${DESTDIR}/usr/share/YaST2/theme/openSUSE
197         cp -a yast_wizard ${DESTDIR}/usr/share/YaST2/theme/openSUSE/wizard
198
199         install -d ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes
200         cp -a ksplashx ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse
201         mkdir -p ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/1600x1200  
202         ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1600x1200.jpg ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/1600x1200/background.jpg
203         ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1920x1200.jpg ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/1920x1200/background.jpg
204         mkdir -p ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/1280x1024
205         ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1280x1024.jpg ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/1280x1024/background.jpg
206         mkdir -p ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/1920x1080
207         ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1920x1080.jpg ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/1920x1080/background.jpg
208
209         mkdir -p ${DESTDIR}/usr/share/kde4/apps
210         cp -a kdm ${DESTDIR}/usr/share/kde4/apps/kdm
211         ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1600x1200.jpg ${DESTDIR}/usr/share/kde4/apps/kdm/themes/openSUSE/background-1600x1200.jpg
212         ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1920x1200.jpg ${DESTDIR}/usr/share/kde4/apps/kdm/themes/openSUSE/background-1920x1200.jpg
213         ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1280x1024.jpg ${DESTDIR}/usr/share/kde4/apps/kdm/themes/openSUSE/background-1280x1024.jpg
214         ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1920x1080.jpg ${DESTDIR}/usr/share/kde4/apps/kdm/themes/openSUSE/background-1920x1080.jpg
215
216         install -d ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes
217         cp -a ksplash-qml ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplash-qml-openSUSE
218         mkdir -p ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplash-qml-openSUSE/images
219         ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1920x1200.jpg ${DESTDIR}/usr/share/kde4/apps/ksplash/Themes/ksplash-qml-openSUSE/images/background.jpg
220
221         install -D xfce/splash.png ${DESTDIR}/usr/share/pixmaps/xfce4-splash-openSUSE.png
222
223         install -D gimp/splash.png ${DESTDIR}/usr/share/gimp/2.0/images/gimp-splash.png
224
225 check: # do not add requires here, this runs from generated openSUSE
226         ## Check GNOME-related xml files have contant that make sense
227         # Check that the link for the dynamic wallpaper is valid
228         LINK_TARGET=`readlink --canonicalize ${DESTDIR}/usr/share/wallpapers/openSUSE-default-dynamic.xml` ; \
229         test -f "$${LINK_TARGET}" || { echo "The link for openSUSE-default-dynamic.xml is invalid. Please fix it, or contact the GNOME team for help."; exit 1 ;}
230
231         # Check that all files referenced in xml files actually exist
232         for xml in ${DESTDIR}/usr/share/wallpapers/openSUSE-default-static.xml ${DESTDIR}/usr/share/wallpapers/openSUSE-default-dynamic.xml; do \
233           xml_basename=`basename $${xml}` ; \
234           for file in `sed "s:<[^>]*>::g" $${xml} | grep /usr`; do \
235               test -f ${DESTDIR}/$${file} || { echo "$${file} is mentioned in $${xml_basename} but does not exist. Please update $${xml_basename}, or contact the GNOME team for help."; exit 1 ;} ; \
236           done ; \
237         done
238
239         # Check that xml files reference all relevant files
240         for file in ${DESTDIR}/usr/share/wallpapers/openSUSEdefault/contents/images/*.jpg; do \
241            IMG=$${file#${DESTDIR}} ; \
242            grep -q $${IMG} ${DESTDIR}/usr/share/wallpapers/openSUSE-default-static.xml || { echo "$${IMG} not mentioned in openSUSE-default-static.xml. Please add it there, or contact the GNOME team for help." ; exit 1 ;} ; \
243         done
244
245         for file in ${DESTDIR}/usr/share/backgrounds/${NAME}/*.jpg; do \
246            IMG=$${file#${DESTDIR}} ; \
247            grep -q $${IMG} ${DESTDIR}/usr/share/wallpapers/openSUSE-default-dynamic.xml || { echo "$${IMG} not mentioned in openSUSE-default-dynamic.xml. Please add it there, or contact the GNOME team for help." ; exit 1 ;} ; \
248         done
249         ## End check of GNOME-related xml files