test more devel projects; cleanup
[os-autoinst:opensuse.git] / Makefile
1 L=video/runlog.txt
2 newdays=2
3 #bwlimit=--bwlimit=1500
4 excludes=--exclude="*.zsync" --exclude="*DVD*" 
5 #excludes+=--exclude="*GNOME*"
6 #excludes+=--exclude="*i686*"
7 #excludes+=--exclude="*KDE*"
8 #repoexcludes=--exclude="texlive*"
9 #--max-delete=4000
10 #repoexcludes+=--exclude="x86_64"
11 #rsyncserver=rsync.opensuse.org
12 repourl=http://widehat.opensuse.org/repositories/
13 rsyncserver=stage.opensuse.org
14 dvdpath=/factory-all-dvd/iso/
15 testdir=testrun1
16 buildnr=$(shell cat factory-testing/repo/oss/media.1/build)
17 testedbuildnr=$(shell cat factory-tested/repo/oss/media.1/build)
18 #dvdpath=/factory-all-dvd/11.3-isos/
19
20 all: sync prune list
21 cron: reposync sync prune prune2 newvideos
22 syncall: reposync sync gnomesync dvdsync promosync biarchsync
23
24 sync:
25         for i in $(seq 1 36) ; do scripts/preparersync ; done
26         /usr/local/bin/withlock sync.lock rsync -aPHv ${bwlimit} ${excludes} rsync://${rsyncserver}/opensuse-full-with-factory/opensuse/factory/iso/ factory/iso/
27
28 prune:
29         -find liveiso/ factory/iso/ -type f -name \*.iso -atime +90 -mtime +90 -print0 | xargs --no-run-if-empty -0 rm -f
30         make resultarchive
31         -find testresults/ video/ -type f -name \*.iso -atime +150 -mtime +150 -print0 | xargs --no-run-if-empty -0 rm -f
32
33 prune2:
34         -df factory/iso/|grep -q "9[0-9]%" && find factory/iso/ -type f -mtime +20 -name "*.iso" |sort|perl -ne 'if(($$n++%2)==0){print}' | xargs --no-run-if-empty rm -f 
35
36 prune3: 
37         # only keep latest NET iso of each arch
38         #find factory/iso/ -name "*-NET-*"|sort -t- -k4| perl -ne '...'
39
40 renameresult:
41         mv -f video/$f.ogv video/$t.ogv
42         mv -f video/$f.ogv.autoinst.txt video/$t.ogv.autoinst.txt
43         mv -f testresults/$f testresults/$t
44 renamenetresults:
45         n=`perl -e '$$_="${buildnr}";s/.*Build(\d+)/$$1/;print;'` ; echo $$n ;\
46         make renameresult f=openSUSE-NET-i586-Build$f t=openSUSE-NET-i586-Build$f+$$n ;\
47         make renameresult f=openSUSE-NET-x86_64-Build$f t=openSUSE-NET-x86_64-Build$f+$$n
48         
49
50 list:
51         ls factory/iso/*Build*.iso
52 status:
53         ls factory-testing/iso/openSUSE-*x86_64-*
54         cat factory*/repo/oss/media.1/build /var/tmp/lastfactorysnapshotisobuildnr
55         @echo
56
57 dvdsync:
58         rsync -aPHv ${bwlimit} --exclude="*Biarch*" rsync://${rsyncserver}${dvdpath}openSUSE-DVD-*.iso factory/iso/
59 promosync:
60         rsync -aPHv ${bwlimit} rsync://${rsyncserver}${dvdpath}openSUSE-Promo-*.iso factory/iso/
61 biarchsync:
62         rsync -aPHv ${bwlimit} rsync://${rsyncserver}${dvdpath}openSUSE-DVD-Biarch-*.iso factory/iso/
63
64 #dvdsync:
65 #       curl -n https://api.opensuse.org/build/openSUSE:Factory/images/local/_product:openSUSE-dvd5-dvd-i586/
66
67 ftpsync:
68         wget -nc -np -r http://ftp.gwdg.de/pub/opensuse/factory/iso/
69         rm -f factory/iso/index.html*
70
71 gnomesync:
72         rsync -aPHv ${bwlimit} rsync://${rsyncserver}/opensuse-full-with-factory/opensuse/factory/iso/*GNOME*.iso factory/iso/
73
74 getkdeunstable:
75         wget -r -nc -np --accept "KDE4-UNSTABLE-Live*.iso" ${repourl}KDE:/Medias/images/iso/ #KDE4-UNSTABLE-Live.x86_64-4.5.77-Build2.3.iso
76         tools/niceisonames widehat.opensuse.org/repositories/KDE:/Medias/images/iso/*.iso
77 getsmeegol:
78         wget -r -nc -np --accept "Smeegol*.iso" ${repourl}Meego:/Netbook:/1.1/images/iso/
79         tools/niceisonames widehat.opensuse.org/repositories/Meego:/Netbook:/1.1/images/iso/*.iso
80
81
82 zsync:  
83         for type in NET KDE-LiveCD ; do \
84                 for arch in i586 i686 x86_64 ; do \
85                         x=`scripts/latestiso $$arch $$type`; test -z "$$x" || ln -f $$x factory/iso/openSUSE-$$type-$$arch-current-Media.iso ;\
86                 done ;\
87         done
88         $(MAKE) -C factory/iso/ -f ../../make/zsync.mk
89         scripts/removeoldzsync
90
91 reposync:
92         mkdir -p factory/repo/oss/suse/
93         # first sync all big files without deleting. This keeps consistency
94         # another sync in case server changed during first long sync
95         for i in 1 2 3 ; do date=$$(date +%s) ; /usr/local/bin/withlock reposync.lock rsync -aH ${bwlimit} ${repoexcludes} rsync://${rsyncserver}/opensuse-full-with-factory/opensuse/factory/repo/oss/suse/ factory/repo/oss/suse/ ; test $$(date +%s) -le $$(expr $$date + 200) && break ; done
96         # copy meta-data ; delete old files as last step
97         -rsync -aPHv --delete-after ${repoexcludes} rsync://${rsyncserver}/opensuse-full-with-factory/opensuse/factory/repo/ factory/repo/
98 preparesnapshot: sync reposync
99         mkdir -p factory-testing/repo/
100         rsync -aSHPv --delete-after --link-dest=../factory/ rsync://${rsyncserver}/opensuse-full-with-factory/opensuse/factory/ factory-testing/
101         make status
102
103 snapshot:
104         mkdir -p factory-tested/repo/
105         # link-dest is relative to dest dir
106         rsync -aH --delete-after --link-dest=../factory-testing/ factory-testing/ factory-tested/
107         tools/updateisobuildnr
108
109 resultarchive:
110         mkdir -p archive/
111         ln -f video/*.autoinst.txt archive/
112
113
114 ISOS=$(shell ls factory/iso/*Build*-Media.iso)
115 NEWISOS=$(shell find factory/iso/ -name "*[DN][VE][DT]*Build*-Media.iso" -mtime -$(newdays)|sort -r -t- -k4|head -8 ; find factory/iso/ -name "*LiveCD*Build*-Media.iso" -mtime -$(newdays)|sort -r -t- -k5|head -4)
116 # it is enough to test one i586+x86_64 NET-iso
117 NEWNETISOS=$(shell find factory/iso/ -name "*NET*Build*-Media.iso" -mtime -${newdays}|sort -r -t- -k4|head -2 ; find factory/iso/ -name "*DVD*Build*-Media.iso" -mtime -${newdays})
118 OGGS=$(patsubst factory/iso/%-Media.iso,video/%.ogv,$(ISOS))
119 NEWOGGS=$(patsubst factory/iso/%-Media.iso,video/%.ogv,$(NEWISOS))
120 allvideos: $(OGGS)
121 newvideos: $(NEWOGGS)
122 newlxdevideos: $(patsubst factory/iso/%-Media.iso,video/%-lxde.ogv,$(NEWNETISOS))
123 newxfcevideos: $(patsubst factory/iso/%-Media.iso,video/%-xfce.ogv,$(NEWNETISOS))
124 newgnomevideos: $(patsubst factory/iso/%-Media.iso,video/%-gnome.ogv,$(NEWNETISOS))
125
126 video/%.ogv: factory/iso/%-Media.iso
127         in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
128
129 video/%-lxde.ogv: factory/iso/%-Media.iso
130         export DESKTOP=lxde ; LVM=1 EXTRANAME=-$$DESKTOP in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
131
132 video/%-xfce.ogv: factory/iso/%-Media.iso
133         export DESKTOP=xfce ; EXTRANAME=-$$DESKTOP in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
134 video/%-gnome.ogv: factory/iso/%-Media.iso
135         export DESKTOP=gnome ; LVM=1 EXTRANAME=-$$DESKTOP in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
136 video/%-live.ogv: factory/iso/%-Media.iso
137         LIVETEST=1 in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
138 video/%-RAID10.ogv: factory/iso/%-Media.iso
139         export RAIDLEVEL=10 ; in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
140 video/%-RAID5.ogv: factory/iso/%-Media.iso
141         export RAIDLEVEL=5 ; in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
142 video/%-11.3dup.ogv: factory/iso/%-Media.iso
143         export UPGRADE=/space/bernhard/img/opensuse-113-32.img ; KEEPHDDS=1 in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
144 video/%-11.2dup.ogv: factory/iso/%-Media.iso
145         export UPGRADE=/space/bernhard/img/opensuse-112-64.img ; in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
146 video/%-11.1dup.ogv: factory/iso/%-Media.iso
147         export UPGRADE=/space/bernhard/img/opensuse-111-64.img ; HDDMODEL=ide KEEPHDDS=1 in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
148 video/%-basesystem.ogv: factory/iso/%-Media.iso
149         ADDONURL=${repourl}Base:/System/openSUSE_Factory/ in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
150 video/%-kernelhead.ogv: factory/iso/%-Media.iso
151         ADDONURL=${repourl}Kernel:/HEAD/openSUSE_Factory/ in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
152 video/%-mozilladevel.ogv: factory/iso/%-Media.iso
153         ADDONURL=${repourl}mozilla:/beta/SUSE_Factory/+${repourl}LibreOffice:/Unstable/openSUSE_Factory/ in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
154 video/%-xorgdevel.ogv: factory/iso/%-Media.iso
155         ADDONURL=${repourl}X11:/XOrg/openSUSE_Factory/+${repourl}Kernel:/HEAD/openSUSE_Factory/ in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
156 video/%-kdeplayground.ogv: factory/iso/%-Media.iso
157         ADDONURL=${repourl}KDE:/Unstable:/Playground/openSUSE_Factory/ in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
158 video/%-KDF.ogv: factory/iso/%-Media.iso
159         ADDONURL=${repourl}KDE:/Distro:/Factory/openSUSE_Factory/+${repourl}LibreOffice:/Unstable/openSUSE_Factory/ in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
160 video/%-gnomedevel.ogv: factory/iso/%-Media.iso
161         DESKTOP=gnome ADDONURL=${repourl}GNOME:/Factory/openSUSE_Factory/ in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
162 video/%-xfcedevel.ogv: factory/iso/%-Media.iso
163         DESKTOP=xfce ADDONURL=${repourl}X11:/xfce/openSUSE_Factory/ in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
164 video/%-lxdedevel.ogv: factory/iso/%-Media.iso
165         DESKTOP=lxde ADDONURL=${repourl}X11:/lxde/openSUSE_Factory/ in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
166 video/openSUSE-%.ogv: liveiso/openSUSE-%.iso
167         LIVEOBSWORKAROUND=1 LIVECD=1 LIVETEST=1 in=$< out=$@ L=$L testdir=${testdir} tools/isotovideo2
168
169
170         
171
172 %.ogg: %.mp3
173         ffmpeg -ab 192k -i $< -acodec vorbis $@
174 %-music.ogv: %.ogv
175         ffmpeg -t 100 -i $< -i /home/bernhard/public_html/mirror/opensuse/music/www.musopen.com/161.ogg -vcodec copy -acodec copy $@
176         #ffmpeg -t 100 -i $< -i /home/bernhard/public_html/mirror/opensuse/music/www.musopen.com/161.ogg -vcodec copy -acodec copy -f ogg - | ffmpeg2theora -o $@ -
177         #segfaults: ffmpeg -t 100 -b 20000k -i $< -i /home/bernhard/public_html/mirror/opensuse/music/www.musopen.com/161.mp3 -f ogg - | ffmpeg2theora -o $@ -
178         #ffmpeg -t 100 -i $< -i /home/bernhard/public_html/mirror/opensuse/music/www.musopen.com/161.mp3 -vcodec copy $@
179
180 gitcollect:
181         rsync -a /srv/www/ www/
182         rsync -a /usr/local/bin/umlffmpeg ./tools/
183         rsync -a /etc/apparmor.d/{srv.www,usr.sbin.{httpd,rsyncd}}* etc/apparmor.d
184         rsync -a /etc/apache2/conf.d/openqa.conf etc/apache2/conf.d/
185
186 janitor:
187         git update-server-info
188
189 clean:
190         rm -f factory/iso/*-current-Media.iso.zsync
191