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